Base64 to Base26 Converter
Convert Base64 encoded strings to Base26 (A-Z alphabet) representation and back. Supports bidirectional conversion with BigInt precision.
About
Base64 encoding represents binary data using 64 printable ASCII characters. Base26 uses only the 26 uppercase Latin letters (A - Z), where each letter maps to a value from 0 to 25. Converting between these systems requires interpreting the Base64 payload as a raw byte sequence, accumulating those bytes into an arbitrary-precision integer, then performing iterative division by 26 to extract letter positions. Precision loss is the core risk: naive implementations using IEEE 754 floats silently corrupt data beyond 253. This tool uses JavaScript's native BigInt to guarantee lossless conversion at any input length. Note: the conversion treats the decoded byte stream as a single unsigned integer. Padding bytes (=) in Base64 are handled by the standard atob decoder and do not appear in the output.
Formulas
The conversion pipeline follows three stages. First, decode the Base64 string into a sequence of raw bytes B0, B1, โฆ, Bnโ1 using the standard atob function.
This accumulates all bytes into one large unsigned integer N using base 256 positional notation. The tool uses native BigInt for this step to avoid floating-point truncation.
Repeated Euclidean division by 26 extracts remainders. Each remainder maps to a letter: A = 0, B = 1, โฆ, Z = 25. Collect remainders in reverse order to form the Base26 string.
Where: N = accumulated integer from byte stream, Bi = i-th byte value (0 - 255), n = total byte count, q = quotient, r = remainder. Output length is approximately n โ log(256)log(26) ≈ 1.7 โ n characters.
Reference Data
| Base26 Letter | Decimal Value | Binary (5-bit) | Base64 Chars (for reference) |
|---|---|---|---|
| A | 0 | 00000 | A (idx 0) |
| B | 1 | 00001 | B (idx 1) |
| C | 2 | 00010 | C (idx 2) |
| D | 3 | 00011 | D (idx 3) |
| E | 4 | 00100 | E (idx 4) |
| F | 5 | 00101 | F (idx 5) |
| G | 6 | 00110 | G (idx 6) |
| H | 7 | 00111 | H (idx 7) |
| I | 8 | 01000 | I (idx 8) |
| J | 9 | 01001 | J (idx 9) |
| K | 10 | 01010 | K (idx 10) |
| L | 11 | 01011 | L (idx 11) |
| M | 12 | 01100 | M (idx 12) |
| N | 13 | 01101 | N (idx 13) |
| O | 14 | 01110 | O (idx 14) |
| P | 15 | 01111 | P (idx 15) |
| Q | 16 | 10000 | Q (idx 16) |
| R | 17 | 10001 | R (idx 17) |
| S | 18 | 10010 | S (idx 18) |
| T | 19 | 10011 | T (idx 19) |
| U | 20 | 10100 | U (idx 20) |
| V | 21 | 10101 | V (idx 21) |
| W | 22 | 10110 | W (idx 22) |
| X | 23 | 10111 | X (idx 23) |
| Y | 24 | 11000 | Y (idx 24) |
| Z | 25 | 11001 | Z (idx 25) |
| Base64 Alphabet (for reference) | |||
| Indices 0 - 25 | A - Z | ||
| Indices 26 - 51 | a - z | ||
| Indices 52 - 61 | 0-9 | ||
| Index 62 | + | ||
| Index 63 | / | ||
| Padding | = | ||