Number to Letter

Number to Letter › Number to letter substitution cipher

Number to letter substitution cipher

Result

Key alphabet:

Key table: number → letterZEBRAS
Share of each letter in your messageShare in typical English

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.

  1. Take the keyword

    Repeated letters are dropped from the keyword.

    ZEBRAS
  2. Build the key alphabet

    The remaining letters follow in A–Z order.

    ZEBRASCDFGHIJKLMNOPQTUVWXY
  3. Number the key

    Position 1 is the first key letter.

    Z = 1, E = 2, B = 3
  4. 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

K = unique(keyword + "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
encode: c = position of p in K (1–26)
decode: p = K[c − 1]

Where

K
26-letter key alphabet
p
plain letter
c
cipher number 1–26

Worked example

Keyword ZEBRAS → K = ZEBRASCDFGHIJKLMNOPQTUVWXYM is the 16th letter of K → 16E → 2, T → 21MEET → 16 2 2 21

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.

Z1
E2
B3
R4
A5
S6
C7
D8
F9
G10
H11
I12
J13
K14
L15
M16
N17
O18
P19
Q20
T21
U22
V23
W24
X25
Y26

Same word, 4 keywords

KeywordKey alphabetHELLO encodes to
(none, A1Z26)NOEAZBCDFGHIJKLMPQRSTUVWXY11 3 15 15 2
ZEBRASZEBRASCDFGHIJKLMNOPQTUVWXY11 2 15 15 18
SECRETSECRTABDFGHIJKLMNOPQUVWXYZ11 2 15 15 18
PUZZLEPUZLEABCDFGHIJKMNOQRSTVWXY12 5 4 4 18

How the keyword key works

  1. Write the keyword without repeated letters. ZEBRAS stays ZEBRAS; BALLOON becomes BALON.
  2. Add the rest of the alphabet in order, skipping letters already used: ZEBRAS + CDFGHIJKLMNOPQTUVWXY.
  3. Number the key alphabet from 1 to 26. Z = 1, E = 2, B = 3, R = 4, A = 5, S = 6, C = 7.
  4. 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

A1Z26Keyed substitution
KeyNone (A = 1 always)Keyword or random alphabet
Possible keys126! ≈ 4 × 1026
Break byReading the chartLetter frequency and common words
UseKids' puzzles, geocachesCryptograms, 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²⁶.