Base36 to Base64 Converter
Convert between Base36 and Base64 encoding instantly. Bidirectional converter with validation, copy, download, and full RFC 4648 compliance.
About
Base36 encodes data using 36 symbols (0 - 9, A - Z) and is common in URL shorteners, tracking codes, and compact identifiers. Base64 encodes arbitrary binary data into 64 printable ASCII characters per RFC 4648 and is the standard for embedding data in JSON, emails (MIME), and data URIs. Converting between them requires an intermediate arbitrary-precision integer representation because both are positional encodings over different radices. A manual conversion error - dropping a character, mishandling padding - silently corrupts data with no checksum to catch it. This tool converts through a BigInt intermediary: Base36 string โ BigInt โ byte array โ Base64 (and the reverse path). It handles arbitrary input lengths, validates charset before processing, and applies correct = padding per the RFC. Note: this tool treats the input as a single large integer in the source radix. It does not interpret Base36 as raw UTF-8 text.
Formulas
The conversion pipeline relies on positional numeral expansion and base-change arithmetic through an arbitrary-precision integer intermediary.
Base36 string โ BigInt (decoding):
N = nโ1โi=0 di โ 36i
where di is the digit value at position i from the right (0 - 9 โ 0 - 9, A - Z โ 10 - 35).
BigInt โ byte array:
Extract 8-bit chunks by repeated bitwise AND with 0xFF and right-shift by 8. Reverse the resulting array to get big-endian byte order.
Byte array โ Base64 (encoding per RFC 4648):
Group bytes into 3-byte (24-bit) blocks. Split each block into four 6-bit indices. Map each index to the Base64 alphabet: A - Z (0 - 25), a - z (26 - 51), 0 - 9 (52 - 61), + (62), / (63). Pad with = if the last block has fewer than 3 bytes.
Reverse path (Base64 โ Base36):
Decode Base64 to bytes (reverse lookup, strip padding), bytes to BigInt (big-endian accumulation), BigInt to Base36 by repeated divmod(36):
N = q โ 36 + r, where r maps to the Base36 digit. Repeat until q = 0. Reverse collected digits.
where N = arbitrary-precision integer, n = number of input characters, di = digit value at position i, q = quotient, r = remainder.
Reference Data
| Property | Base36 | Base64 (RFC 4648) |
|---|---|---|
| Radix | 36 | 64 |
| Alphabet | 0 - 9, A - Z | A - Z, a - z, 0 - 9, +, / |
| Padding | None | = (1 or 2 chars) |
| Case Sensitive | No (case-insensitive) | Yes |
| Bits per Character | โ 5.17 bits (log236) | 6 bits exactly |
| Efficiency vs Binary | 64.6% | 75% |
| Common Uses | URL shorteners, Reddit post IDs, NanoID | MIME email, Data URIs, JWT, PEM certs |
| Standard | No formal RFC | RFC 4648, RFC 2045 |
| Whitespace Handling | Not allowed | Ignored per RFC 2045 (MIME) |
| URL-Safe Variant | Inherently URL-safe | Base64url: - and _ replace + and / |
| Max Value in 6 chars | 2,176,782,335 (366 โ 1) | Encodes 4.5 raw bytes |
| Encoding Direction | Integer โ string | Bytes โ string |
| Null / Zero | 0 | AA== (single zero byte) |
| Leading Zeros | Significant (changes value) | Significant (maps to 0x00 bytes) |
| Example: decimal 255 | 73 | /w== |
| Example: decimal 1000000 | LFLS | D0JA |