Dev tools

Modhex encode

Modhex encode. Runs on your device, nothing is uploaded.

Runs on your device. The file is never uploaded.

Modhex encode rewrites each nibble of a file as one of Yubico's sixteen letters, from c for zero up to v for fifteen, high nibble first. Two letters come out per byte, exactly as long as ordinary hex but with no digits. It converts bytes and stops there: no YubiKey OTP is parsed, decoded or validated.

Input

Questions

What is Modhex?

A hexadecimal encoding with a different set of symbols. Instead of 0 to 9 and a to f, it uses the sixteen letters c, b, d, e, f, g, h, i, j, k, l, n, r, t, u, v, in that order. It is the alphabet Yubico uses for the one-time password strings a YubiKey types.

How do the values map?

Position by position: 0 is c, 1 is b, 2 is d, 3 is e, 4 is f, 5 is g, 6 is h, 7 is i, 8 is j, 9 is k, 10 is l, 11 is n, 12 is r, 13 is t, 14 is u and 15 is v. Each byte becomes two characters, high nibble first.

How is it different from Hex encode?

Only the symbols differ. Both write two characters per byte in the same order and produce output of exactly the same length, so you can convert between them with a straight sixteen-character substitution. Modhex output is letters only, which is why it looks like a word rather than a number.

Can it check or parse a YubiKey OTP?

No. This tool converts whatever bytes you give it into Modhex characters and stops there. It does not decode an OTP, does not know about public identities, session counters or timestamps, and does not validate anything against a key. Treat it as a notation converter rather than as a YubiKey utility.

Is there a Modhex decoder here?

No, the tool runs one way. The mapping is a fixed sixteen-character substitution, so you can convert Modhex back to ordinary hex with a search and replace in any editor, then use the From hexdump tool here to turn that hex into a file of real bytes.

Does my input leave the page?

No. It is converted in a Web Worker in this tab, with no upload and nothing kept afterwards. The site also works offline after the first load, so you can disconnect and still run it. Drop several files at once and each is converted on its own, with its own result to copy.

Related Dev tools