Advertisement
Advertisement
DEVELOPER

Letters to Numbers Converter — A1Z26 in both directions

Turn letters into their alphabet positions and numbers back into letters, with a choice of separator, a custom starting index and a reversed alphabet option.

Numbers to letters needs a separator it can recognise, because 1 2 and 12 are different messages written the same way without one.
Letters A to Z are converted. Digits, punctuation and spaces are handled according to the setting below.
1 gives the standard A1Z26 scheme. 0 gives the zero-based indexing used in programming.
Numbers
 
 
0
Letters converted
0
Other characters
0
Sum of letter values
0
Average letter value
Tip: the separator is not decoration. Without one, 1 2 and 12 are written identically, so the no-separator option pads every value to two digits and can only be decoded that way.
Advertisement

The letters to numbers converter above maps each letter to its position in the alphabet and back again. A is 1, B is 2 and Z is 26 by default, which is the scheme usually written as A1Z26, and the tool also handles zero-based indexing, a reversed alphabet, and four separator styles.

Arb Digital builds free tools that get the boring details right, and in this case the boring detail is the separator. Ordinal encoding is trivially simple in one direction and genuinely ambiguous in the other, because the numbers run from one to two digits with no marker between them. That single problem is responsible for almost every failed decode people run into with this scheme, and the tool handles it explicitly rather than hoping for the best.

What This Letters to Numbers Converter Does

In the forward direction it walks the input, and for every letter A to Z it emits the letter's ordinal position adjusted by the starting index you choose. Case is ignored, because upper and lower case letters occupy the same alphabet position. Everything that is not a letter either passes through unchanged or is removed, depending on the setting.

In the reverse direction it splits the input on the chosen separator, converts each numeric token back to a letter, and passes anything that is not a number through unchanged. Tokens outside the valid range produce a written message naming the offending value rather than a blank or a question mark, so a mistyped number is visible instead of silently swallowed.

The reversed-alphabet option maps A to 26 and Z to 1. That is the ordinal form of the Atbash substitution, an alphabet reversal that predates most named ciphers, and it is included because it costs nothing and shows clearly that ordinal encoding and substitution ciphers are the same operation viewed from different angles.

The custom starting index matters more than it looks. Setting A to 0 gives the indexing every programming language actually uses, which is what you want when the numbers are going to become array offsets or feed into modular arithmetic. Setting A to 1 gives the puzzle convention. Mixing the two is a classic off-by-one, and the tool makes the choice explicit so it cannot happen by accident.

How to Use It

  1. Set the direction. Letters to numbers reads your input as text; numbers to letters reads it as a list of values, and the two interpretations of the same box are completely different.
  2. Choose a separator you can live with. Space and hyphen are the usual choices. The no-separator option pads every value to two digits, which is the only way an unseparated stream can be decoded unambiguously.
  3. Set the starting index before you convert. Changing it afterwards shifts every value, which looks like a decoding failure but is really an indexing mismatch.
  4. Decide what happens to spaces. Keeping them preserves word boundaries, which makes a decoded message readable. Dropping them produces a compact stream that is much harder to read back.
  5. Check the round trip. Convert, copy the result, reverse the direction, paste it back and confirm you get your original text. If you do not, the separator or the starting index has changed between the two passes.

The Formula: How the Mapping Works

For a letter with Unicode code point c, the forward mapping is value = c − 65 + start for an upper-case letter, since 65 is the code point of A. RFC 20, ASCII Format for Network Interchange, is where those code points are laid out: it fixes A at decimal 65 and a at 97, which is why lower-case letters need the same subtraction with 97 instead, and why the difference between the two cases is exactly 32.

The reversed alphabet is value = 25 − (c − 65) + start. Decoding is the same arithmetic rearranged, with the result checked against the valid range before a character is emitted.

Work the default. "HELLO WORLD" with A equal to 1, a space separator and other characters kept. H is the eighth letter, E the fifth, L the twelfth twice and O the fifteenth, so the first word becomes 8 5 12 12 15. W is 23, O is 15, R is 18, L is 12 and D is 4, giving 23 15 18 12 4. The sum of all ten values is 124 and the average is 12.4. Reversing the direction on that output returns "HELLO WORLD" exactly, which is the round trip working.

Advertisement

The Ambiguity Problem, Properly Explained

Write "AB" without a separator and you get 12. Write "L" without a separator and you also get 12. Nothing in the output distinguishes them, and no decoder can, which means an unseparated A1Z26 stream is not a code at all in the reversible sense. It is a lossy compression of the message into digits.

There are exactly three honest fixes. Use a separator, which is what almost everyone does. Pad every value to a fixed width of two digits, so 1 becomes 01 and the stream can be read two characters at a time, which is what this tool does when you select no separator. Or accept the ambiguity and search all valid readings, which is a real technique in puzzle solving and produces multiple candidate plaintexts rather than one answer.

The padding option is worth understanding because it changes what the output means. With padding, "HELLO" becomes 0805121215, a fixed-length stream of exactly two digits per letter. Without padding it becomes 85121215, which could be read several ways. The two look similar and behave completely differently, and this is the single most common reason a decode comes back as gibberish.

How This Differs From the Neighbouring Text Tools

