Substitution Cipher
Substitution cipher applies your single alphabet mapping to encrypt or decrypt text; generate a mapping from a keyword or enter your own alphabets. Anyone with the mapping can reverse it; this is not a confidentiality tool.
Current source-to-substitution mapping.
Ready. Enter your mapping or generate one with a keyword.
Original mapping and round-trip checks
We created four input and mapping combinations. Python independently built each mapping, encoded each sample and compared it with this page’s JavaScript. JavaScript then decrypted every computed ciphertext back to the exact original. Each comparison matched. The table is generated from these calculations, not copied from another tool.
| Setting | Source alphabet | Substitution alphabet | Original text | Computed ciphertext | Recovered text |
|---|---|---|---|---|---|
| Keyword ZEBRAS | ABCDEFGHIJKLMNOPQRSTUVWXYZ | ZEBRASCDFGHIJKLMNOPQTUVWXY | Meet at gate! 123 | Jaaq zq czqa! 123 | Meet at gate! 123 |
| Keyword BALLOON | ABCDEFGHIJKLMNOPQRSTUVWXYZ | BALONCDEFGHIJKMPQRSTUVWXYZ | Abc XYZ 09 é 🚀 | Bal XYZ 09 é 🚀 | Abc XYZ 09 é 🚀 |
| Custom reversed mapping | ABCDEFGHIJKLMNOPQRSTUVWXYZ | ZYXWVUTSRQPONMLKJIHGFEDCBA | Line 1\nLine 2 | Ormv 1\nOrmv 2 | Line 1\nLine 2 |
| Custom source order | ZYXWVUTSRQPONMLKJIHGFEDCBA | ORBITZYXWVUSQPNMLKJHGFEDCA | ABCDEFGHIJKLMNOPQRSTUVWXYZ | ACDEFGHJKLMNPQSUVWXYZTIBRO | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
The first two rows test keyword generation, including repeated keyword letters. The third row uses a manually entered reversed alphabet and preserves a real newline, shown as in the table. The fourth changes the source alphabet order and checks all English letters. To reproduce a row, enter both alphabets as shown, encrypt its original text, then press Reverse result with the same alphabets.
How the keyword creates a mapping
The keyword is case insensitive. Keep each keyword letter at its first occurrence, then append unused letters in your source alphabet’s order. Repeated keyword letters are removed. The resulting alphabet has each English letter exactly once. The keyword is only a way to generate the mapping; encryption and decryption use the displayed alphabets.
Input, output and limits
Enter one text input, up to 20,000 Unicode characters per run. Both alphabets must contain all 26 English A–Z letters exactly once; alphabet input is case insensitive. You may choose their order. A keyword must contain 1–1,000 English letters only. Missing letters, duplicates, digits or symbols in an alphabet or keyword are rejected explicitly.
English letters are substituted with their case preserved. Digits, punctuation, spaces, line breaks, accented letters and emoji remain unchanged and are not part of this English alphabet mapping. Output is text with one-click copy. Empty text is rejected. No custom non-English character alphabet is supported.
One input per run. No login, registration, uploads, batch mode, saved history or daily counter. Processing stays in your browser.
Can this recover a message without its mapping?
No. It does not identify the substitution, guess a key, perform automatic cracking or promise that frequency analysis recovers plaintext. It only returns what the supplied mapping calculates.
Does substitution protect confidential information?
No. This is a monoalphabetic substitution for puzzles and learning. Anyone holding the mapping can reverse it. Do not use it to protect secrets.
How does it fit the other classic tools?
Caesar and ROT13 use fixed shifts; Atbash uses a fixed reversed alphabet; Vigenere uses repeated key-dependent shifts; Pigpen substitutes symbols. Cipher Decoder displays separate alternatives without determining which is correct. This page applies one user-supplied alphabet mapping.
Related representation walkthrough
This existing video demonstrates hexadecimal input and Base64 output, not substitution-cipher key recovery.
Loading the player connects to YouTube and shares connection information such as your IP address and playback requests.
For literal A/B five-symbol groups with explicit alphabet versions, use the Bacon cipher A/B tool.
For key-square letter pairs with visible preparation rules, use the Playfair key-square tool.
For position rearrangement rather than letter substitution, use the Rail fence transposition tool.