All Tools

Base32, Base58 and Hex Encoder and Decoder Online

Encode text or a file as Base32, Base32hex, Base58, Base58Check or hex, and decode them back, in your browser. Decoding ignores spaces and case, verifies Base58Check checksums and names the first bad character. Nothing is uploaded.

Encoding
Direction

0 characters, 0 bytes

0 characters, 0 bytes


About the Base32, Base58 and hex encoder

This tool encodes text or a file as Base32, Base32hex, Base58, Base58Check or hex, and decodes them back. All five turn arbitrary bytes into plain characters that survive copy and paste, URLs, file names and systems that only accept letters and digits. Text is encoded as UTF-8 bytes. Everything runs in your browser: your text and files never leave your device and nothing is uploaded.

How to use it

Steps

  1. Pick an Encoding: Base32, Base32hex, Base58, Base58Check or Hex.
  2. Pick Encode or Decode. Type or paste into the input, or press Choose file to encode a file of up to 50 MB.
  3. Copy the result with Copy, or press Swap to move the output into the input and reverse the direction.
  4. When decoded bytes are not valid UTF-8 text, press Download decoded file, or turn on Show result as hex to read the bytes.

The encodings

Base32

Defined in RFC 4648 section 6. It uses the 26 capital letters and the digits 2 to 7, so it is case-insensitive and avoids the easily confused 0, 1 and 8. Every 5 bytes become 8 characters, and = pads the last group. Base32 is used for TOTP secrets in authenticator apps, onion addresses and DNSSEC records. Turn Padding off for systems that strip the = signs.

Base32hex

RFC 4648 section 7 uses the digits 0 to 9 and the letters A to V instead. Encoded values sort in the same order as the bytes they hold, which is why NSEC3 records in DNS use it.

Base58 and Base58Check

Base58 is the Bitcoin alphabet: digits and letters without 0, O, I and l, which look alike in many fonts. The bytes are treated as one large number, and each leading zero byte becomes a leading 1. Base58Check appends the first four bytes of a double SHA-256 of the payload, so a mistyped character is caught when decoding. Bitcoin addresses and WIF private keys use it. Because the conversion time grows with the square of the length, Base58 is limited to 16 KB here; it is meant for short values such as keys and addresses.

Hex

Hex, or Base16, writes each byte as two digits from 0 to 9 and a to f. It is the easiest format to read byte by byte, at the cost of doubling the size. Turn on Upper case for capital letters.

Decoding and errors

Decoding ignores spaces and line breaks in every encoding, and ignores letter case in Base32, Base32hex and hex. Base58 is case-sensitive, since upper and lower case letters are different digits. If a character does not belong to the alphabet, the page names it and gives its position, so MZX1W6=== reports "1" at position 4. A Base58Check value whose checksum does not match is rejected rather than decoded to the wrong bytes.

Which one should you use?

Use hex when people need to read or compare the bytes. Use Base32 when the value may be typed, spoken or used in a case-insensitive place such as a host name. Use Base58Check for values that people copy by hand and that must not be silently mistyped. For the most compact text form of a large file, use the Base64 Encoder instead, which is about a sixth shorter than Base32. To see the hex or binary codes of each character in a string, try Text to Hex. To fingerprint the same data, use the Hash Generator.

Open-source credits

  • Base32, Base32hex and hex are written for this site and follow RFC 4648, The Base16, Base32, and Base64 Data Encodings. The tests assert the RFC's section 10 test vectors.
  • Base58 and Base58Check are written for this site and follow the Bitcoin Base58Check encoding. The tests assert vectors from Bitcoin Core's base58_encode_decode.json and the Bitcoin wiki's address example.
  • The SHA-256 checksum of Base58Check is computed by @noble/hashes by Paul Miller, MIT licence.

Frequently asked questions

What is the difference between Base32 and Base32hex?

Both are defined in RFC 4648 and encode 5 bytes as 8 characters. Base32 uses the letters A to Z and the digits 2 to 7. Base32hex uses the digits 0 to 9 and the letters A to V, so encoded values sort in the same order as the bytes. Authenticator secrets use Base32; DNSSEC NSEC3 records use Base32hex.

Why does Base58 have no 0, O, I or l?

Those four characters look alike in many fonts. Bitcoin's Base58 leaves them out, along with the + and / of Base64, so a value can be read and typed by hand and selected with a double-click. The cost is that Base58 cannot be converted in fixed groups and is slower for long inputs.

What does the Base58Check checksum protect against?

Base58Check appends the first four bytes of a double SHA-256 of the payload. When the value is decoded the checksum is recomputed, so a mistyped or swapped character is detected with near certainty instead of producing a different but valid-looking value. It protects against mistakes, not against deliberate forgery.

Why does decoding offer a file download instead of text?

The decoded bytes are shown as text only when they are valid UTF-8. Keys, hashes and binary files usually are not, so the page offers them as a download, or as hex when you turn on Show result as hex.

Is my data uploaded?

No. Encoding and decoding run in your browser, and files are read locally. Nothing is sent anywhere and nothing is kept once you close the tab. Files of up to 50 MB are accepted, and Base58 is limited to 16 KB.

Other related tools