🛠️Dev Toolbox

🪙 Base58 Encoder/Decoder

Encode and decode data using the Base58 alphabet, the same encoding used by Bitcoin addresses.

If you've ever looked at a Bitcoin address — something like 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa — you've seen Base58 in the wild. Satoshi designed it to solve a specific problem: Bitcoin addresses get transcribed. Printed on paper wallets, read aloud during peer-to-peer trades, typed manually off a screen. Every visual ambiguity is a potential lost coin. So they dropped 0, O, I, and l from the alphabet entirely.

The alphabet is 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz. Yes, no zero. The first character is 1, not A. That's important because 1 is also what leading zero bytes map to — if your raw bytes start with 0x00, the Base58 output starts with 1. Trim those and your decoded bytes come back short. I've watched people debug this for an hour before realizing the address "lost" its leading characters in a spreadsheet round-trip.

The encoding isn't bitwise like Base64. It's base conversion — treating the entire byte array as one big number and repeatedly dividing by 58. That makes it slower, and streaming implementations are genuinely annoying. For typical use — a 20-byte key hash, a short identifier — you won't notice. If you're encoding megabytes of arbitrary binary, don't. Use Base64 instead and save yourself 5-10% space too.

The Base58Check variant is what actually ships in production. It appends a 4-byte checksum (first 4 bytes of SHA-256(SHA-256(data))) before encoding. Decode a raw Base58 string where the consumer expects Base58Check and everything falls apart — the checksum bytes get interpreted as payload. Match the variant to your protocol.

URL shorteners love this encoding. Take a numeric ID like 123456789, Base58-encode it, get BYxnFO. No special characters, no percent-encoding, and it looks clean in a URL. Same trick works for coupon codes, any time you want a compact opaque identifier that won't confuse humans or URIs.

The tool accepts either text or hex bytes as input, because in practice you're usually feeding it the hex form of a key hash. If you paste text, it first converts to UTF-8 bytes, then encodes the bytes. That means "hello" and 68656c6c6f produce the same output. Don't overthink it — pick whichever representation you're staring at already.

More Developer Tools

Explore our complete collection of 60+ free developer tools at dev.aisoosoo.com. All tools run 100% in your browser — no signup, no data sent to servers.