User Rating 0.0
Total Usage 0 times
Input (Base46) 0 chars
Output (Base64) 0 chars
Is this tool helpful?

Your feedback helps us improve.

About

Base46 encoding uses a reduced 46-character alphabet (0 - 9, A - Z, a - j) to represent arbitrary binary data as printable text. It produces longer output than Base64 due to the smaller radix but avoids characters like +, /, and = that cause issues in URLs, filenames, and certain legacy systems. Misidentifying which encoding a payload uses will corrupt data silently. A single wrong character in the charset mapping destroys the entire decoded output with no partial recovery. This tool validates input against the exact charset before conversion and reports precise error positions.

Base64 uses 64 characters and is standardized in RFC 4648. Base46 is a niche encoding found in specific embedded systems, QR code optimizations, and proprietary protocols where the character set must be restricted. This converter handles both directions with full UTF-8 support. Note: this tool assumes the most common Base46 alphabet variant. If your system uses a custom alphabet, results will differ.

base46 base64 encoding converter base46 encoder base46 decoder data encoding binary to text

Formulas

Base46 encoding treats the input byte array as a big-endian unsigned integer and performs repeated division by 46. Each remainder maps to a character in the Base46 alphabet.

Encoding: input N = len1i=0 bytei 256len1i

Then repeatedly: r = N mod 46, N = N r46

Output character: c = alphabet[r]

Decoding reverses the process:

N = len1i=0 value(ci) 46len1i

Where alphabet = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghij (indices 0 - 45). The expansion ratio is log(256)log(46) 1.447, meaning every input byte produces approximately 1.45 Base46 characters. For Base64, the ratio is 43 1.333 with padding.

Reference Data

EncodingAlphabet SizeCharacters UsedBits per CharExpansion RatioPaddingURL SafeCommon Use
Base16 (Hex)160 - 9, A - F4.002.00×NoneYesHashes, MAC addresses
Base3232A - Z, 2 - 75.001.60×=YesTOTP tokens, Crockford IDs
Base36360 - 9, A - Z5.171.55×NoneYesShort URLs, case-insensitive IDs
Base45450 - 9, A - Z, special5.491.46×NonePartialEU COVID certificates (QR)
Base46460 - 9, A - Z, a - j5.521.45×NoneYesEmbedded systems, proprietary protocols
Base5858Alphanumeric minus 0OIl5.861.37×NoneYesBitcoin addresses, IPFS
Base62620 - 9, A - Z, a - z5.951.34×NoneYesURL shorteners, tokens
Base6464A - Z, a - z, 0 - 9, +/6.001.33×=NoEmail (MIME), data URIs
Base64url64Same but -_ instead of +/6.001.33×OptionalYesJWT, URL parameters
Base85 (Ascii85)85ASCII 33 - 1176.411.25×NoneNoPDF, PostScript
Base9191Printable ASCII minus -'\6.511.23×NonePartialCompact binary-to-text
Base128128Full 7-bit ASCII7.001.14×NoneNoExperimental, protobuf varint

Frequently Asked Questions

Base46 has a smaller alphabet (46 vs 64 characters), so each character carries fewer bits of information: log2(46) 5.52 bits vs log2(64) = 6 bits. More characters are required to represent the same data. The expansion ratio for Base46 is approximately 1.45× vs 1.33× for Base64.
This implementation uses the standard Base46 alphabet: digits 0 - 9 (indices 0 - 9), uppercase A - Z (indices 10 - 35), and lowercase a - j (indices 36 - 45). Any character outside this set will trigger a validation error during decoding.
Yes. The encoder first converts the input string to its UTF-8 byte representation using the TextEncoder API. Multi-byte characters (e.g., emoji, CJK) are properly handled. The resulting byte array is then treated as a big-endian integer for Base46 encoding. The decoder reverses the process, reconstructing the byte array and decoding it back via TextDecoder.
Leading zero bytes are preserved using a prefix counting mechanism. Each leading zero byte in the input maps to the first character of the alphabet (0). During decoding, these prefix characters are converted back to zero bytes before the big-integer reconstruction. Without this step, data beginning with null bytes would lose information.
No. Unlike Base64 (RFC 4648) or Base32 (RFC 4648), Base46 has no formal standard. It exists as a convention in specific embedded systems and proprietary protocols. The alphabet order may vary between implementations. Always verify the exact charset mapping when interoperating with external systems.
The tool validates input against the Base46 charset before attempting conversion. Base64 uses characters k - z, +, /, and =, which are outside the Base46 alphabet. The tool will report the exact invalid characters and their positions, preventing silent data corruption.