✖

Number cipher (A1Z26): letters to numbers

The number cipher replaces each letter with its position in the alphabet: A is 1, B is 2, C is 3 and so on up to Z, which is 26. The word “ahoj” (Czech for “hello”) is written as 1 8 15 10. In English it is called A1Z26 after its first and last letters, and it is also known as the number alphabet or simply the letters-to-numbers cipher.

Strictly speaking it is a code, not a cipher. It has no secret key, that is, nothing known only to the sender and the receiver: anyone who knows the alphabet knows the chart. It merely converts the message into another form, just like Morse code. The difference between a code and a cipher is explained in the article Cryptography. At camp, though, the number cipher is an absolute classic, because even small children who barely know the alphabet can manage it.

Converter from text to numbers and back

Type a message and the converter turns it into numbers straight away. It puts a space between letters and a slash between words. It drops accents (č is written as c) and leaves out characters that are not in the alphabet, such as digits and punctuation.

The default text, “Sejdeme se u ohně v osm”, is Czech for “let’s meet by the fire at eight”.

It also works the other way: paste in numbers and the converter builds text from them. You can separate the numbers with a space, comma, full stop or hyphen, and words with a slash or a new line. A number that means no letter (0 or anything above 26) is printed as #.

Number alphabet chart

A B C D E F G
1 2 3 4 5 6 7
H I J K L M N
8 9 10 11 12 13 14
O P Q R S T U
15 16 17 18 19 20 21
V W X Y Z
22 23 24 25 26

You do not need to learn the whole chart. A few landmarks, one every five letters, are enough: E = 5, J = 10, O = 15, T = 20 and Y = 25. Need R? Take T = 20 and go back two letters (S, R): R is 18. Similarly K comes right after J = 10, so it is 11.

Why a separator is needed

Try reading the message 121. It could be 1, 2, 1, that is ABA, or 12 and 1, that is LA, or 1 and 21, that is AU. Without spaces the notation is ambiguous, because numbers from 10 up have two digits and each of them could stand for a separate letter.

The notation 121 three times side by side, split as 1, 2, 1 into ABA, as 12, 1 into LA and as 1, 21 into AU The notation 121 three times side by side, split as 1, 2, 1 into ABA, as 12, 1 into LA and as 1, 21 into AU

With a longer message the number of possibilities grows quickly. That is why a space or hyphen belongs between letters and a slash between words: 1-2-1 is only ABA and 12-1 only LA. Morse code has the same problem: .-. can be R, or A and E; see how Morse code is written.

Variations of the number cipher for camp

The plain number alphabet is a bit too obvious for a game, so players modify it in various ways:

  • Reversed numbers. A = 26, B = 25 up to Z = 1. The letter in position n gets the number 27 − n, so this is really Atbash, the cipher with a reversed alphabet, written in numbers.
  • Shift. You count from a different number: with a shift of three, A = 4, B = 5 and W = 26. Numbers above 26 wrap round to the start, so X = 1, Y = 2 and Z = 3. The result is the Caesar cipher written in numbers.
  • Sum of letters. Instead of a message you give only the sum of the numbers of its letters and the players guess the word. “Pes” (Czech for “dog”) gives 16 + 5 + 19 = 40 and “kočka” (Czech for “cat”) 11 + 15 + 3 + 11 + 1 = 41. But many other words give the same sum, which is why a hint is added, such as “an animal, five letters”.

The Czech alphabet also has CH and letters with accents. If you want to number those too, agree on how before the game. We stick to the 26 letters of the international alphabet; CH is written as C and H, that is 3 8, and digits in a message are better spelled out in words.

How to break the number cipher

When someone sees a row of numbers and none of them is greater than 26, they immediately suspect what it is and can read the message with the chart. With reversed or shifted numbers it takes a little longer, but it is enough to try the reversed order and a few shifts. If the numbers were assigned to letters completely at random, though, frequency analysis helps: the most common number in a longer message probably belongs to the most common letter of the language.