A number to letter substitution cipher gives every letter a number from 1 to 26, but in a secret order set by a key. With the keyword ZEBRAS, the key alphabet is ZEBRASCDFGHIJKLMNOPQTUVWXY, so 1 = Z, 2 = E, 3 = B, and the plain letter A becomes 5. The receiver needs the same keyword to turn the numbers back into letters.
Type a keyword or press Random key, then encode or decode. The key table lists all 26 number-to-letter pairs and marks the letters in use. The frequency chart compares the letters in your message with normal English, which is how codebreakers attack this cipher.
How number to letter substitution cipher calculator works?
To encode with a number substitution cipher, the number to letter substitution cipher calculator builds a key alphabet from a keyword. The calculator writes the keyword letters once, adds the unused letters A–Z in order, numbers that key alphabet 1–26, and replaces each letter with its key number. With the keyword ZEBRAS, MEET encodes to 16 2 2 21.
- Take the keyword
Repeated letters are dropped from the keyword.
ZEBRAS - Build the key alphabet
The remaining letters follow in A–Z order.
ZEBRASCDFGHIJKLMNOPQTUVWXY - Number the key
Position 1 is the first key letter.
Z = 1, E = 2, B = 3 - Substitute
Each plain letter becomes its key number. Decode reverses the lookup.
MEET → 16 2 2 21
The frequency bars compare letter shares in your message with typical English. E (12.7%) and T (9.1%) show up most, the first clue cryptogram solvers use.
Number to letter substitution cipher formula
The number to letter substitution cipher formula is a key lookup. c = K⁻¹(p) to encode and p = K(c) to decode, where K is the numbered key alphabet.
Formula
Where
- K
- 26-letter key alphabet
- p
- plain letter
- c
- cipher number 1–26
Worked example
A random key has 26! ≈ 4.03 × 10²⁶ possible orders. Letter frequency still breaks a substitution cipher on messages longer than about 50 letters.
Number to letter substitution cipher conversion chart
The number to letter substitution cipher conversion chart shows the ZEBRAS key with every letter and its number. Z = 1, E = 2, B = 3, R = 4, A = 5, S = 6, and the other 20 letters follow in A–Z order.
Same word, 4 keywords
| Keyword | Key alphabet | HELLO encodes to |
|---|---|---|
| (none, A1Z26) | NOEAZBCDFGHIJKLMPQRSTUVWXY | 11 3 15 15 2 |
| ZEBRAS | ZEBRASCDFGHIJKLMNOPQTUVWXY | 11 2 15 15 18 |
| SECRET | SECRTABDFGHIJKLMNOPQUVWXYZ | 11 2 15 15 18 |
| PUZZLE | PUZLEABCDFGHIJKMNOQRSTVWXY | 12 5 4 4 18 |
How the keyword key works
- Write the keyword without repeated letters. ZEBRAS stays ZEBRAS; BALLOON becomes BALON.
- Add the rest of the alphabet in order, skipping letters already used: ZEBRAS + CDFGHIJKLMNOPQTUVWXY.
- Number the key alphabet from 1 to 26. Z = 1, E = 2, B = 3, R = 4, A = 5, S = 6, C = 7.
- Encode each plain letter as its number in the key alphabet. MEET = 16 2 2 21.
A random key is stronger than a keyword key, because keyword keys leave the end of the alphabet (X, Y, Z) in order.
How many keys does a substitution cipher have?
A full substitution cipher has 26! keys, about 4 × 1026 (403,291,461,126,605,635,584,000,000). That is far too many to try one by one, but the cipher still falls to frequency analysis. E makes up about 12.7% of English letters and T about 9.1%, so the most common number in a long message usually stands for E. Short messages under 50 letters are much harder to break this way.
Substitution cipher vs A1Z26
| A1Z26 | Keyed substitution | |
|---|---|---|
| Key | None (A = 1 always) | Keyword or random alphabet |
| Possible keys | 1 | 26! ≈ 4 × 1026 |
| Break by | Reading the chart | Letter frequency and common words |
| Use | Kids' puzzles, geocaches | Cryptograms, puzzle hunts |
Plain A1Z26 is on the number to letter cipher page.
Frequently asked questions
What is a number substitution cipher?
A number substitution cipher replaces each letter with a number. With a key, the numbers follow a secret alphabet instead of A = 1 to Z = 26.
How do you crack a substitution cipher?
Count how often each number appears. The most common usually stands for E, then T, A, and O. Fill in short words such as THE and AND next.
What is a keyword cipher?
A keyword cipher builds the key alphabet by writing a keyword first and then the unused letters in order.
Is a random key better than a keyword?
Yes. A random key has no pattern for a codebreaker to guess.
How do you make a number substitution cipher key?
Write a keyword without repeated letters, add the unused letters A–Z, and number the result 1–26. SECRET gives SECRTABDFGHIJKLMNOPQUVWXYZ.
What is HELLO with the keyword ZEBRAS?
HELLO is 11 2 15 15 18 with the keyword ZEBRAS.
How many keys does a number substitution cipher have?
A number substitution cipher has 26! keys, about 4.03 × 10²⁶.
More number and letter tools