Developer Tools
Base62 Encoder / Decoder
Encode and decode Base62 in your browser. URL-safe alphanumeric output, GMP, inverted, and truncated alphabets, text or hex input, leading-zero preserving.
Alphabet (character order)
All three use the same 62 characters in a different order. A string encoded with one ordering will not decode correctly with another, so match the alphabet to the system that produced the value.
Quick conversions
Input
13 bytesBase62 output
1wJfrzvdbtXUOlUjUf
Alphabet: GMP
Output length: 18 chars
Input bytes: 13
Symbols: none (URL safe)
Notes on Base62
- Why Base62: it uses only digits and letters, so the result is safe in URLs, query strings, filenames, and CSS class names without percent-encoding or the + / = characters that Base64 adds.
- Byte convention: this tool treats the input as one big number and re-bases it to 62, the same approach the base-x and base62 libraries use. It is not the same as Base64, which groups bits in fixed 6-bit chunks.
- Leading zeros: each leading zero byte becomes one leading "0" (the first character of the chosen alphabet). Decoding restores the exact byte count, so a hex value like 00ff round-trips without losing the leading byte.
- Alphabet matters: GMP, inverted, and truncated share the same 62 characters in different orders. Decoding with the wrong order either errors on an unexpected character or yields different bytes, so confirm which one the source uses.
- Whitespace: spaces, tabs, and newlines in the decode input are ignored, so you can paste a wrapped or multi-line string without cleaning it first.
- Local only: all encoding and decoding runs in your browser with TextEncoder and plain integer math. The strings you paste are never uploaded or logged.
How to use
- Pick Encode or Decode at the top, or use Swap to flip the current direction.
- Choose the alphabet that matches your system: GMP / standard (0-9 A-Z a-z) is the most common, with inverted and truncated orders available for sources that differ.
- When encoding, choose UTF-8 text or Hex bytes for the input. Hex lets you encode arbitrary binary such as a 16-byte UUID or a hash without character-set issues.
- When decoding, choose UTF-8 text or Hex bytes for the output. The tool falls back to hex automatically when the decoded bytes are not valid UTF-8.
- Load a quick-conversion preset (Hello, World!, a UUID to shorten, a hex value with a leading zero byte) to see a worked example and confirm the alphabet.
- Click Copy Base62 (or Copy output when decoding) to grab the result. Click Clear to reset the input.
About this tool
Base62 Encoder / Decoder converts between raw bytes and Base62 entirely in your browser. Base62 uses the 62 alphanumeric characters (the ten digits, twenty-six uppercase letters, and twenty-six lowercase letters) and no symbols at all, which is exactly what makes it popular: the output is safe to drop into a URL path, a query string, a filename, or a CSS identifier without percent-encoding and without the +, /, and = characters that standard Base64 introduces. It is the encoding behind a great many URL shorteners (the short code after the slash), compact opaque IDs, hashed asset filenames, and shrunk representations of large counters or hashes. This tool uses the byte-oriented big-number convention, the same one the widely used base-x and base62 libraries implement: the input bytes are read as a single base-256 integer and re-expressed in base 62 by repeated long division, so inputs of any length encode correctly without relying on BigInt. That is a different operation from Base64, which slices the input into fixed 6-bit groups; Base62 is not a drop-in replacement for Base64 and the two produce different strings, which this tool makes explicit. Encoding accepts either UTF-8 text or a hex byte sequence, so you can encode a string like Hello, World! or a 16-byte UUID without character-set ambiguity, and decoding renders the result as UTF-8 text with an automatic, clearly labelled hex fallback when the bytes are not valid UTF-8. Because real systems disagree about which character order counts as Base62, three alphabets are offered and shown in full: GMP / standard (digits, then uppercase, then lowercase), which most short-ID systems and the base62 npm default use; inverted (digits, then lowercase, then uppercase); and truncated (uppercase, then lowercase, then digits), a Base64-style order with the symbols removed. Decoding with the wrong alphabet either errors on an unexpected character, with the exact position reported, or silently yields different bytes, so the selector makes the choice deliberate. The leading-zero rule is handled in both directions: each leading zero byte becomes one leading 0 character and the byte count is restored exactly on the round trip, so a hex value such as 00ff does not lose its leading byte. The decoder ignores whitespace in pasted input so a wrapped or multi-line string works without cleanup. Useful for shortening UUIDs and database IDs into compact URL-safe codes, decoding a short link back to its underlying bytes, generating readable identifiers, comparing Base62 against Base64 and Base58, and any developer task that needs symbol-free alphanumeric encoding. Everything runs locally on your device using TextEncoder, TextDecoder, and plain integer math. Nothing you paste here is uploaded, logged, or shared.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Base58 Encoder / Decoder
Encode and decode Base58 with Bitcoin, Ripple, Flickr alphabets and Base58Check.
Open tool
DeveloperBase64 Encoder Decoder
Encode and decode Base64 with full Unicode.
Open tool
DeveloperBase32 Encoder / Decoder
Two-way Base32 with RFC 4648 Standard, Hex, and Crockford alphabets.
Open tool
DeveloperBase64URL Encoder and Decoder
Encode, decode, and convert URL-safe Base64URL, the variant used in JWTs and signed URLs.
Open tool
ConverterNumber Base Converter
Binary, octal, decimal, hex, and custom-base conversion with two's complement.
Open tool
DeveloperURL Encoder Decoder
Encode and decode percent-encoded URLs.
Open tool