Encode a short sentence
Hello World!
2NEpo7TZRRrLZSi2U
A test vector from the Base58 specification draft. 12 bytes become 17 characters.
Encode text to Base58 and decode Base58 back, with the Bitcoin, Flickr and Ripple alphabets. The format behind Bitcoin addresses, Solana keys and IPFS hashes.
Hello World!
2NEpo7TZRRrLZSi2U
A test vector from the Base58 specification draft. 12 bytes become 17 characters.
USm3fpXnKG5EUBx2ndxBDMPVciP5hGey2Jh4NDv6gmeo1LkMeiKrLJUUBk6Z
The quick brown fox jumps over the lazy dog.
Another official test vector. There are no 0, O, I or l characters anywhere in it.
a
2g
a is byte 97. 97 = 1 × 58 + 39, and the digits 1 and 39 are 2 and g in the Bitcoin alphabet.
Base58 writes binary data using 58 characters: the digits and letters, minus four that are easy to confuse. It leaves out 0 (zero), O (capital o), I (capital i) and l (lowercase L), and it has no +, / or =. The result is a compact string that people can read and copy without mistakes, and that selects as one word when you double-click it.
Base58 was introduced by Bitcoin for addresses and keys. Today it is also used by IPFS, Solana, Monero (with its own block format) and many systems that need short, unambiguous IDs.
| Alphabet | Characters (value 0 → 57) | Used by |
|---|---|---|
| Bitcoin | 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz | Bitcoin, IPFS, Solana, most libraries |
| Flickr | 123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ | Flickr short photo URLs |
| Ripple | rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz | XRP Ledger addresses |
The same bytes give a different string in each alphabet, so a value encoded with one alphabet must be decoded with the same one.
58 is not a power of 2, so Base58 cannot split the input into fixed groups of bits the way Base64 or Base32 do. Instead, it treats the whole input as one big number and converts that number to base 58, exactly like converting a decimal number to another base by repeated division.
a is the number 97.2, 39 → g, so a becomes 2g.1 for every leading zero byte of the input, because those zeros would otherwise disappear from the number.The leading-zero rule matters. The bytes 00 00 28 7f b4 cd encode to 11233QC4: the two 1s stand for the two zero bytes. Bitcoin addresses that start with 1 get it this way, from a version byte of 0.
Each Base58 character carries about 5.86 bits, so the output is about 37% larger than the input, slightly more than Base64. Because the whole input is one number, encoding gets slower as the data grows (the work grows with the square of the length). That is fine for keys, hashes and addresses, but Base58 is a poor fit for files. This tool limits Base58 to 64 KB; use Base64 for anything larger.
Bitcoin addresses and WIF private keys use Base58Check, which adds structure before encoding:
Base58( version byte + payload + first 4 bytes of SHA256(SHA256(version + payload)) )The 4-byte checksum lets wallets reject a mistyped address. This tool does plain Base58: decoding an address shows the raw version byte, payload and checksum bytes (as binary), but it does not verify the checksum. Newer Bitcoin addresses (bc1…) use Bech32, which is a different encoding.
1…) and P2SH (3…) addresses, WIF private keys and extended keys (xpub…), all in Base58Check.Qm…) are Base58 multihashes. CIDv1 usually uses Base32 instead.import bs58 from 'bs58'; const encoded = bs58.encode(new TextEncoder().encode('Hello World!')); // "2NEpo7TZRRrLZSi2U"const bytes = bs58.decode(encoded);import base58 base58.b58encode(b'Hello World!') # b'2NEpo7TZRRrLZSi2U'base58.b58decode('2NEpo7TZRRrLZSi2U') # b'Hello World!' # Base58Check (adds and verifies the 4-byte checksum)base58.b58encode_check(b'\x00' + payload)const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; function base58Encode(bytes) { let n = 0n; for (const b of bytes) n = n * 256n + BigInt(b); let out = ''; while (n > 0n) { out = ALPHABET[Number(n % 58n)] + out; n /= 58n; } for (const b of bytes) { if (b !== 0) break; out = '1' + out; } // leading zero bytes return out;}"Invalid character" for 0, O, I or l
Those four characters do not exist in Base58. The value was mistyped (for example O instead of o), or it is not Base58 at all. Check the source, because guessing a replacement character changes the decoded bytes.
The result is different from another tool or library
The two sides use different alphabets (Bitcoin, Flickr or Ripple). Switch the Alphabet option. Also check whether the other tool uses Base58Check, which adds a version byte and checksum.
Leading 1 characters disappear, or zero bytes are lost
Code that converts Base58 to an integer and back drops leading zeros. A correct encoder writes one 1 per leading zero byte, and a decoder turns each leading 1 back into a zero byte.
A decoded Bitcoin address shows "Binary data"
That is expected. An address decodes to a version byte, a 20-byte hash and a 4-byte checksum, not to text. Download the bytes, or use the Hex tool to read them.
"Invalid checksum" in a wallet or library
The value uses Base58Check and one character is wrong. The checksum is doing its job: get the address again from its source instead of trying to fix it by hand.
They look alike in many fonts (0/O and I/l). Removing them makes addresses and keys much harder to misread or mistype, which matters when money is involved.
No. Base64 splits data into 6-bit groups and uses +, / and =. Base58 converts the whole input as one large number, has no special characters and skips lookalike letters. It is slightly larger and much slower on big data.
No. It does plain Base58 and does not verify the Base58Check checksum or the address version. Use a wallet or a dedicated address validator for that.
Base58 treats the input as one big number, so the work grows with the square of the length. Keys, hashes and IDs are tiny, so the 64 KB limit never gets in the way of normal use.
Use the Bitcoin alphabet unless you know otherwise. It is the default in nearly every library and is used by Bitcoin, IPFS and Solana. Ripple and Flickr have their own.
Everything runs in your browser and nothing is uploaded. Still, a private key is the money itself, so avoid pasting real keys into any website when you can.
Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.
Tip: press Ctrl D to bookmark dev247.