User Rating 0.0
Total Usage 0 times
0 chars
0 chars
Is this tool helpful?

Your feedback helps us improve.

About

Base64 encoding expands binary data by roughly 33% because it maps every 3 bytes to 4 ASCII characters from a 64-symbol alphabet. Base36 uses 36 symbols (0 - 9, a - z) and is case-insensitive, which makes it useful for compact URL slugs, short identifiers, and systems that forbid mixed-case or special characters. This tool treats the input as a raw byte stream, accumulates it into an arbitrary-precision integer, then performs radix conversion via repeated division by 36. The reverse path reconstructs the integer from the base36 string and extracts the original byte sequence. Note: the conversion is lossless only when round-tripped through this tool. Passing the base36 output to a system that strips leading zeros will corrupt the data. This tool approximates storage savings assuming uniform random bytes; structured data compresses differently.

base64 base36 encoding converter radix number-base data-encoding

Formulas

The conversion treats the Base64-decoded byte array as a big-endian unsigned integer, then re-encodes that integer in base 36.

Step 1 - Decode Base64 to bytes:

B = atob(input) [b0, b1, …, bn1]

Step 2 - Accumulate into integer N:

N = n1i=0 bi 256n1i

Step 3 - Convert N to base 36 via repeated division:

N = q 36 + r, where r {0, 1, …, 35}

Each remainder r maps to character: 0 - 9 0 - 9, 10 - 35 a - z. Digits are collected least-significant first, then reversed.

Bits per character: log2(36) 5.17, so base36 output is approximately 85.17 1.55× the byte count in length.

Where B = decoded byte array, n = byte count, bi = byte value at index i, N = accumulated big integer, q = quotient, r = remainder.

Reference Data

Base / EncodingAlphabetRadixBits per CharacterExpansion vs RawCase SensitiveCommon Use
Binary0 - 121.00800%NoLow-level data
Octal0 - 783.00267%NoUnix permissions
Decimal0 - 9103.32241%NoHuman-readable numbers
Hexadecimal0 - 9, a - f164.00200%NoMemory addresses, colors
Base32A - Z, 2 - 7325.00160%NoTOTP codes, Crockford IDs
Base360 - 9, a - z365.17155%NoShort URLs, compact IDs
Base580 - 9, A - Z, a - z (no 0OIl)585.86137%YesBitcoin addresses
Base620 - 9, A - Z, a - z625.95134%YesURL shorteners
Base64A - Z, a - z, 0 - 9, +/646.00133%YesEmail (MIME), Data URIs
Base64urlA - Z, a - z, 0 - 9, -_646.00133%YesJWT tokens, URL params
Base85 (Ascii85)33 - 117 ASCII856.41125%YesPDF, PostScript
Base9191 printable ASCII916.51123%YesCompact binary-to-text
Base128128 code points1287.00114%YesProtobuf varints

Frequently Asked Questions

The tool auto-detects URL-safe Base64 by scanning for - and _ characters. It replaces - with + and _ with /, then pads with = to a multiple of 4 characters before decoding. This means JWT tokens and URL-embedded Base64 strings convert without manual preprocessing.
Yes, provided you use this tool for both directions. The byte count is preserved by storing it as metadata (a length prefix in the base36 output header). Without this, leading zero bytes in the original data would be lost during BigInt conversion since BigInt(0x00FF) and BigInt(0xFF) are identical. The tool prepends the original byte length as a base36 number separated by a colon.
Base64 encodes 6 bits per character while Base36 encodes log2(36) ≈ 5.17 bits per character. For a given number of raw bytes, Base36 requires more characters. Specifically, the Base36 string is roughly 1.16× the length of the Base64 string. The tradeoff is that Base36 is case-insensitive and uses only alphanumeric characters.
The tool uses JavaScript's native BigInt for arbitrary-precision arithmetic, so there is no mathematical limit. Practical limits are browser memory and processing time. Inputs up to approximately 100 KB of Base64 convert in under 2 seconds on modern hardware. For inputs exceeding 50 KB, the tool displays a progress indicator and yields to the main thread to prevent freezing.
Base36 strings contain only 0 - 9 and a - z, making them safe for case-insensitive file systems (NTFS, HFS+), DNS labels, and URL paths without percent-encoding. However, the length prefix (colon separator) must be preserved for lossless round-tripping. If you only need a compact identifier and do not need to recover the original bytes, you can strip the prefix.
The tool first strips all whitespace and newlines. It then validates the remaining string against the Base64 alphabet regex /^[A-Za-z0-9+/\-_]*={0,2}$/. If invalid characters are found, a toast notification lists the offending characters and their positions. The native atob call is wrapped in a try-catch that catches DOMException for malformed padding.