Base26 to Base64 Converter
Convert Base26 (alphabetic A-Z) values to Base64 encoding and back. Supports zero-indexed and bijective conventions with arbitrary precision.
About
Base26 encoding maps alphabetic characters (A - Z) to numerical values in radix 26. Two conventions exist: zero-indexed (A = 0) used in combinatorics and hashing, and bijective (A = 1) used in spreadsheet column labels. Confusing these conventions produces off-by-one errors that cascade through downstream systems. This tool converts between Base26 strings and standard Base64 (RFC 4648) by computing the exact decimal intermediate via arbitrary-precision arithmetic. It handles strings of up to 10,000 characters without overflow.
Base64 encodes binary data into 64 printable ASCII characters, commonly used in data URIs, email attachments (MIME), and API token encoding. The conversion path here is Base26 → decimal integer → raw byte array → Base64. Reversing the process requires strict charset validation on both ends. Note: this tool treats Base26 as a pure positional numeral system. It does not perform text-to-Base64 ASCII encoding. If you need to encode arbitrary UTF-8 text, use a dedicated Base64 text encoder instead.
Formulas
The conversion pipeline operates in three stages. First, the Base26 alphabetic string is decoded into a decimal integer. Then that integer is serialized to a byte array (big-endian). Finally the byte array is encoded into Base64 per RFC 4648.
Stage 1 - Base26 (zero-indexed) to decimal:
D = n−1∑i=0 ci ⋅ 26n−1−iwhere ci is the zero-indexed value of character i (A = 0, Z = 25) and n is the string length.
For bijective Base26 (A = 1):
D = n−1∑i=0 ci ⋅ 26n−1−iwhere ci ranges from 1 (A) to 26 (Z).
Stage 2 - Decimal to byte array:
Extract bytes via repeated division: byte = D mod 256, then D = D256 (integer division). Collect bytes in reverse (big-endian).
Stage 3 - Bytes to Base64 (RFC 4648):
Group bytes into 3-byte blocks (24 bits). Split each block into four 6-bit indices. Map each index to the Base64 alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/. Pad with = if the final block has fewer than 3 bytes.
Where D = decimal intermediate value, ci = character value at position i, n = input string length.
Reference Data
| Base26 Char | Zero-Indexed Value | Bijective Value | Binary (8-bit) | Hex |
|---|---|---|---|---|
| A | 0 | 1 | 00000000 | 0x00 |
| B | 1 | 2 | 00000001 | 0x01 |
| C | 2 | 3 | 00000010 | 0x02 |
| D | 3 | 4 | 00000011 | 0x03 |
| E | 4 | 5 | 00000100 | 0x04 |
| F | 5 | 6 | 00000101 | 0x05 |
| G | 6 | 7 | 00000110 | 0x06 |
| H | 7 | 8 | 00000111 | 0x07 |
| I | 8 | 9 | 00001000 | 0x08 |
| J | 9 | 10 | 00001001 | 0x09 |
| K | 10 | 11 | 00001010 | 0x0A |
| L | 11 | 12 | 00001011 | 0x0B |
| M | 12 | 13 | 00001100 | 0x0C |
| N | 13 | 14 | 00001101 | 0x0D |
| O | 14 | 15 | 00001110 | 0x0E |
| P | 15 | 16 | 00001111 | 0x0F |
| Q | 16 | 17 | 00010000 | 0x10 |
| R | 17 | 18 | 00010001 | 0x11 |
| S | 18 | 19 | 00010010 | 0x12 |
| T | 19 | 20 | 00010011 | 0x13 |
| U | 20 | 21 | 00010100 | 0x14 |
| V | 21 | 22 | 00010101 | 0x15 |
| W | 22 | 23 | 00010110 | 0x16 |
| X | 23 | 24 | 00010111 | 0x17 |
| Y | 24 | 25 | 00011000 | 0x18 |
| Z | 25 | 26 | 00011001 | 0x19 |
| AA (zero-idx) | 26 | 27 | 00011010 | 0x1A |
| AZ (zero-idx) | 51 | 52 | 00110011 | 0x33 |
| BA (zero-idx) | 52 | 53 | 00110100 | 0x34 |
| ZZ (zero-idx) | 701 | 702 | 0000001010111101 | 0x02BD |