Ordinal encoding is often confused with three other things this site also has tools for, so the boundaries in one sentence each. This page maps a letter to its position in the alphabet, a number from 1 to 26. The text to binary converter encodes characters as UTF-8 bytes and prints them in binary, which is an entirely different number for the same letter: H is 8 here and 01001000 there. The Caesar cipher translator shifts letters to other letters and never leaves the alphabet. The number base converter changes the radix a number is written in without touching what the number means.

There is a real relationship underneath, though. A Caesar shift is exactly what you get by converting to ordinals, adding a constant modulo 26, and converting back, which is why the ROT13 encoder and decoder and this page are two views of the same arithmetic. If you want to see the intermediate values a shift cipher works with, convert here first and the shift becomes ordinary addition.

Where A1Z26 Actually Turns Up

Puzzle hunts and escape rooms are the obvious home, where a string of numbers between 1 and 26 is a near-universal signal that ordinal decoding is the intended step. Geocaching puzzle caches use it heavily, as do alternate reality games, and it is common enough that experienced solvers spot the range before they spot anything else.

It appears in teaching too. Ordinal encoding is usually the first step in explaining how a computer can do arithmetic on text at all, because it makes the leap from letters to numbers concrete before code points and character encodings arrive. Once ordinals are comfortable, modular arithmetic on them explains every classical substitution cipher in one move.

It is also the basis of simple gematria-style letter sums, where a word's letters are added to a total. The tool reports that sum and the average because they are cheap to compute and are what people usually want next. They are a curiosity rather than a measurement, and the sum collides constantly: many unrelated words share a total, so a matching sum means nothing on its own.

Beyond the Twenty-Six Letters

A1Z26 covers the twenty-six letters of the basic Latin alphabet and nothing else. Accented letters, letters from other scripts, digits and emoji have no ordinal position in that alphabet, so the tool passes them through or removes them rather than inventing a value.

That is the honest behaviour, but it does hide a subtlety. An accented letter may be a single precomposed character or a base letter followed by a combining mark, and in the second case the base letter is a plain A to Z and does get converted while the mark passes through. The Unicode Character Code Charts show how the two forms are encoded differently despite rendering identically. If your input might contain accented text, normalise it before converting or check the letter count against what you expected, because a silent mismatch here is easy to miss.

Need a website that loads fast and actually works?

Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.

Browse All Free Tools Talk to Arb Digital

Common Mistakes to Avoid

  • Encoding without a separator and expecting a clean decode — 12 could be L or A followed by B, and only fixed two-digit padding removes the ambiguity.
  • Changing the starting index between encoding and decoding — every letter comes back shifted by one, which looks like a broken tool rather than an off-by-one.
  • Dropping spaces and then trying to read the result — word boundaries are the main thing that makes a decoded message legible.
  • Assuming this is a cipher — the mapping is public and fixed, so it conceals nothing from anyone who recognises the number range.
  • Feeding in accented or non-Latin text — those characters have no alphabet position and pass through untouched, which can quietly change your letter count.

Related Free Tools From Arb Digital

For the same arithmetic applied as a shift, use the Caesar cipher translator or the ROT13 encoder and decoder. The text to binary converter and binary to text converter work at the byte level instead, the ASCII table lists the code points this page's arithmetic depends on, and the number base converter rewrites the resulting values in another radix. Try the leet speak translator for lookalike substitution, the Morse code translator for a standardised alternative, and the character counter to check lengths. Browse the rest in the free online tools hub.

Frequently Asked Questions

What is A1Z26?

It is the convention of replacing each letter with its position in the alphabet, so A is 1, B is 2 and Z is 26. It is not a cipher in any meaningful sense, because the mapping is fixed and public, but it is a common puzzle step and a useful teaching device.

Why do I need a separator between the numbers?

Because the values run from one to two digits. Written without a separator, 12 could be the letter L or the letters A and B, and nothing in the stream distinguishes them. A separator, or padding every value to two digits, removes the ambiguity.

What does setting A to 0 do?

It shifts every value down by one, giving the zero-based indexing that programming languages use for arrays. It is the right setting when the numbers will become offsets or feed modular arithmetic, and the wrong one for puzzle conventions, which almost always start at 1.

How is this different from converting text to binary?

Completely different numbers for the same letter. This page gives the alphabet position, so H is 8. A binary converter encodes the character as UTF-8 bytes, so H becomes 01001000, which is 72 in decimal. One is a position in the alphabet, the other is a character code.

What happens to punctuation and spaces?

They pass through unchanged by default, which keeps word boundaries visible and makes a decoded message readable. You can remove them instead, which produces a compact stream that is considerably harder to read back.

What is the reversed alphabet option for?

It maps A to 26 and Z to 1, which is the ordinal form of the Atbash alphabet reversal. It is included because it is a common puzzle variant and because it shows that ordinal encoding and simple substitution are the same operation seen from different angles.

Does the sum of letter values mean anything?

Not on its own. Many unrelated words share the same total, so a matching sum is weak evidence of nothing in particular. It is reported because it is cheap to compute and is what people commonly want next, not because it identifies anything.

Why are accented letters left alone?

Because A1Z26 is defined over the twenty-six basic Latin letters and an accented character has no position in that alphabet. Inventing one would be a fabrication, so the tool passes it through. Normalise your text first if that behaviour would confuse your letter count.

Advertisement
Advertisement

Take it further