How to Use This Tool
Paste letters, numbers, or a mix. The direction is detected automatically unless you force it.
The missing zero
Ordinary base 26 would have 26 digits meaning 0 to 25, so a two-digit number could start with the digit for zero. Column letters have no such digit: the alphabet supplies 1 to 26 and nothing else.
That makes the system bijective base-26, and it has a neat property — every positive integer has exactly one representation, with no leading-zero ambiguity. A is 1, Z is 26, AA is 27, ZZ is 702, and AAA is 703.
Compare with true base 26: ZZ would be 25×26 + 25 = 675, and the two systems disagree by 27. The gap grows with length, so a conversion that happens to work for single letters fails silently on two.
Getting the conversion right
Letters to a number is straightforward, because each letter is simply its position:
n = 0
for each character c:
n = n * 26 + (position of c in the alphabet) // A = 1
Number to letters is where implementations break. The correction is subtracting one before each step:
while n > 0:
r = (n - 1) mod 26
prepend letter r // 0 = A
n = floor((n - 1) / 26)
Leave out those two subtractions and any exact multiple of 26 produces an empty digit: 26 comes out as an empty string or "A@", and 52 becomes "AZ" shifted wrong. It is the single most common bug in spreadsheet tooling, and it only appears at Z, AZ, BZ and so on — which is exactly the input nobody tests.
Where the last column is
Modern spreadsheet formats stop at XFD, which is column 16,384 — exactly 214. The row limit is 1,048,576, or 220. Both are powers of two because they are storage limits, and XFD is simply what 16,384 spells.
Older formats stopped at IV, column 256, which is why a lot of legacy code assumes two letters is enough. Anything reading spreadsheets should handle three.
0-based and 1-based
Spreadsheets number columns from 1, so A is 1. Most programming libraries index arrays from 0, so A is 0. Both are shown here because converting between them is a separate, equally common off-by-one.
The safest habit when writing code is to convert letters directly to whichever base your library uses, rather than converting to the spreadsheet number and adjusting afterwards — the adjustment is easy to apply twice.
