Base58 encoder and decoder — Bitcoin alphabet, text or hex bytes

Encode text or raw hex bytes as Base58, the alphabet used for Bitcoin addresses and many short IDs, or decode a Base58 string back to text or hex.

Live demo · real result from this tool
Direction
Bytes from

Encoded

2NEpo7TZRRrLZSi2U

Processed on your device — nothing is uploaded.

How to use the Base58 tool

  1. Set Direction to Encode or Decode.
  2. Set Bytes from to Text (UTF-8) for words, or Hex for binary data such as hashes and keys.
  3. Paste your input. In Hex mode, write bytes like 00 00 28 7f or 0000287f.
  4. Copy the result. When decoding with Hex selected, the output is the bytes as hex.

What it does and when to use it

Base58 was introduced with Bitcoin to write addresses and keys in a form people can copy without mistakes. It is now used well beyond crypto: in IPFS content IDs, in some database and URL short IDs, and in other blockchains such as Solana for public keys.

Use this tool to turn a hex value into its Base58 form, to look at the bytes behind a Base58 string, or to test your own encoder against known results. It is an encoding, not encryption: anyone can decode Base58.

For a similar idea without the leading-zero rule and with all 62 letters and digits, see Base62. Base32 is case-insensitive and better for reading aloud, while Base64URL is shorter and standard in web tokens.

How it works

Base58 does not cut the data into fixed bit groups like Base64. Instead:

  1. The input bytes are read as one large unsigned number, most significant byte first.
  2. The number is divided by 58 again and again. Each remainder picks one character from 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz.
  3. The characters are written in reverse order, so the most significant digit comes first.
  4. One 1 is added at the front for each zero byte at the start of the input.

Decoding multiplies back up by 58 for each character. Because every character affects the whole number, the output length is not a fixed ratio of the input; it is roughly 1.37 characters per byte. The work happens in your browser.

Worked examples

Hello World!                    →  2NEpo7TZRRrLZSi2U
00 00 28 7f b4 cd   (Hex)       →  11233QC4
11233QC4   (Decode, Hex)        →  00 00 28 7f b4 cd
0OIl       (Decode)             →  “0” at position 1 is not a Base58 character.

Any other encoder that uses the Bitcoin alphabet gives the same strings, so these make handy checks for your own code. The 11 at the front of the second result comes from those zero bytes. The last line shows the error for characters the alphabet leaves out.

Limits and tips

  • Base58 has no built-in error detection. A typo gives different bytes, not an error, unless it uses a missing character.
  • There are other Base58 alphabets, such as Ripple’s and Flickr’s. This tool uses the Bitcoin alphabet only.
  • Spaces in a Base58 string are ignored when decoding.

Frequently asked questions

Why does Base58 leave out some characters?
The alphabet drops 0 (zero), O (capital o), I (capital i) and l (lower-case L), because they look alike in many fonts. It also has no + or /, so a Base58 value can be double-clicked and copied as one word.
Does this check Bitcoin address checksums?
No. This tool does plain Base58. A Bitcoin address uses Base58Check, which adds a version byte and a 4-byte checksum before encoding. Decoding an address here shows those bytes as hex, but the checksum is not verified.
Why do zero bytes turn into 1s?
Base58 treats the data as one big number, and leading zero bytes would vanish from a number. To keep them, each leading zero byte is written as 1, the first character of the alphabet. The decoder turns each leading 1 back into a zero byte.
When should I set "Bytes from" to Hex?
When your data is binary, such as a hash, key or address payload. Then you type the bytes as hex when encoding, and the decoder shows the result as hex instead of trying to read it as text.
Is there a size limit?
Yes, 20,000 bytes. Base58 needs big-number division, which gets slow on long input, so the tool stops with a message above that size. IDs and keys are far smaller.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close