Base32, Base58 and Base85 Encoder / Decoder
Type or paste text (or hex bytes) to encode it as Base32, Base32hex, Crockford Base32, Base58, Base58Check, Ascii85 or Z85, or switch to Decode to turn it back. The example “foobar” is 6 bytes in UTF-8 and becomes MZXW6YTBOI====== in Base32 (the RFC 4648 §10 test vector), CPNMUOJ1E8====== in Base32hex, CSQPYRK1E8 in Crockford Base32 (check symbol 6), t1Zv2yaZ in Base58 and AoDTs@<) in Ascii85. Decoding ignores spaces and line breaks and points at the first wrong character by position. Base58Check adds a double SHA-256 checksum, computed in your browser with Web Crypto. Nothing you enter is uploaded.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Your text is converted on this device and never uploaded. It is not saved either: reload the page and it is gone.
Result
Encoded 6 bytes of UTF-8 text as Base32.
- Input
- 6 bytes
- Base32
- 16 characters
- Size change
- +167%
RFC 4648 §10 test vectors
| Text | Base32 | Base32hex | Base32 without padding |
|---|---|---|---|
| (empty) | (empty) | (empty) | (empty) |
| f | MY====== | CO====== | MY |
| fo | MZXQ==== | CPNG==== | MZXQ |
| foo | MZXW6=== | CPNMU=== | MZXW6 |
| foob | MZXW6YQ= | CPNMUOG= | MZXW6YQ |
| fooba | MZXW6YTB | CPNMUOJ1 | MZXW6YTB |
| foobar | MZXW6YTBOI====== | CPNMUOJ1E8====== | MZXW6YTBOI |
Alphabets and where each format is used
| Format | Characters | Left out or special | Typical use |
|---|---|---|---|
| Base32 (RFC 4648 §6) | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 2 3 4 5 6 7 | “=” padding; no 0, 1, 8, 9 | One-time-password secrets, onion addresses |
| Base32hex (RFC 4648 §7) | 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V | “=” padding; sorts like the bytes | DNSSEC NSEC3 hashes |
| Crockford Base32 | 0 1 2 3 4 5 6 7 8 9 A B C D E F G H J K M N P Q R S T V W X Y Z | No I, L, O, U; check symbols * ~ $ = U | Human-typed identifiers and codes |
| Base58 (Bitcoin) | 1 2 3 4 5 6 7 8 9 A B C D E F G H J K L M N P Q R S T U V W X Y Z a b c d e f g h i j k m n o p q r s t u v w x y z | No 0, O, I, l; leading zero bytes become “1” | Bitcoin addresses, IPFS CIDv0 |
| Ascii85 (Adobe) | ! to u (ASCII 33 to 117) | “z” for four zero bytes; optional <~ and ~> | PostScript and PDF streams |
| Z85 (ZeroMQ RFC 32) | 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z . - : + = ^ ! / * ? & < > ( ) [ ] { } @ % $ # | Input must be a multiple of 4 bytes; safe in source code | ZeroMQ CURVE keys |
Base58 and Base58Check examples
| Bytes (hex) | Base58 |
|---|---|
| 61 | 2g |
| 626262 | a3gV |
| 73696d706c792061206c6f6e6720737472696e67 | 2cFupjhnEsSn59qHXstmK2ffpLv2 |
| 572e4794 | 3EFU7m |
| 00eb15231dfceb60925886b67d065299925915aeb172c06647 | 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L |
| 0000000000 | 11111 |
| 0062e907b15cbf27d5425399ebf6f0fb50ebb88f18 | 12NvYg7CXwVYtMDYia7n9viekJ6d5 |
| 0062e907b15cbf27d5425399ebf6f0fb50ebb88f18 + checksum (Base58Check) | 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa |
Crockford Base32 decoding aliases
| You type | Read as | Why |
|---|---|---|
| O or o | 0 | Looks like zero |
| I, i, L or l | 1 | Look like one |
| U | not a data digit | Left out to avoid accidental obscenities; valid only as the check symbol |
| - (hyphen) | ignored | May be inserted for readability |
How much bigger each format gets
| Format | Characters for 100 bytes | Increase |
|---|---|---|
| Base32 | 160 | +60% |
| Crockford Base32 | 160 | +60% |
| Base58 | 136 | +36% |
| Base58Check (version 00) | 143 | +43% |
| Ascii85 | 125 | +25% |
| Z85 | 125 | +25% |
How to encode or decode Base32, Base58 or Base85
- Choose a format. Pick Base32, Base32hex, Crockford Base32, Base58, Base58Check, Ascii85 or Z85. Only the options that apply to that format are shown.
- Choose a direction. Pick “Encode” to convert text or hex bytes, or “Decode” to turn encoded text back into bytes.
- Say how bytes are written. Choose “Text (UTF-8)” for ordinary text, or “Hex bytes” to work with raw bytes such as 66 6f 6f. This applies to the input when encoding and to the result when decoding.
- Paste your input. The result appears as you type. A wrong character is reported with its position in what you typed.
- Copy the result. Copy the output, or use “Use result as input” to flip direction and check the round trip.
Frequently asked questions
- What is the difference between Base32, Base58 and Base85?
- They differ in how many characters carry the data. Base32 uses 32 (5 bits each, 60% larger), Base58 uses 58 and is built for strings people copy and type (about 37% larger), and Base85 uses 85 (4 bytes become 5 characters, 25% larger). Smaller alphabets are safer to read aloud and type; larger ones are more compact.
- What is Base32hex?
- Base32hex is the second Base32 alphabet in RFC 4648 §7. It uses 0–9 and A–V in that order, so encoded strings sort in the same order as the bytes they encode. DNSSEC uses it for NSEC3 hashed names.
- How does Crockford Base32 differ from standard Base32?
- Crockford Base32 uses 0–9 and A–Z without I, L, O and U, has no padding, ignores hyphens and reads O as 0 and I or L as 1, so it survives being typed by hand. It can also end with one of 37 check symbols that catches a mistyped or swapped character. The rules are on crockford.com/base32.
- How is the Crockford check symbol calculated here?
- Crockford defines the check symbol for a number: the number modulo 37, written with the symbols 0–9, A–Z (without I, L, O and U), * ~ $ = and U. For bytes, this tool reads the bytes as one big-endian number and applies that rule, so the number 1234 (04 d2) gets the symbol D. Other tools may check the 5-bit digit string instead and give a different symbol.
- Why does Base58 have no 0, O, I or l?
- Those four characters look alike in many fonts (0 and O, I and l), so Bitcoin’s Base58 leaves them out, and it also leaves out “+” and “/” so addresses select in one double-click. Base58 treats the bytes as one large number, so each leading zero byte is written as a leading “1”, which this tool keeps when decoding.
- What is Base58Check and how is the checksum calculated?
- Base58Check puts a version byte in front of the data, appends the first 4 bytes of SHA-256(SHA-256(version + data)) and encodes all of it in Base58. A mistyped address then fails the check with a very high probability. The hashing uses your browser’s Web Crypto API, which is why this format answers a moment after you type.
- What are Ascii85 and Z85?
- Both turn each 4 bytes into 5 characters. Ascii85 is the Adobe form used in PostScript and PDF: characters ! to u, “z” for four zero bytes and optional <~ and ~> markers. Z85 is the ZeroMQ RFC 32 form: a different 85-character alphabet that avoids quotes and backslashes, so it can sit inside source code, and the data must be a multiple of 4 bytes.
- What does “invalid character at position” mean?
- Each format accepts only its own characters. The position counts every character you typed, including spaces and line breaks, starting at 1, so you can find it in your text. For Base58 the message also names look-alikes such as 0, O, I and l.
- Is my text saved or sent anywhere?
- No. Encoding, decoding and the Base58Check hashes run in your browser, nothing is uploaded and nothing is saved: reload the page and it is gone. The only thing the site records, if you allow analytics, is that a button was used, never any of your text.
How it works
Text is converted to UTF-8 bytes with TextEncoder (or hex digits are read directly), and the same code path runs for the example on this page. Base32, Base32hex and Crockford Base32 take the bytes 5 bits at a time and look each value up in the alphabet; a last group is filled with zero bits, and RFC 4648 padding adds “=” up to a multiple of 8 characters. Decoders accept lower case, ignore spaces and line breaks, and reject lengths that no byte string can produce. Base58 treats the bytes as one big number and writes it in base 58, with a “1” for every leading zero byte; because that is quadratic, input over 8,000 characters is refused. Base58Check prepends the version byte(s) and appends the first 4 bytes of a double SHA-256 computed with SubtleCrypto.digest. Ascii85 and Z85 read 4 bytes as a big-endian number and write it as five base-85 digits; a short final Ascii85 group of n bytes becomes n + 1 characters, and a group above 2^32 − 1 is reported as an error. Results are checked against the RFC 4648 §10 vectors, the Bitcoin genesis address (1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa) and the RFC 32 vector (864fd26fb559f75b is HelloWorld). Bytes in hex are shown like this: 66 6f 6f 62 61 72.
Sources
- RFC 4648: The Base16, Base32, and Base64 Data Encodings (§6 Base32, §7 Base32hex, §10 test vectors)
- Douglas Crockford: Base 32 (alphabet, aliases, check symbols)
- Bitcoin Wiki: Base58Check encoding
- ZeroMQ RFC 32: Z85 (ZeroMQ Base-85 Encoding)
- Ascii85 (Adobe PostScript and PDF base-85 encoding)
- MDN: SubtleCrypto.digest()
More free tools
- Base64 Encode & DecodeEncode text or a file to Base64 and decode it back, with correct UTF-8 for emoji and any language, URL-safe and MIME variants. Runs in your browser.
- Hash GeneratorHash text or a file with SHA-256, SHA-1, SHA-384, SHA-512, MD5 and CRC32, add an HMAC key, and check a checksum. Runs in your browser; nothing is uploaded.
- JWT DecoderDecode a JWT to its header and payload, read exp, iat and nbf as UTC times, spot expired or alg none tokens, and check HMAC signatures. Runs locally.
- ULID GeneratorGenerate sortable ULIDs in your browser, up to 100 at a time, for now or any timestamp. Decode a ULID to its date and randomness, or check it is valid.
- ASCII TableAll 128 ASCII codes with decimal, hex, octal, binary, character, HTML entity and control-character names. Look up a character, number or name like tab.
- Hex CalculatorAdd, subtract, multiply, divide and AND, OR, XOR, NOT or shift hex numbers of any size, with 8 to 64-bit overflow, two’s complement and long-hand working.
More: Encoding and number systemsAll developer toolsAll toolsHome & DIY calculators