Keyword Cipher Decoder

Decode keyword substitution ciphers with a known keyword, inspect the generated alphabet, and compare letter frequencies against standard English.

Keyword Cipher Decoder

Decode keyword substitution ciphers with known keywords

Characters: 0 | Letters: 0
Keyword: NoneScore: 0.00

Cipher Alphabet

ABCDEFGHIJKLMNOPQRSTUVWXYZ

Alphabet Mapping Steps

Step-by-step mapping from the cipher alphabet back to the standard alphabet (first 10 letters).

pos 1A → A
pos 2B → B
pos 3C → C
pos 4D → D
pos 5E → E
pos 6F → F
pos 7G → G
pos 8H → H
pos 9I → I
pos 10J → J

Letter Frequency Analysis

Frequency distribution of letters in the input text compared with standard English.

Input Text Frequencies

A
0.0%
B
0.0%
C
0.0%
D
0.0%
E
0.0%
F
0.0%
G
0.0%
H
0.0%
I
0.0%
J
0.0%

Expected English Frequencies

A
8.2%
B
1.3%
C
2.8%
D
4.3%
E
12.7%
F
2.2%
G
2.0%
H
6.1%
I
7.0%
J
0.1%

How does this keyword decoder work?

It rebuilds the substitution alphabet from the keyword you provide, reverses the mapping, and scores the resulting plaintext for readability.

Do I need the exact keyword?

Yes. This decoder page is designed for cases where you already know or strongly suspect the keyword.

Why does frequency analysis still help here?

Frequency charts help you confirm whether the decoded output resembles normal English and whether your keyword guess is plausible.

The Keyword Cipher Decoder is for the case where you already know the keyword, or have a short list of guesses. Type the keyword, paste the ciphertext, and the plaintext appears as you type. The decoder also shows the cipher alphabet the keyword produces, walks through the first letters of the mapping, gives the result a readability score, and compares the ciphertext's most common letters with ordinary English. If you do not know the keyword at all, use the substitution cipher solver instead; it cracks the alphabet directly and then reads the keyword back out of it.

How to use the keyword cipher decoder

  1. Enter the keyword. Upper or lower case, spaces and punctuation do not matter; the decoder keeps the letters and drops any repeats. Sample fills in one of a few example keywords if you just want to see how the tool behaves.
  2. Paste the ciphertext. The counter under the box shows how many characters and how many letters it contains. Spaces, digits and punctuation pass through unchanged, and lower-case letters stay lower case.
  3. Read the result. The decoded text updates as you type, with the cleaned-up keyword and a readability score beside it. Copy it with the button next to the result.
  4. Check the alphabet. The Cipher Alphabet panel shows the 26 letters the keyword produced, and Alphabet Mapping Steps shows how the first ten of them map back to A, B, C and so on.
  5. Look at the frequencies. The frequency panel lists the ten most common letters in your ciphertext next to their usual share in English, which helps when you are unsure whether the text is a keyword cipher at all.

How the decoder rebuilds the alphabet

A keyword cipher hides its key inside a word. The decoder turns that word back into a full cipher alphabet in three steps:

  1. Keep only the letters of the keyword and drop every letter that has already appeared. SECRET becomes S, E, C, R, T.
  2. Write the remaining letters of the alphabet after it, in order, skipping the ones already used.
  3. Line the result up under the ordinary alphabet.
Plain:   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher:  S E C R T A B D F G H I J K L M N O P Q U V W X Y Z

To encrypt, each plaintext letter is replaced by the letter under it, so M becomes J and E becomes T. To decode, the decoder reads the table the other way: it finds each ciphertext letter in the bottom row and writes down the letter above it. With the keyword SECRET, the ciphertext

JTTQ JT SQ QDT LIR JFII SQ KLLK

decodes to MEET ME AT THE OLD MILL AT NOON.

Notice how much of the bottom row is unchanged. After the keyword's letters, the alphabet runs on in order, and from U onwards every letter maps to itself. That is typical of keyword ciphers with short keywords, and it is one reason they are easy to break: a solver that recovers part of the alphabet can usually guess the keyword and the rest follows.

What happens with a wrong keyword

Because the decoder updates as you type, it is a quick way to test guesses. The results fall into three kinds, and each tells you something.

A keyword with the same letters gives the same alphabet. SECRETS and SECRET both reduce to S, E, C, R, T, so both decode the message correctly. If someone tells you the keyword was SECRETS and you remember SECRET, you are fine.

A nearly right keyword gives nearly right text. With SECURE the alphabet starts S, E, C, U, R and differs from the true one in only a few places. The result reads MUUT MU AT THU OLE MILL AT NOON: wrong in the letters that moved, right everywhere else. When the output looks like that, keep the keyword's opening letters and change the rest.

A wrong keyword gives nonsense. SECRETLY moves L and Y to the front of the alphabet and shifts everything after them, so the same ciphertext becomes OEEU OE AU UJE FND OKNN AU PFFP. CIPHER gives LTTR LT SR RIT NBF LJBB SR MNNM. Neither is close.

The readability score next to the result puts a number on this. It rewards common English words, common letter pairs such as TH and ER, and a letter mix close to normal English. When you are comparing a few candidate keywords, the one with the highest score is usually the right one. The number has no fixed scale, so compare scores for the same ciphertext rather than reading a single score on its own.

Reading the frequency panel

The frequency panel answers a different question: is this text really a keyword cipher?

A keyword cipher replaces each letter with exactly one other letter, so the ciphertext keeps the uneven letter counts of English. A few ciphertext letters will be very common and many will be rare, just shifted onto different letters. Even in the short example above, T and Q are the most common ciphertext letters, four times each, and they stand for E and T. If your ciphertext's top letters have percentages roughly like E, T, A and O in the expected column, a keyword or other simple substitution cipher is a good bet.

If the counts are almost flat, with no letter much more common than the others, the text was probably encrypted with several alphabets, as in the Vigenère cipher, and no single keyword alphabet will decode it. If the counts look like normal English but the text is still unreadable, the letters may have been rearranged rather than replaced. The cipher identifier can suggest what kind of cipher you have.

When you do not know the keyword

This page does not search for keywords. It decodes with the keyword you give it, so guessing is up to you. That works well when the keyword is hinted at: a puzzle title, a name in a story, a theme word in a geocache description. Try each candidate and keep the one with readable output and the highest score.

When you have no idea what the keyword is, guessing words is slow. A keyword cipher is a simple substitution cipher, so it can be broken without the keyword at all. The substitution cipher solver searches for the whole 26-letter alphabet from the ciphertext alone, shows the plaintext, and then tries to read the keyword out of the alphabet it found. It also recognises the shifted K1, K2 and K3 keyword alphabets used in Codebusters, which this decoder does not.

Keyword cipher variants this decoder does not cover

This decoder uses the most common layout: the keyword at the start of the cipher alphabet, the plaintext alphabet in normal order, no shift. Some puzzles use other layouts:

  • The keyword alphabet in the plaintext row (K1 in Codebusters terms), where decoding means reading the table the other way round.
  • A shifted keyword alphabet, where the keyword starts under some letter other than A.
  • The same keyword alphabet on both rows, offset by a shift (K3).

If the right keyword gives half-readable or unreadable text, one of these layouts is the likely reason. The keyword cipher page builds the standard layout, and the Aristocrat practice page explains the K1, K2 and K3 layouts with examples.

Similar tools