How to use
- Type or paste text into the input box.
- Every encoding updates as you type: binary, octal, decimal, hex, the Base32 variants, Base36 through Base91, uuencode and xxencode.
- Compare the outputs to see which one is shortest or uses only the characters you can accept.
- Click Copy next to the result you need.
Every encoding from one input
Each encoding on this page turns the same bytes into a different set of characters. Seeing them side by side is the quickest way to choose an encoding for a project, to recognize a string you found in a log or a config file, or to learn how the formats differ. Your text is encoded as UTF-8 bytes, so an accented letter counts as two bytes and a Chinese character as three. Everything runs in your browser.
- Per-byte numbers. Binary, octal and decimal write every byte on its own. Easy to read, but long.
- Bit groups. Hex, Base32 (with Base32hex, Crockford and z-base-32), Base64 and Base64URL give each character a fixed number of bits, so the output length depends only on the input length.
- Big numbers. Base36, Base58 and Base62 treat the whole input as one large integer. The length can vary by a character with the value, and leading zero bytes are kept as leading characters.
- Blocks. Base45 turns 2 bytes into 3 characters, Ascii85, Z85 and Base85 turn 4 bytes into 5, and Base91 packs 13 or 14 bits into each pair of characters.
- Lines. uuencode and xxencode are older email and Usenet formats that write data in lines, each starting with a length character.
Output size compared
How many characters each encoding needs per input byte, and how long a 32-byte value such as a SHA-256 hash or an Ed25519 public key becomes:
| Encoding | Characters per byte | 32 bytes become |
|---|---|---|
| Base16 (hex) | 2.0 | 64 |
| Base32 | 1.6 | 56 (52 without padding) |
| Base36 | about 1.55 | 49 or 50 |
| Base45 | 1.5 | 48 |
| Base58 | about 1.37 | 43 or 44 |
| Base62 | about 1.34 | 42 or 43 |
| Base64 | about 1.33 | 44 (43 without padding) |
| Base85 | 1.25 | 40 |
| Base91 | about 1.23 | 39 or 40 |
Moving from hex to Base64 saves a third of the length. Going further, from Base64 to Base91, saves only about 8% more.
Which encoding to pick
The shortest output is not always the best one. Ascii85 can contain quotes and backslashes, and Base91 can contain double quotes, so both may need escaping in JSON, HTML or shell commands. Think about where the string has to go:
- URLs and file names: Base64URL, Base58 or Base62.
- Reading aloud or typing by hand: Crockford Base32 or Base58, which leave out look-alike characters.
- Case-insensitive systems: hex, Base32 or Base36.
- QR codes: Base45, which uses only the characters of the QR alphanumeric mode.
- Compact text in PDF, Git or ZeroMQ: Ascii85, Base85 or Z85.
- Maximum compatibility: Base64, which almost every language and platform supports.
Frequently asked questions
Which encoding gives the shortest output?
Of the encodings on this page, Base91 is the most compact at about 1.23 characters per byte, followed by Ascii85, Z85 and Base85 at 1.25. Base64 needs about 1.33 but is supported far more widely, which is why it is the usual default.
Why do Base58 and Base62 results vary in length for inputs of the same size?
They convert the whole input as one big number, so the length depends on its value and not only on its size. Each leading zero byte also adds one leading character. Hex, Base32 and Base64 always give the same length for the same number of bytes.
Can I decode a string on this page?
Why is the binary output so long?
Binary writes 8 digits for every byte, plus separators, so it is at least four times as long as hex. It is meant for looking at individual bits, not for storing or sending data.
Is my text sent to a server?
No. All encodings are computed by JavaScript in your browser, and the text never leaves your device.