Caesar cipher

Apply the Caesar cipher to any text with a configurable Shift from -25 to 25. Each Latin letter moves N positions through the 26-letter alphabet, wrapping at the ends; digits, punctuation, accented characters, and non-Latin scripts pass through unchanged. To decode, run the same text with the negative shift. Default shift is 3 (the original Caesar). Special case shift 13 is ROT13. Nothing uploads.

Input
Line 1:1 LF cloud_done Saved locally
Result Caesar Cipher
0 lines 0 chars

Caesar shift, classical substitution with N positions

The Caesar cipher is a substitution cipher where every letter shifts a fixed number of positions through the alphabet. Default shift is 3 (Suetonius reports Julius Caesar used 3, hence the name). With shift 3, a becomes d, x becomes a (wrap-around), Hello becomes Khoor. The shift only affects ASCII letters a-z and A-Z; everything else passes through.

TextResult's implementation accepts Shift values from -25 to 25. Shift 0 is the identity (no change), shift 13 is ROT13 (its own inverse), shift 25 is equivalent to shift -1. To decode a Caesar-shifted message, run it through the cipher again with the negated shift: ciphered with shift 7, decode with shift -7. Or use shift 26 - 7 = 19; both work because of the wrap.

Caesar is one of the simplest substitution ciphers and one of the easiest to break: with only 25 non-trivial shift values, brute force is trivial. Frequency analysis (the most common letter in English text is e) reveals the shift in a single pass over a few sentences. Use Caesar for puzzles, escape rooms, and as a worked teaching example, never for actual security. For a different family of classical cipher, see Atbash (alphabet reversal).

How to use caesar cipher

  1. 1Paste or type your text into the input panel on the left.
  2. 2Set Shift in the action bar (range -25 to 25, default 3).
  3. 3The shifted result appears in the output panel as you type.
  4. 4To decode, paste the ciphertext and use the negative of the original shift.
  5. 5Click Copy in the output header to copy the result.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Configurable shift, range -25 to 25

Set Shift in the action bar to any integer from -25 to 25. Default is 3. Shift 0 is the identity. Negative shifts move letters backward (a with shift -1 becomes z).

Wrap-around at the alphabet edges

Letters past z wrap to a; letters before a wrap to z. Implementation is (code - base + shift + 26) % 26, which handles negative shifts correctly without an explicit branch.

ASCII letters only, case preserved

Only a-z and A-Z shift; case is preserved. Digits, punctuation, whitespace, accented characters (é, ñ), and non-Latin scripts pass through unchanged.

To decode, negate the shift

A message encoded with shift +7 decodes with shift -7. Equivalently, shift 26 - 7 = 19 decodes the same message because the alphabet wraps. Whichever you find easier; both produce the original text.

Shift 13 is its own inverse

When Shift is 13, the cipher equals ROT13: applying it twice returns the original. That is because 13 + 13 = 26, a full cycle around the alphabet.

Worked example

Default shift 3 (the historical Caesar): H -> K, e -> h, the comma and space pass through. Decode by running the result with shift -3. For shift 13, see ROT13.

Input
Hello, world!
Output
Khoor, zruog!

Settings reference

Behaviour Effect on output
Shift Default 3. Range -25 to 25. Each letter moves this many positions through the alphabet.
Shift 0 Identity. Output equals input.
Shift 13 Equivalent to ROT13. Self-inverse.
Negative shifts Move letters backward. Shift -1: a -> z, b -> a.
Wrap-around Past z wraps to a; before a wraps to z.
Non-letter characters Digits, punctuation, whitespace, accented characters, and non-Latin scripts pass through unchanged.
Keep Case on (default) Uppercase letters stay uppercase, lowercase stay lowercase across the shift.
Keep Case off Output is folded to lowercase regardless of input casing.
Decode on Inverts the shift so the same tool reverses a previously-encoded message. Equivalent to flipping the sign on Shift.

FAQ

How do I decode a Caesar-shifted message?
Run the ciphertext through the cipher with the negated shift. Encoded with shift +7? Decode with shift -7. The wrap-around makes shift 19 work too (since 26 - 7 = 19).
What if I do not know the shift?
Brute force: there are only 25 non-trivial shifts. Try each from 1 to 25 and look for the one that produces readable English (or whatever language the plaintext is in). Frequency analysis on a longer ciphertext also reveals the shift in seconds: the most frequent letter in English is e, so whichever letter dominates the ciphertext probably maps to e.
Is Caesar a real encryption algorithm?
No. Caesar is a teaching cipher and a puzzle. With only 25 keys it is trivially brute-forced; even a 6-year-old could try every shift. Use it for escape rooms, learning, and historical curiosity. For actual encryption, use AES or a TLS-backed channel.
Does it shift accented letters?
No. Only ASCII a-z and A-Z shift. café with shift 3 becomes fdfé: the three ASCII letters move, the é passes through. Diacritics and non-Latin scripts are not part of the cipher.
Is the input sent anywhere?
No. The transform runs entirely in your browser. Nothing is uploaded, nothing is logged.