← Back

Caesar Cipher

Simple letter-shift encryption and decryption

Encrypted (shift forward)
Khoor Zruog
Decrypted (shift backward)
Ebiil Tloia

About Caesar Cipher

The Caesar cipher is one of the oldest substitution ciphers: every English letter is moved a fixed number of places along the alphabet, and anyone who knows the shift can move the letters back to recover the original. This tool does exactly that and nothing more. You type some text, drag a slider to pick the shift, and the page shows two lines at once, 'Encrypted (shift forward)' and 'Decrypted (shift backward)'. A collapsible panel also lists the backward result for every shift from 1 to 25, so you can find the plaintext by eye when you don't know the shift. It is a learning aid and a puzzle-making toy, not a way to keep anything secret, and the reasons are explained below.

How to use it

  1. Type or paste your text into the 'Input text (only affects English letters)' box. When the page loads it contains 'Hello World' and the shift is 3.
  2. Drag the 'Shift' slider to any whole number from 1 to 25. The label updates live, for example 'Shift: 3'.
  3. Read the first box, 'Encrypted (shift forward)'. It is your input moved forward by the chosen shift. Use the copy button on its right to copy it.
  4. If the text you pasted is already ciphertext and you know the shift, read the second box, 'Decrypted (shift backward)'. It moves the input back by the same shift and also has a copy button.
  5. If you don't know the shift, click 'Don't know the shift? Brute-force it here →'. A list appears with 25 rows labelled 'Shift 1' through 'Shift 25'. Scan for the row that reads as normal text; its label is the shift. Click 'Collapse' to hide the list again.

A worked example (actually computed)

With the default input 'Hello World' and a shift of 3, the encrypted line is 'Khoor Zruog'. Moving 'Khoor Zruog' backward by 3 gives 'Hello World' again. A second example with punctuation and digits: 'Attack at Dawn! 2024' with a shift of 13 becomes 'Nggnpx ng Qnja! 2024'. The exclamation mark, spaces and the digits 2024 are untouched, and upper and lower case are preserved. As a side note, a shift of 13 applied twice returns the original, because 13 plus 13 is 26. These outputs were produced by running the same shifting logic the tool uses.

What it supports and where it stops

  • Only the 26 English letters (A-Z and a-z) are shifted, and upper and lower case each wrap around within their own alphabet. Chinese, Japanese, accented letters such as 'é', digits, punctuation and spaces are passed through unchanged.
  • The shift ranges from 1 to 25. There is no 0 or 26 option, since both would leave the text unchanged anyway.
  • There is no encrypt/decrypt mode switch. The two result boxes are always shown together: the first shifts forward, the second shifts backward. Choose the one that matches whether your input is plaintext or ciphertext.
  • The brute-force list shifts your input backward by 1 to 25 and shows all results. It does not judge which one is correct. With very short text (one or two words), more than one shift can produce something that looks plausible, so you may need context to decide.
  • Line breaks are kept in the text as ordinary characters and are not shifted.

FAQ: Is the Caesar cipher secure?

No. There are only 25 possible shifts, so even trying them by hand cracks it quickly, and a computer lists them all instantly. It also keeps the letter-frequency pattern of the original language intact. Do not use it for passwords, personal data or anything that genuinely needs protection. For real confidentiality, use a modern, well-reviewed encryption tool.

FAQ: Why didn't my Chinese text change?

The Caesar cipher is defined as rotating through a 26-letter alphabet. Chinese characters have no such fixed order, so the tool only affects English letters and leaves everything else as it is. That is what 'only affects English letters' in the input label means. This tool does not provide a Chinese variant.

FAQ: Which of the two result lines should I read?

To encrypt plaintext, read 'Encrypted (shift forward)'. If you received ciphertext and know the shift, paste it in and read 'Decrypted (shift backward)'. Both use the same shift in opposite directions, so running a forward result through a backward shift of the same size gets you back to the original.

FAQ: Why does brute force list only 25 options?

A shift of 0 changes nothing, and a shift of 26 goes all the way around the alphabet and also changes nothing, so only the shifts 1 to 25 are actually different. Listing all 25 is guaranteed to include the right answer, which is exactly why the cipher is so easy to break.

FAQ: Can I use this for puzzles or escape-room clues?

Yes. Write your clue, pick a shift, encrypt it and hand over the ciphertext. Players who know the shift can decrypt directly, and those who don't can still use a brute-force list. If you want the puzzle to require thinking rather than trial and error, give a hint about the shift, such as 'the shift is the month of my birthday'.

Privacy and processing

All shifting is done in your browser by a few lines of JavaScript as you type. The tool makes no network requests, so your text is not sent to a server, and it is not stored; reloading the page resets it to the default 'Hello World'. Still, please don't treat it as a way to protect sensitive information, for the reasons given above.