What a keyword cipher is
A keyword cipher is a simple substitution code. You pick a keyword, and it builds a new alphabet: the letters of the keyword come first, in order, with repeats removed, and then the rest of the alphabet follows in order. Every letter of your message is swapped for its match in the new alphabet, so the message looks like nonsense until someone with the keyword swaps it back.
The keyword is the whole secret. Change one letter of the keyword and the entire alphabet changes, so the same message codes differently. It is a classic puzzle code, used in books, games, and classrooms to show how substitution works, because the idea is easy to see and the alphabet is easy to build by hand.
How to use the encoder
Type a keyword in the first box. A short, memorable word works best, like secret or dragon. Then type your message and choose Encode. The tool shows your new alphabet at the top, and the coded message below it. To decode, type the same keyword, paste the coded message, and choose Decode.
Try a few keywords and watch the alphabet change. A keyword with repeated letters, like banana, uses only its unique letters, so banana builds the same alphabet as ban. Spaces and punctuation stay as they are, so the word shapes still show through, which is part of the puzzle.
Worked example
Use the keyword secret. Its unique letters are s, e, c, r, t, and they come first. Then the rest of the alphabet follows in order, skipping those five letters: a, b, d, f, g, h, i, j, k, l, m, n, o, p, q, u, v, w, x, y, z. The full alphabet is secretabdfghijklmnopquvwxyz, 26 letters, one of each.
Now encode meet at dawn. The letter m is the 13th letter of the plain alphabet, and the 13th letter of the new alphabet is j. The letter e is 5th, and the 5th letter is t. Working through the whole message gives jttq sq rswk. Decode it with the same keyword and you get meet at dawn back. Try hello with the keyword cipher, which gives bejjm, and check it decodes too.
Who uses a keyword cipher
Teachers use it to show how codes work, because students can build the alphabet on paper and code a message in minutes. Puzzle fans use it in treasure hunts and escape rooms, where the keyword is the clue and the coded note is the prize. Writers use it in stories, where a character leaves a coded message and the reader must find the keyword.
Friends use it as a game, passing notes that look like random letters. It works best as a shared puzzle, where the fun is in building the alphabet and cracking the code together, not in hiding real secrets.
Honest limitations
A keyword cipher is not strong security. The same letter always codes to the same letter, so the pattern of the message leaks through: the most common letter in English is e, and in a long coded message the most common letter is usually e in disguise. A patient reader can crack it with letter-frequency analysis, without ever knowing the keyword.
Short messages are harder to crack, but they are also less safe in another way: the keyword itself is easy to guess if it is a common word. Never use this for passwords, bank details, or anything private. It is a learning and game tool, and for real secrets you need proper encryption.
Frequently asked questions
What keyword should I use? A word you can remember, with as many different letters as you can. A word like dragonfly uses 9 different letters, which makes a stronger alphabet than a short word like cat.
Do repeated letters in the keyword matter? No. The tool keeps only the first copy of each letter, so banana builds the same alphabet as ban. The order of the first copies is what counts.
Can I use numbers or accents? This tool codes the 26 plain letters a to z. Numbers, spaces, and punctuation pass through unchanged, and accented letters are treated as plain letters only if you type them without the accent.
Is it safe for secrets? No. It is a puzzle code. Anyone with time and a frequency table can crack a long message, so use it for fun, not for private data.
También disponible en español: Codificador de Cifrado por Palabra Clave
