Base46 to Base64 Converter
Convert between Base46 and Base64 encoding formats instantly. Encode, decode, validate, and download results with full UTF-8 support.
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.
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 = len−1∑i=0 bytei ⋅ 256len−1−i
Then repeatedly: r = N mod 46, N = N − r46
Output character: c = alphabet[r]
Decoding reverses the process:
N = len−1∑i=0 value(ci) ⋅ 46len−1−i
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
| Encoding | Alphabet Size | Characters Used | Bits per Char | Expansion Ratio | Padding | URL Safe | Common Use |
|---|---|---|---|---|---|---|---|
| Base16 (Hex) | 16 | 0 - 9, A - F | 4.00 | 2.00× | None | Yes | Hashes, MAC addresses |
| Base32 | 32 | A - Z, 2 - 7 | 5.00 | 1.60× | = | Yes | TOTP tokens, Crockford IDs |
| Base36 | 36 | 0 - 9, A - Z | 5.17 | 1.55× | None | Yes | Short URLs, case-insensitive IDs |
| Base45 | 45 | 0 - 9, A - Z, special | 5.49 | 1.46× | None | Partial | EU COVID certificates (QR) |
| Base46 | 46 | 0 - 9, A - Z, a - j | 5.52 | 1.45× | None | Yes | Embedded systems, proprietary protocols |
| Base58 | 58 | Alphanumeric minus 0OIl | 5.86 | 1.37× | None | Yes | Bitcoin addresses, IPFS |
| Base62 | 62 | 0 - 9, A - Z, a - z | 5.95 | 1.34× | None | Yes | URL shorteners, tokens |
| Base64 | 64 | A - Z, a - z, 0 - 9, +/ | 6.00 | 1.33× | = | No | Email (MIME), data URIs |
| Base64url | 64 | Same but -_ instead of +/ | 6.00 | 1.33× | Optional | Yes | JWT, URL parameters |
| Base85 (Ascii85) | 85 | ASCII 33 - 117 | 6.41 | 1.25× | None | No | PDF, PostScript |
| Base91 | 91 | Printable ASCII minus -'\ | 6.51 | 1.23× | None | Partial | Compact binary-to-text |
| Base128 | 128 | Full 7-bit ASCII | 7.00 | 1.14× | None | No | Experimental, protobuf varint |