User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
0 characters
Examples:
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

base36 base64 encoding converter number base converter radix conversion base36 encoder base64 decoder

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

PropertyBase36Base64 (RFC 4648)
Radix3664
Alphabet0 - 9, A - ZA - Z, a - z, 0 - 9, +, /
PaddingNone= (1 or 2 chars)
Case SensitiveNo (case-insensitive)Yes
Bits per Characterโ‰ˆ 5.17 bits (log236)6 bits exactly
Efficiency vs Binary64.6%75%
Common UsesURL shorteners, Reddit post IDs, NanoIDMIME email, Data URIs, JWT, PEM certs
StandardNo formal RFCRFC 4648, RFC 2045
Whitespace HandlingNot allowedIgnored per RFC 2045 (MIME)
URL-Safe VariantInherently URL-safeBase64url: - and _ replace + and /
Max Value in 6 chars2,176,782,335 (366 โˆ’ 1)Encodes 4.5 raw bytes
Encoding DirectionInteger โ†’ stringBytes โ†’ string
Null / Zero0AA== (single zero byte)
Leading ZerosSignificant (changes value)Significant (maps to 0x00 bytes)
Example: decimal 25573/w==
Example: decimal 1000000LFLSD0JA

Frequently Asked Questions

Base36 is a positional numeral system, not a character encoding. The string "HELLO" in Base36 represents the integer 29,234,652 (Hร—36โด + Eร—36ยณ + Lร—36ยฒ + Lร—36ยน + Oร—36โฐ). Converting it to Base64 means encoding that integer's binary representation as Base64 bytes. Character-by-character mapping would be arbitrary and non-standard.
In Base36, leading zeros change the implied magnitude (e.g., "0A" and "A" represent the same integer 10, but "0A" as a string includes a positional zero that this converter preserves as a leading null byte). In Base64, the padding character "=" is structural (not a leading zero) and indicates the final block had fewer than 3 bytes. The converter preserves leading zeros by tracking them and prepending corresponding 0x00 bytes before Base64 encoding.
The converter accepts inputs up to 100 KB of text. JavaScript's native BigInt handles arbitrary-precision integers, so mathematical overflow is not a concern. The practical limit is browser memory and processing time. Inputs beyond approximately 50,000 characters may take a few seconds to convert due to the O(nยฒ) nature of BigInt string parsing in some engines.
No. The converter outputs standard Base64 per RFC 4648 Section 4, which uses "+" and "/" characters. These are not URL-safe. If you need Base64url (RFC 4648 Section 5), manually replace "+" with "-" and "/" with "_", and optionally strip "=" padding from the output.
Yes, the conversion is lossless and fully reversible. Converting Base36 โ†’ Base64 โ†’ Base36 will return the original string (uppercased, since Base36 is case-insensitive). The intermediate BigInt representation preserves the exact numeric value. One caveat: leading zeros in the original Base36 input are preserved through null-byte tracking, so "00AB" will round-trip correctly.
Base64 padding ensures the output length is always a multiple of 4 characters. A short Base36 string like "1" equals the integer 1, which is a single byte (0x01). One byte encoded in Base64 produces 2 data characters plus 2 padding "=" characters: "AQ==". This is correct per the RFC specification.