Base64 to Base46 Converter
Convert between Base64 and Base46 encoding formats instantly. Real transcoding through raw bytes with custom 46-character alphabet support.
Base46 Alphabet Reference
About
Base64 encoding uses 64 characters to represent binary data in ASCII. Base46 is a compact encoding that uses only 46 characters: digits 0 - 9, uppercase A - Z, and lowercase a - j. A smaller alphabet means longer output strings. The expansion ratio is approximately log(64)log(46) ≈ 1.085, so Base46 output is roughly 8.5% longer than Base64 for the same payload. This tool performs real transcoding: it decodes the source encoding to raw bytes, then re-encodes using arbitrary-precision integer arithmetic against the target alphabet. No data is approximated or discarded.
Base46 is useful in systems that restrict the usable character set below 64 symbols, such as certain QR code alphanumeric modes, legacy database fields, or transport protocols that forbid +, /, and =. Incorrect manual transcoding risks silent data corruption. A single mismatched character in the alphabet mapping produces garbled output that passes no checksum. This tool validates input strictly against the expected alphabet before conversion and reports exact error positions.
Formulas
Transcoding between bases proceeds through an intermediate raw-byte representation. The source string is decoded to a byte array B, which is interpreted as a big-endian unsigned integer N.
The integer N is then converted to the target base b by repeated division:
Each digit dk maps to a character in the target alphabet. The output length L for n input bytes is:
Where: Bi = byte at index i, n = total byte count, b = target base (46 or 64), dk = digit at position k in target encoding, L = output string length. Leading zero bytes are preserved as leading zero-characters in the target alphabet to ensure round-trip fidelity.
Reference Data
| Encoding | Alphabet Size | Characters Used | Bits per Char | Efficiency vs Raw | Padding | Common Use |
|---|---|---|---|---|---|---|
| Binary (Raw) | 256 | 0x00 - 0xFF | 8.000 | 100% | None | File storage |
| Base85 (Ascii85) | 85 | ! - u | 6.409 | 80.1% | Context | PostScript, PDF |
| Base64 | 64 | A - Z, a - z, 0 - 9, +/ | 6.000 | 75.0% | = | Email, Data URIs |
| Base64url | 64 | A - Z, a - z, 0 - 9, -_ | 6.000 | 75.0% | Optional | JWT, URLs |
| Base58 | 58 | 1 - 9, A - H, J - N, P - Z, a - k, m - z | 5.858 | 73.2% | None | Bitcoin addresses |
| Base46 | 46 | 0 - 9, A - Z, a - j | 5.524 | 69.0% | None | Restricted charsets |
| Base36 | 36 | 0 - 9, A - Z | 5.170 | 64.6% | None | URL shorteners |
| Base32 | 32 | A - Z, 2 - 7 | 5.000 | 62.5% | = | TOTP, file names |
| Hexadecimal (Base16) | 16 | 0 - 9, A - F | 4.000 | 50.0% | None | Color codes, hashes |
| Octal (Base8) | 8 | 0 - 7 | 3.000 | 37.5% | None | Unix permissions |
| Binary (Base2) | 2 | 0, 1 | 1.000 | 12.5% | None | Low-level debug |
| Ascii85 (Z85) | 85 | Printable ASCII subset | 6.409 | 80.1% | None | ZeroMQ |
| Base91 | 91 | ASCII 33 - 126 excl. - | 6.507 | 81.3% | Context | Compact text encoding |