Keyword Cipher
This keyword cipher builds a 26-letter alphabet from a word, shows it under A to Z, and turns Meet me at noon into Ibbs ib ns jllj with the keyword NOTEBOOK.
Input
0 of 5,000 characters (code points).
Encoded text
Type some text first.
Mixed alphabet
| A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A becomes C | B becomes I | C becomes P | D becomes H | E becomes E | F becomes R | G becomes A | H becomes B | I becomes D | J becomes F | K becomes G | L becomes J | M becomes K |
| N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
| N becomes L | O becomes M | P becomes N | Q becomes O | R becomes Q | S becomes S | T becomes T | U becomes U | V becomes V | W becomes W | X becomes X | Y becomes Y | Z becomes Z |
Upper row: A to M. Lower row: N to Z.
ABCDEFGHIJKLMNOPQRSTUVWXYZ to CIPHERABDFGJKLMNOQSTUVWXYZ
Why use this Keyword Cipher?
The Alphabet Is the Answer
The mixed alphabet is printed under A to Z, so you can read the mapping directly instead of trusting a black box.
Repeat Rules Stated
A repeated letter in the keyword is used once. Letters missing from the keyword follow in alphabetical order. Nothing about that is left to guesswork.
No Hidden Merges
All 26 letters stay distinct, unlike Playfair and Polybius, where I and J share a cell. Copy that depends on a merge would decode wrongly here.
What is a Keyword Cipher?
A keyword cipher is a substitution cipher whose alphabet is built from a word. Write the keyword, drop any letter that already appeared, then write the rest of the alphabet in order. If the keyword is NOTEBOOK, the mixed alphabet starts NOTEBK and continues with A, C, D, F and the other unused letters. Plain A maps to the first letter of that alphabet, plain B to the second, and so on.
The cipher keeps the letter frequencies of the plaintext: the same letters appear as often, just renamed. That makes it exactly as breakable as any monoalphabetic substitution, which is why it appears in puzzle books and classrooms rather than in anything that needs to keep a secret. Anyone with the keyword can rebuild the alphabet and decode in one pass, so the keyword is the whole secret. A keyword used over and over, letter by letter, is the vigenere cipher, a different and stronger idea.
The Rule This Page Follows
- Alphabet buildKeyword letters in order with repeats dropped, then the unused letters of A to Z in order. Keyword NOTEBOOK gives NOTEBKACDFGHIJLMPQRSUVWXYZ.
- MappingPlain A maps to the first cipher letter, B to the second, and so on. Meet me at noon. becomes Ibbs ib ns jllj.
- Alphabet panelThe mixed alphabet is drawn under A to Z in two rows of 13 columns, A to M then N to Z, with the caption Upper row: A to M. Lower row: N to Z, so the split is stated rather than implied by the layout.
- Letter mergeNone. All 26 letters are distinct, so I and J have separate letters and a message containing both round-trips exactly. Do not compare this alphabet with a Playfair or Polybius square, which do merge them.
- Keyword caseThe keyword is read upper case, spaces and punctuation in it are ignored, and digits are ignored.
- Keyword lengthOnly the first 26 letters of the keyword are used, because the alphabet has 26 cells. A longer keyword is cut and the page says so. A keyword that contains all 26 letters sets the whole alphabet by itself.
- Case and punctuationCase is kept and anything that is not A to Z passes through unchanged, so a sentence with commas and digits comes back looking like a sentence.
- DecodingThe same keyword rebuilds the same alphabet in reverse. Paste the ciphertext and press Decode; without a keyword the page says it cannot decode rather than guessing.
- LimitsUp to 100 code points of keyword and 5,000 code points of message. Over either limit the page refuses the input and names the limit in code points.
- Not includedA solver for an unknown keyword, a cryptogram puzzle sheet and any history of results.
- Saved inNothing is saved. Reloading clears the text and the keys.
Common Use Cases
Puzzle Sheets
Read the mixed alphabet off the page and copy it into a puzzle by hand, which is faster than building it twice.
Classroom Exercises
Type a keyword the class chose and show that the same word always builds the same alphabet.
Fast Hand Encoding
Encode a short message without writing out 26 letters first.
Comparing With Vigenere
See that one keyword used once gives a fixed mapping, while a repeating key changes per letter.
Making a Custom Alphabet
Build the mapping for a cipher you invented, then read it under A to Z to check it is a permutation.
Checking a Printed Key
Paste a puzzle's alphabet and compare letter by letter with the one the page builds from the same keyword.
How to Encode and Decode
Type a keyword
One word is enough. Repeats are ignored, so NOTEBOOK and NOTEBK build the same alphabet.
Read the alphabet
The mixed alphabet appears under A to Z, drawn in two rows of 13 so all 26 letters fit a phone screen.
Press Encode
Each letter is replaced by the letter beneath it in the mixed alphabet. Case is kept.
Press Decode
The same keyword reverses the mapping. Without a keyword the page cannot decode, and it says so instead of guessing.
What the Output Gives You
Alphabet and Text Together
The mapping and the ciphertext sit on one screen, which is what a puzzle page needs.
Copy Without Cleanup
One button copies the ciphertext or the plaintext exactly as shown, with case and punctuation intact.
No Merge Surprises
Decoding a message from a Playfair square here fails visibly, because the alphabets differ.
Case and Punctuation Survive
The output reads like the input.
Repeats Counted
When a keyword repeats a letter, the page says which letters were used once and how many repeats were dropped, so nothing is silently discarded.
Tips for Keyword Cipher Work
- •Pick a memorable word The keyword is the whole key, so a word you will not forget beats a random string.
- •Longer is not stronger Frequency analysis does not care how long the keyword is. Use it for puzzles.
- •Watch out for merges If your source merges I and J, spell the message with I before encoding here.
- •Compare all 26 letters When a printed key and the page disagree, compare all 26 letters, not the first few: a mistyped keyword letter also changes where every unused letter falls.
- •Keep the keyword with the ciphertext There is no way back without it.
- •Separate runs A repeated letter in the keyword does not appear twice, so AARDVARK and ARDVK build the same alphabet.
Build an Alphabet
Type a keyword above and read the 26 letters under A to Z, then encode a short message.
For a repeating key instead of a mixed alphabet, open the vigenere cipher, or try the affine cipher for a rule-based mapping.
Related tools
Frequently Asked Questions
Is a keyword cipher the same as a Vigenere cipher?
No. A keyword cipher uses the word once, to build a new alphabet, and then every letter is replaced by the same mapping. Vigenere repeats the keyword letter by letter, so the same plaintext letter encrypts differently at different positions.
What happens if my keyword repeats a letter?
The later copies are dropped. NOTEBOOK keeps N, O, T, E, B and K, which is six letters, and its two extra Os do nothing. The alphabet is still 26 letters long.
Can I decode without the keyword?
Not on this page. A keyword cipher is a simple substitution, so a solver could attack it with frequency analysis, but that is a different tool and this one does not guess. It asks for the keyword.
Why is there no I and J merge here?
Because this alphabet has 26 cells, not 25. Playfair and Polybius use a 5 by 5 square, which has 25 cells, so one pair of letters has to share. A keyword alphabet is a single line and has room for all 26.
How long can the keyword be?
Up to 100 code points, though only its first 26 letters count and anything past 26 distinct letters cannot add to the alphabet. A keyword that uses all 26 letters sets the whole alphabet itself.