Base58 Encode & Decode

Bitcoin-alphabet Base58 plus short-link Base62, with leading zeros handled correctly.

Base58 is the Bitcoin ecosystem's invention: drop the visually confusable 0 (zero), O, I, l from Base64 along with + and /, leaving 58 characters. Addresses, transaction hashes and IPFS CIDs use it — designed so hand-copying, phone typing and verbal relay all survive. Base62 is its cousin: the full alphanumeric set (0-9A-Za-z), which URL shorteners use to fold incrementing IDs into short strings.

The encoding is big-integer division in base 58/62, implemented here with BigInt; leading zero bytes follow the convention of one leading character each. Text is UTF-8 encoded to bytes first, so Chinese, English and emoji round-trip correctly.

Base58 vs Base58Check

Bare Base58 is pure base conversion; Bitcoin actually uses Base58Check — a version byte, the payload, and a double-SHA-256 checksum, all Base58-encoded together. This tool implements bare Base58 (the general layer, like Base62); for Bitcoin addresses, assemble the Check framing first, then encode here.

Why leading zeros matter

A leading 0x00 byte is invisible to a big integer — without special handling it is lost. The convention: each leading zero byte becomes one leading "1" character, which is why Bitcoin addresses start with 1 (their version byte is 0).

Frequently asked questions

Which should I use, Base58 or Base62?
Human transcription and confusable-resistance: Base58 (no 0/O/I/l). Program-only contexts like short URLs and ID compaction: Base62 — one more character for extra compactness, naturally URL-safe.
Decoding says invalid character — why?
The Base58 alphabet has no 0, O, I or l; their presence means the data is Base62 or another encoding — switch families. Spaces and newlines are ignored automatically.
Is it case-sensitive?
Yes. The alphabets mix upper and lower case, a key difference from case-insensitive Base32 — transcribe Base58 character by character.

Related tools