Free Caesar Cipher & Text Encryptor
Encrypt and decrypt text with Caesar cipher, ROT13, Atbash, and Vigenère cipher. Classic substitution ciphers, all in your browser.
I have ciphertext: find the shift
Tries every Caesar shift on the input text and ranks them by how much the result looks like real language.
Shifts each letter by 13. Self-inverse — applying it twice returns the original.
Educational use only. Caesar, ROT13, Atbash, and Vigenere are classical ciphers — they provide no real confidentiality and are trivially broken. Do not use them to protect sensitive information.
Common uses
- Encode and Decode ROT13Use ROT13 to obscure text — the go-to cipher for spoilers, puzzle answers, and content warnings.
- Create Caesar Cipher PuzzlesEncode hidden messages in Caesar cipher for scavenger hunts, escape rooms, and puzzle challenges.
- Learn Classical CryptographyExplore Caesar, Atbash, and Vigenère ciphers to understand the history and principles of cryptography.
- Send Secret MessagesEncode personal messages, notes, and private communications with a simple substitution cipher.
- Apply the Atbash CipherReverse the alphabet with Atbash: A becomes Z, B becomes Y, and so on — an ancient Hebrew cipher.
How It Works
All four ciphers — Caesar, ROT13, Atbash, and Vigenère — are implemented from scratch in the browser using pure character-code arithmetic, with no external library of any kind. Encoding and decoding happen instantly in your browser as you type; nothing is ever sent to a server.
- 1Pick a cipher and configure itChoose between four classical substitution ciphers. Caesar lets you set a shift value from 1–25 via a slider. Vigenère requires a keyword whose letters determine a different shift at each position in the text. ROT13 and Atbash have no parameters — both are self-inverse, so encoding and decoding are the same operation.
- 2Hand-written character arithmetic runs the transformEach cipher is a small pure function over the input string. Caesar and ROT13 use modular arithmetic on character codes — ((charCode - base + shift) % 26) + base — leaving non-alphabetic characters completely unchanged. Atbash mirrors each letter by computing base + 25 - (charCode - base). Vigenère cycles through the keyword characters, applying a different shift to each successive letter.
- 3Brute-force cracker ranks all 25 Caesar shiftsIf you have ciphertext but no known shift, the 'crack' panel tries all 25 shifts at once and scores each candidate against English letter frequencies using a chi-squared test. The decryption whose letter distribution best matches real English is ranked first.
- 4Copy the result or share a puzzle linkThe output updates live with every keystroke. Copy it to the clipboard, or use 'Copy link' to generate a URL that encodes your chosen cipher, shift or key, and input text — so you can share an encoded puzzle that opens directly in the tool.
Guide
Worked example
The page opens on "ROT13" with a sample sentence in "Input", and "Output" shows "Gur dhvpx oebja sbk whzcf bire gur ynml qbt." Click into the Input box once and the sample clears, so retype or paste "The quick brown fox jumps over the lazy dog." Choose "Caesar Cipher", keep "Encode" selected and set "Shift" to 3. The output is "Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj." and the "Alphabet mapping" strip shows A over D. Press "← Use as input" to make that text the input. Now open "I have ciphertext: find the shift" and press "Try all shifts". The first row is tagged "Best guess", reads "Shift 3" and shows the original sentence. "Use best shift (3)" switches the tool to Caesar with "Decode" selected and the shift set to 3.
Which settings to use, and the limits
- Pick the cipher before anything else. There are seven buttons: "Caesar Cipher", "ROT13", "ROT5 (digits)", "ROT18", "ROT47", "Atbash" and "Vigenère Cipher". Only Caesar and Vigenère have "Encode" and "Decode" buttons. ROT13, ROT5, ROT18, ROT47 and Atbash are self-inverse, so running the output through the same cipher gives back the original. ROT13 only moves the letters A to Z. ROT5 only moves digits. ROT47 rotates every printable ASCII character from ! to ~, so "Hello, World!" becomes "w6==@[ (@C=5P".
- Set the shift, and remember Decode subtracts it. The "Shift" slider runs from 1 to one less than the alphabet's length, so 1 to 25 for Latin. Quick buttons offer 1, 3, 7, 13, 17, 21 and 25 where they fit. It starts at 13. "Encode" moves each letter forward by the shift and "Decode" moves it back, so to read a message that someone encoded with shift 3, choose "Decode" and 3. If you switch to a shorter alphabet while the shift is large, the shift is reduced to fit, for example 25 becomes 23 for Greek.
- Match the alphabet to the text. Caesar, Atbash and Vigenère use the "Alphabet" menu. It lists Latin A–Z (26), German (29), Swedish (29), Turkish (29), Russian (33), Ukrainian (33), Greek (24), Persian (32), Arabic (28) and Hebrew (22). Letters not in the chosen alphabet, and all punctuation, pass through unchanged, and capitals stay capitals. The same shift gives different letters in different alphabets: Z shifted by 3 is C in Latin but Ü in German, whose alphabet is longer. Decode with the alphabet that was used to encode.
- Use the digit and layout options for puzzles. "Also shift digits" appears for Caesar and Atbash. In Caesar it moves each digit by the shift modulo 10, so with shift 3 "Hello, World! 2024" becomes "Khoor, Zruog! 5357". In Atbash, 0 swaps with 9. "UPPERCASE output" capitalises the result, and "Remove spaces" takes out every space and line break. "Groups of 5" removes them too and then splits the text into blocks of five characters, so "Attack at dawn" becomes "ATTAC KATDA WN" when uppercase is also on.
- Choose a keyword that uses the alphabet's letters. Vigenère shifts each letter by the matching letter of the keyword, repeating the keyword along the text. Only letters of the selected alphabet count in the keyword, and case does not matter. With the Latin alphabet, "Attack at dawn" and the key "lemon" give "Lxfopv ef rnhr". Spaces and punctuation in the text do not use up key letters. "Find the key" estimates the key length and key from at least about 100 letters of ciphertext. It lists up to 3 candidates, which can be a multiple of the true length, so read the decoded text before trusting one.
- Share a puzzle, or print the key. "Share result" is in the Input header. It copies a link, or opens the share sheet on a phone, holding the cipher, alphabet, shift or key, mode and text. They sit after the # in the address, so the text is not sent to the server. The text is cut short if it would make the link longer than about 1,800 characters. "Copy mapping" copies two lines, the letters and what they become, and "Print" opens a printable card of the same strip. If your browser blocks the pop-up window, Print does nothing.
Common problems and how to fix them
- It says "Enter a keyword containing letters of the selected alphabet to encode or decode."
- The Vigenère keyword has no letters that belong to the selected alphabet, so the output stays empty rather than echoing your text back. The keyword may be blank, made of digits and symbols, or written in another script, such as a Cyrillic keyword with Latin selected. Type letters from the chosen alphabet or change the "Alphabet" menu. Characters outside the alphabet are silently skipped, so a keyword like "sécret" with Latin selected works as "scret".
- It says "This text looks like German A–Z + ä ö ü (29). Letters outside the selected alphabet are not shifted."
- Your text holds letters that the selected alphabet does not have, so they would pass through unchanged and the result would be half-encoded. Press the "Use German A–Z + ä ö ü (29)" button, or the name it shows for your text, to switch. The notice appears for Caesar, Atbash and Vigenère, when another alphabet covers more of your letters. Keep using that same alphabet to decode, because the shift wraps around at a different length in each one.
- It says "3 letters outside A–Z stay unchanged in this cipher."
- ROT13 and ROT18 only work on the 26 letters A to Z, so accented and non-Latin letters such as ü or п are left as they are. The number is how many such letters your text has. If the text is in another alphabet, press the "Use Caesar with" button that appears, to open Caesar with the matching alphabet, then choose a shift. ROT13 is a shift of 13 only in the 26-letter Latin alphabet.
- It says "Only 12 letters: too short for a reliable guess, so the best match may be wrong. Check the other rows too."
- "Try all shifts" ranks the possible shifts by how closely the letter counts match the languages of the selected alphabet. With fewer than 20 letters those counts are too few to be reliable, so the row tagged "Best guess" can be wrong. Read through the other rows, which are sorted from the best score down, and use "Use" on the one that makes sense. A longer piece of ciphertext gives a clearer winner.
- It says "Enter some text with letters to crack."
- The input has no letters from the selected alphabet, for example only digits and punctuation, or Russian text while Latin is selected. For ROT ciphers an "Alphabet" menu appears inside the panel, so pick the one the text uses. The Vigenère key finder has its own messages, "No clear key length found." and "Short ciphertext: results are likely unreliable.", which usually mean the text is too short or too random for a key length to stand out.
How it compares
Doing a Caesar shift by hand with a paper strip or a cipher wheel is fine for a few words, and the "Alphabet mapping" strip can be printed to serve as that wheel. This tool saves the effort of working through longer text, covers ten alphabets, and can rank all the shifts of a ciphertext for you. It has seven ciphers only and no Playfair, rail fence, keyed substitution or one-time pad. Its guesses are statistical and need enough text to work. None of these ciphers protects anything, and the page says so: "they provide no real confidentiality and are trivially broken." For anything private, use real encryption.
Related Tools
URL Encoder & Decoder
Encode and decode URLs and query strings. Supports encodeURIComponent, decodeURIComponent, and query string parsing.
Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to plain text. Instant, private, and free.
HTML Encoder & Decoder
Encode special characters to HTML entities or decode entities back to plain text. Instantly, in your browser.