← All tools

Base62 Encoder / Decoder

Encode and decode Base62 — the 62-symbol alphabet 0–9 A–Z a–z used by URL shorteners, database object IDs (e.g. YouTube, Flickr), and short link codes. Convert arbitrary text/bytes to a compact Base62 string and back, or convert an integer to and from Base62. Leading zero bytes are preserved (prefixed as 0 characters, mirroring how Base58 handles them). All arithmetic uses BigInt, so any length stays exact. Everything runs locally in your browser.

Input

Output

—

Base62 maps bytes (or an integer) to the 62 characters 0–9 then A–Z then a–z. To encode bytes, the whole byte sequence is read as one big-endian integer and repeatedly divided by 62, the remainders indexing the alphabet; leading zero bytes would be lost, so they are instead emitted directly as leading 0 characters (and stripped back on decode). This is the same leading-zero trick Bitcoin's Base58 uses. Base62 avoids the visually-similar symbols Base58 drops (0/O, l/I) but is still URL- and filename-safe with no punctuation, making it popular for short identifiers. It is less compact than Base64 (log₂62 ≈ 5.95 bits/char vs 6) but has no +, /, or = padding. Pairs with the Base58, Base64, and Ascii85 tools. Everything runs locally — nothing leaves your browser.