Base62 Encoder / Decoder
Encode and decode Base62 (URL-safe alphanumeric).
Overview
The Base62 encoder turns bytes or numbers into compact, URL-safe strings made from 0-9A-Za-z. There is no +, /, or =, so the output drops straight into query strings, path segments, and short links without escape headaches.
It is the encoding of choice for URL shorteners, idempotency keys, short IDs in REST APIs, and any case where you want a short, copy-paste-friendly token. Web developers and product engineers will recognise this as the same scheme behind many bit.ly-style shorteners and generated database identifiers.
How it works
Base62 represents an input as a base-62 number using the alphabet 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. For numeric input the tool repeatedly divides by 62 and collects digits; for byte input it treats the bytes as one big unsigned integer (most-significant byte first) and does the same. There is no padding and no standardized RFC — different libraries sometimes use different alphabet orderings — but the digit-then-uppercase-then-lowercase ordering is the most common convention.
Examples
Input: 1234567890
Output: 1LY7VK
Input: "Hello"
Output: 5TP3P3v
Input: 5TP3P3v
Output: "Hello"
Input: 0
Output: 0
FAQ
Base62 vs Base64?
Base64 is faster and standardised but uses +, /, and =, which need URL-encoding in many contexts. Base62 trades a tiny bit of density (about 4% larger output) for a string that needs zero escaping inside URLs, filenames, or CSV cells.
Is the output deterministic?
Yes. The same bytes always encode to the same string. There is no salt or randomness in the encoding itself.
Can I use it for integer-only IDs?
Absolutely — that is the most common use case. A 64-bit integer fits in 11 Base62 characters, which is roughly half the length of decimal and a third of hex.
Why are there multiple Base62 "standards"?
Because the encoding was never RFC'd, libraries vary on whether digits come first or letters come first. Always check that your encoder and decoder share an alphabet before passing tokens between systems.