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
- 1Paste or type your text into the input panel on the left.
- 2Set Shift in the action bar (range
-25to25, default3). - 3The shifted result appears in the output panel as you type.
- 4To decode, paste the ciphertext and use the negative of the original shift.
- 5Click Copy in the output header to copy the result.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run 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.
Hello, world!
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?
+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?
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?
Does it shift accented letters?
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.