Ciphers and codes: encrypt, decode and crack classic ciphers
From Caesar's shift of 3 to the Vigenère cipher that stood for three centuries. Every tool here encrypts and decrypts, and the ones with keys can also crack messages without them.
- Runs in your browser
- 14 ciphers
- Solvers for keyed ciphers
All cipher tools
- ROT13 Encoder & DecoderEncode or decode ROT13 instantly, with ROT5 and ROT18 for digits and every ROT variant side by side.
- ROT47 Encoder & DecoderRotate every printable ASCII character with ROT47, the version of ROT13 that also scrambles digits and symbols.
- ROT8000 Encoder & DecoderROT13 for the whole Unicode range: rotate 63,404 characters by half, so Latin text turns into CJK characters and back.
- Atbash Cipher Encoder & DecoderSwap every letter with its mirror in the alphabet (A↔Z, B↔Y), the ancient cipher that is its own inverse.
- Vigenère Cipher Encoder, Decoder & SolverEncrypt or decrypt with a keyword (Vigenère, Beaufort or Autokey), or let the solver find the key from the ciphertext alone.
- Affine Cipher Encoder, Decoder & SolverEncrypt or decrypt with the affine formula (ax + b) mod 26, or try all 312 keys and see the most likely one.
- Rail Fence Cipher Encoder, Decoder & SolverWrite text in a zigzag over any number of rails and read it off row by row, with a live diagram and a solver.
- Playfair Cipher Encoder & DecoderEncrypt and decrypt letter pairs with a 5×5 key square built from your keyword, shown live as you type.
- Columnar Transposition Cipher Encoder, Decoder & SolverWrite the message in rows under a keyword and read the columns in key order, with a grid diagram and a solver.
- Morse Code Translator (with Sound)Translate text to Morse code and back, play it as sound with a flashing light, and download it as a WAV file.
- A1Z26 Cipher Encoder & DecoderTurn letters into their alphabet positions (A = 1 to Z = 26) and numbers back into letters.
- Bacon Cipher Encoder & DecoderEncode letters as groups of five A/B symbols, or hide a message in the capital letters of ordinary text.
- Polybius Square Cipher Encoder & DecoderTurn each letter into its row and column in a 5×5 grid, with an optional keyword square.
- Caesar Cipher Encoder, Decoder & SolverEncrypt or decrypt with any shift, or let the solver try every shift and pick the most likely one.
Which cipher do I have?
Look at what the encrypted text looks like, then open the matching tool. Each solver confirms the guess in a second.
- Only letters changed, the same letter always becomes the same letter, word lengths keptCaesar (try all shifts)
- As above and nothing fits a shiftAffine
- Looks like the alphabet was reversed (A ↔ Z)Atbash
- Letters, digits and symbols are all scrambled, spaces keptROT47
- Normal text became Chinese or Japanese charactersROT8000
- The same letter becomes different letters, and frequencies look flatVigenère (use the key solver)
- A spoiler or joke on a forum, letters onlyROT13
- The original letters are all there, just in a different orderRail fence (try all rails)
- Letters in the right amounts but scrambled in blocks, with a keywordColumnar transposition
- Even number of letters, no J, never a double letter inside a pairPlayfair
- Dots and dashesMorse code
- Numbers between 1 and 26A1Z26
- Pairs of digits from 1 to 5Polybius square
- Groups of five A/B (or 0/1), or a sentence with odd capital lettersBacon cipher
Ciphers compared
The last column shows the word Hello encrypted with each cipher (and the key in brackets).
| Cipher | Type | Key | Possible keys | Self-inverse | Broken by | "Hello" |
|---|---|---|---|---|---|---|
| Caesar | Shift | Shift 1–25 | 25 | No | Trying all 25 shifts | Khoor (shift 3) |
| ROT13 | Shift | None | 1 | Yes | Anyone who knows it | Uryyb |
| ROT47 | Shift (ASCII) | None | 1 | Yes | Anyone who knows it | w6==@ |
| ROT8000 | Shift (Unicode) | None | 1 | Yes | Anyone who knows it | 籑籮籵籵籸 |
| Atbash | Mirror | None | 1 | Yes | Anyone who knows it | Svool |
| Affine | Substitution | a and b | 312 | No | Trying all 312 keys | Rclla (a=5, b=8) |
| Vigenère | Polyalphabetic | Keyword | Huge | No | Key length + frequency analysis | Sixzb (key LEMON) |
| Playfair | Digraph substitution | Keyword | Huge | No | Letter-pair frequencies | DMYRAN (key PLAYFAIR EXAMPLE) |
| Rail fence | Transposition | Number of rails | Under 150 | No | Trying every rail count | Hoell (3 rails) |
| Columnar transposition | Transposition | Keyword | k! orders | No | Anagramming the columns | olelH (key ZEBRAS) |
| Polybius square | Coordinates | Optional keyword | 1 (standard) | No | Frequency analysis | 23 15 31 31 34 |
| Bacon | Binary code / steganography | None | 1 | No | Spotting two styles of letters | AABBB AABAA ABABB ABABB ABBBA |
| A1Z26 | Code | None | 1 | No | Anyone who knows it | 8-5-12-12-15 |
| Morse code | Code | None | 1 | No | Anyone who knows it | .... . .-.. .-.. --- |
How classic ciphers work
Most classic ciphers are substitution ciphers: each letter is replaced by another. In a monoalphabetic cipher such as Caesar, Atbash or affine, a letter always becomes the same letter, so the message keeps the letter frequencies of normal language. That is their weakness: in English, E, T and A are common, and their replacements stand out.
Polyalphabetic ciphers such as Vigenère change the substitution from letter to letter using a keyword, which flattens those frequencies. They held out for centuries, until cryptographers learned to find the key length and split the message back into simple Caesar ciphers.
Transposition ciphers such as the rail fence and columnar transposition do not replace letters at all: they only change their order, so letter frequencies stay exactly the same as in normal text. That is a quick way to recognise them.
None of these ciphers is safe for real secrets today. For that, modern encryption such as AES is used. If you only need to turn data into text, look at our encoding tools instead.
Frequently asked questions
What is the difference between a cipher and an encoding?
A cipher is meant to hide a message and usually needs a key. An encoding, such as Base64 or URL encoding, only changes how data is written and has no secret at all. Classic ciphers are no longer secure, but they still need a key or method to read.
Which classic cipher is the hardest to break?
Of the ciphers here, Vigenère with a long key is the hardest, because the same letter is encrypted in different ways. It is still breakable with enough text, as the solver on its page shows.
How can I tell which cipher was used?
Look at what changed. If only letters changed and each letter always maps to the same letter, it is a substitution like Caesar, Atbash or affine. If symbols changed too, think ROT47. If letter frequencies look flat, it is probably Vigenère. The table above lists the common signs.
Are these ciphers safe to use for passwords?
No. Every cipher on this page can be broken in seconds by a computer. They are great for puzzles, games, escape rooms and learning how cryptography works.
Your next tool is one search away.
Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.
Tip: press Ctrl D to bookmark dev247.