How to use the Base62 tool
- Set Direction to Encode or Decode.
- Type your text, or paste a Base62 string, into Input.
- Copy the Encoded or Decoded result. Decoded bytes that are not valid text are shown as hex.
What it does and when to use it
Base62 is popular wherever a value must be made of letters and digits only: short link codes, public IDs in URLs, file names, and tokens that must survive double-click selection or systems that strip symbols. Unlike Base64 it needs no +, /, -, _ or =, so there is nothing to escape.
Use this tool to encode a short string into an alphanumeric code, to decode such a code during debugging, or to check an implementation that uses the same alphabet order.
If you need to avoid look-alike characters such as 0 and O, Base58 is the better choice. For a standardised, widely supported URL-safe format, use Base64URL. For a case-insensitive alphabet, see Base32.
How it works
Base62 cannot split bytes into fixed bit groups, because 62 is not a power of two. So it uses number conversion:
- Your text becomes UTF-8 bytes, read as one large number, most significant byte first.
- The number is divided by 62 repeatedly; each remainder picks a character from
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. - The characters are written most significant first, and leading zero bytes are added back as
0.
Decoding multiplies back up, character by character. The work happens in your browser and is limited to 20,000 bytes, because this kind of conversion slows down sharply on long input.
Worked examples
Hello → 5TP3P3v
5TP3P3v → Hello (Decode)
Hi! → JuWP
abc-123 → “-” at position 4 is not a Base62 character. (Decode)
“Hi!” is the bytes 0x48 0x69 0x21, which is the number 4,745,505. In base 62 that is J (19), u (56), W (32), P (25): 19 × 62³ + 56 × 62² + 32 × 62 + 25 = 4,745,505. The last line shows that a hyphen is not part of the alphabet.
Limits and tips
- Changing one byte of the input can change many characters of the output, because the whole input is one number.
- Do not mix Base62 values from systems with different alphabet orders.
- For long text, Base64URL is faster and more widely understood.
Frequently asked questions
Why does another Base62 tool give a different result?
Is Base62 case-sensitive?
How long will the output be?
What happens to leading zero bytes?
Is Base62 a safe way to hide an ID?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.