Skip to content
ZeroServer.tools

Number to Excel Column Converter

Convert between Excel column numbers and column letters.

Column letter
A

Reference

NumberColumn
1A
26Z
27AA
52AZ
53BA
702ZZ
703AAA
16384XFD

How Excel column naming works

Excel uses a base-26 bijective numeration for column names: A=1 through Z=26, then AA=27, AB=28, … AZ=52, BA=53, and so on. It differs from standard base-26 because there is no zero — each digit is 1-based. The maximum column in Excel is XFD (column 16,384). This converter is useful when writing spreadsheet formulas or automating Excel with scripts. It reads a cell reference such as $AB$12 for its column, accepts numbers grouped as 16,384, and refuses ranges, sheet names, decimals and hex rather than guessing at them.

For base conversions between decimal, binary, hex, and octal see the Number Base Converter.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Working out which letter column a computed index corresponds to in a spreadsheet.
  • Converting a column letter from a bug report into an index for code.
  • Generating a cell reference programmatically for an export.
  • Checking the boundary behaviour around Z and AA while writing a converter.
  • Translating a column position from a library's zero-based index, after adding one to it.

How it works in practice

A worked example

A developer generating a full-width Excel template needs the letter of the sheet's very last column so a header formula can reference the entire first row.

Input
Mode           Number → Letter
Column number  16384
Output
Column letter  XFD

The converter peels off one letter per pass, last letter first, and takes one away before each division because the digits run from 1 to 26 rather than 0 to 25. For 16384 the first pass divides 16383 by 26, leaving remainder 3, which is D, and carrying 630; the second divides 629, leaving 5, which is F, and carrying 24; the third takes 23, which is X, and carries nothing. Reading the letters back gives 24 × 676 + 6 × 26 + 4, which is 16384, the last column on an Excel worksheet.

The edge case that catches people

Code usually holds a zero-based index, and that is where this goes wrong without any warning. SheetJS stores the last column of an Excel sheet as index 16383, and typing 16383 here returns XFC, a perfectly valid column one short of the edge. Add one to any index taken from SheetJS, pandas or a JavaScript array before converting, and subtract one from a number this page returns before handing it back to such code. Typing 0 is refused outright rather than mapped to A.

When not to use this tool

Inside a workbook you do not need it: =SUBSTITUTE(ADDRESS(1,16384,4),"1","") returns XFD and =COLUMN(XFD1) returns 16384, and both stay correct when the sheet changes. In code, call the library's own helper, such as openpyxl's get_column_letter and column_index_from_string or SheetJS's encode_col and decode_col, so the result matches that library's indexing. The page flags any result past XFD, so a column that no Excel worksheet has is never passed off as one.

Frequently Asked Questions

Why is this not just base 26?
Because there is no zero digit. Excel columns are *bijective* base 26: A is 1 and Z is 26, and the next value is AA, not BA — where ordinary base 26 would write 10 with a zero. That missing zero is why the conversion needs a subtraction on each step.
What is the last column?
XFD, which is column 16,384 — the limit since Excel 2007. Before that, the grid stopped at IV (256). Google Sheets historically allowed more columns but caps the total cell count instead.
Which columns catch people out?
The boundaries: 26 is Z, 27 is AA, 52 is AZ, 53 is BA, 702 is ZZ and 703 is AAA. A conversion that skips the per-step subtraction breaks on Z, AZ, ZZ and every other column whose name contains a Z, while one that subtracts only once goes wrong from AA onwards.
Where do I need the number rather than the letter?
Anywhere the API is index-based: Cells(row, col) in VBA, worksheet.cell(row, column) in openpyxl, and most spreadsheet libraries. Converting by hand past a few dozen columns is where the off-by-one errors start.
Are the letters case-sensitive?
No. Excel accepts a1 and normalises it to A1, and this converter reads either case. A cell reference works too: the $ markers and the row number are ignored, so $AB$12 gives 28, while a range such as A1:C3 or a sheet name is refused rather than guessed at.
Why does the arithmetic break down at column Z?
Because the system has no zero digit: after Z comes AA, not A0. It is bijective base 26, so the usual divide-and-remainder loop needs one subtracted at each step. Without it, every column whose name contains a Z comes out wrong, starting with 26, which becomes A@ rather than Z.

Common errors and gotchas

  • Treating it as base 26, which it is not — there is no zero digit, so AA follows Z rather than BA.
  • Mixing zero-based and one-based indexing, where A is 1 in the spreadsheet and often 0 in code.
  • Assuming two letters are always enough, when wide sheets reach three.
  • Confusing the column letter with a named range or a table reference.
  • Testing a converter only on A to Y and AA, which hides the bug that turns 26 into A@ instead of Z.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKit — Ship your Next.js startup in days.affiliate