🔓 Base62 Decoder – Convert Base62 Strings Back to Text, Numbers & Hex
Base62 decoding reverses the Base62 encoding process, converting compact alphanumeric tokens back into their original form — plain text, large integers, or raw byte sequences. Because Base62 uses only the 62 URL-safe characters 0–9, A–Z, and a–z, it is widely used for URL shorteners, session tokens, distributed database IDs, and referral codes.
How Base62 Decoding Works
A Base62 string is essentially a number written in base 62. Each character has a positional value determined by its index in the alphabet. The decoder computes:
decoded_int = Σ (alphabet.indexOf(char[i]) × 62^(n-1-i)) for i = 0 to n-1The resulting integer is then interpreted as a sequence of bytes (big-endian), which are decoded as UTF-8 text, kept as a decimal number, or displayed as a hexadecimal string depending on the selected output mode. JavaScript's native BigInt is used throughout to prevent overflow on tokens of any length.
Alphabet Variants
The mapping between characters and values depends entirely on the alphabet used during encoding. Three variants are supported:
| Variant | Alphabet Order | Common Use |
|---|---|---|
| Standard | 0-9 A-Z a-z | Most encoders, URL shorteners |
| Inverted (Flickr) | 0-9 a-z A-Z | Flickr short URLs, some ID systems |
| Custom | Any 62 unique characters | Proprietary or obfuscated token schemes |
Output Modes
Choose how the decoded bytes should be presented:
- Text (UTF-8) — Interprets the bytes as a human-readable string. Best for encoded short messages, usernames, or slugs.
- Integer (Decimal) — Returns the raw numeric value as a decimal string. Ideal for distributed IDs, Snowflake tokens, and numeric database keys.
- Hex — Displays the decoded bytes as a lowercase hexadecimal string, useful for inspecting binary payloads or verifying cryptographic tokens.
- Binary — Shows decoded bytes as space-separated 8-bit groups for low-level analysis.
Batch Decoding
Enter multiple Base62 tokens (one per line) to decode them all at once. Each line is validated and decoded independently — invalid tokens display an error for that row without stopping the rest of the batch. Results appear in a table with the row number, input token, decoded output, and status.
Round-Trip Verification
The tool automatically re-encodes the decoded result and compares it to your original input. A ✓ Match badge confirms that the decoding was lossless; a ✗ Mismatch badge indicates a potential alphabet mismatch or data loss during encoding.
Common Use Cases
- Decoding YouTube video IDs and short URL tokens back to numeric IDs
- Inspecting session tokens, CSRF tokens, and referral codes
- Reversing compact database primary keys from Base62 back to integers
- Verifying round-trip integrity of a custom Base62 encoding pipeline
- Processing bulk token exports in batch mode
Tips for Accurate Decoding
- Always use the same alphabet that was used during encoding — a single character order mismatch will produce completely wrong output.
- If the decoded text looks like garbage, try switching output mode to Integer or Hex.
- Leading
0characters in Base62 (the first character of the alphabet) represent leading zero bytes — they are significant and preserved by this decoder. - For very large numeric IDs, make sure to copy the full decoded integer — browser JavaScript numbers cap at 53-bit precision, but this tool uses
BigIntinternally.