Introduction
Base36 is a positional numeral system that uses the 36 characters `0-9a-z` to represent integers. It is the most compact case-insensitive alphanumeric encoding and appears in URL shorteners, Reddit's comment and submission IDs, YouTube-style video IDs (when extended), and database primary keys where readability and case-insensitivity matter. This tool encodes arbitrary bytes to Base36 and decodes Base36 strings back to bytes, entirely in your browser.
What this tool does
- Encodes UTF-8 text or raw bytes into a Base36 string using `0-9a-z`.
- Decodes Base36 strings back to bytes, rendering the result as UTF-8 or hex.
- Handles arbitrarily large inputs using BigInt arithmetic.
- Updates the result in real time as you type, with a copy-to-clipboard button.
- Processes all data locally in your browser with no network requests.
How this tool works
Type or paste text into the input field and pick whether to encode or decode. The encoder converts the input to UTF-8 bytes, treats the byte array as a single big-endian unsigned integer using BigInt, and repeatedly divides by 36 to emit the least significant digit each iteration. The decoder reverses this, multiplying the running total by 36 and adding each digit's value, then converts the resulting BigInt back to a byte array. All computation runs client-side.
How Base36 works
Base36 is a direct application of base conversion: any non-negative integer can be written in base 36 by repeated division. Because 36 = 4 × 9, the alphabet is exactly the union of decimal digits and lowercase Latin letters, which keeps the output case-insensitive and URL-safe. The encoding is not standardized by an RFC; it is a convention used by systems such as Reddit (which uses Base36 IDs), MongoDB's `str` representation of ObjectIds in some drivers, and various URL shorteners. The expansion ratio is roughly 1.55x for random binary input, sitting between Base16 (hex, 2x) and Base64 (1.33x).
How to use this tool
- Choose Encode or Decode using the mode toggle.
- Paste your text (when encoding) or Base36 string (when decoding) into the input.
- The result appears instantly in the output field.
- Use Copy to copy the result to your clipboard.
- Switch modes or edit the input at any time; the output updates automatically.
Real-world examples
Encoding a short string
Input: `Hi` → Output: `1c8`. The same input always produces the same output and the round trip back to `Hi` is lossless.
Decoding a Reddit-style ID
Input: `1c8` → Output: `Hi`. Longer IDs such as `l3x7p` decode to multi-byte strings, demonstrating the BigInt backing.
Empty input
Input: empty string. The encoder produces an empty string and the decoder accepts an empty string as zero, returning no bytes.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Base36 | O(n²) — BigInt division per digit | URL shorteners, Reddit IDs, case-insensitive storage |
| Base62 | O(n²) — BigInt division per digit | YouTube-style IDs, case-sensitive short URLs |
| Base64 | O(n) — fixed 3-byte groups | Email attachments, data URIs, JWT |
| Base16 (hex) | O(n) — one nibble per char | Hashes, byte dumps, debugging |
Limitations or considerations
Base36 is not standardized by an RFC and there is no canonical byte-padding rule, so different implementations may disagree on leading-zero handling. This tool treats the input as a single big-endian integer, so a leading zero byte in the input is preserved by emitting a leading `0` in the output. Base36 is not cryptographically secure and is not a compression algorithm — it expands data by roughly 55%. For very large inputs the BigInt arithmetic is O(n²) and may be slow.
Frequently asked questions
Is Base36 the same as Base62?
No. Base36 uses `0-9a-z` (36 symbols) and is case-insensitive. Base62 adds uppercase letters (`0-9a-zA-Z`, 62 symbols) and is case-sensitive, producing shorter output but requiring case preservation.
Why does my output have a leading zero?
A leading `0` in Base36 represents a leading zero byte in the input. This preserves the exact byte sequence so that the round trip is lossless. Some other implementations drop leading zeros, which loses information.
Can I use Base36 for cryptographic identifiers?
You can, but it is not a security measure. Base36 is an encoding, not encryption. Use it for readability and case-insensitivity, not for confidentiality.
How does Base36 compare to Base64 for binary data?
Base64 is about 16% denser and runs in linear time because it operates on fixed 3-byte groups. Base36 is better when you need case-insensitive, URL-safe output and can tolerate the extra length.
Conclusion
The Base36 encoder/decoder is a fast, BigInt-backed tool for converting between bytes and the case-insensitive alphanumeric alphabet used by URL shorteners and Reddit-style IDs. With real-time conversion, lossless round trips, and a fully client-side implementation, it is a handy utility for inspecting and producing Base36 payloads.