Tools Guides
Security Free No signup

Caesar Cipher

Encode or decode text using the classic Caesar cipher shift algorithm.

Loading tool…

About this tool

The Caesar cipher is one of the oldest and simplest encryption techniques, named after Julius Caesar who reportedly used it to communicate with his generals. It works by shifting each letter in the plaintext by a fixed number of positions in the alphabet. This tool lets you encode or decode any text with a shift value from 0 to 25, view an alphabet mapping visualization, and explore all 26 possible shifts at once in a brute-force table — perfect for solving puzzles or learning the basics of cryptography.

How to use

  1. 1 Type or paste your text into the input field.
  2. 2 Choose Encode to encrypt or Decode to decrypt.
  3. 3 Drag the shift slider or type a number between 0 and 25.
  4. 4 The result appears instantly below.
  5. 5 View the alphabet mapping to see which letters correspond.
  6. 6 Use the brute-force table to see all 26 possible decoded outputs.

How the Caesar cipher works

The Caesar cipher is the oldest encryption scheme still widely taught, named after Julius Caesar, who is said to have shifted each letter three places to keep military messages from prying eyes. The idea is a monoalphabetic substitution: pick a number from 1 to 25 — the shift — and slide every letter that many positions forward through the alphabet, wrapping around from Z back to A. With a shift of 3, A becomes D, B becomes E, and X wraps to A. To decode, you slide the same distance backward. This tool implements exactly that, treating the alphabet as a 26-position ring so the wrap is automatic.

The arithmetic behind a single letter is straightforward. Convert the letter to a number 0–25 (A=0, B=1, …), add the shift, take the result modulo 26, and convert back. Decoding subtracts instead of adds; this tool achieves it by adding (26 − shift), which is the same thing modulo 26 and avoids negative numbers. Only A–Z and a–z are transformed — letter case is preserved, and digits, spaces, and punctuation pass through untouched. That is why a phone number or a comma in your message survives encoding intact.

A worked example

Encode the word HELLO with a shift of 3:

LetterPosition+3Result
H710K
E47H
L1114O
L1114O
O1417R

So HELLO encrypts to KHOOR. Feed KHOOR back in with the same shift of 3 in Decode mode and you recover HELLO. The Alphabet Shift Map in the tool shows this whole A-to-cipher mapping at a glance, so you can read off any substitution without doing the math by hand.

ROT13: the special case at shift 13

Because 13 is exactly half of 26, shifting by 13 is its own inverse — applying ROT13 twice returns the original text. That makes ROT13 a handy way to lightly obscure spoilers, puzzle answers, or joke punchlines online: there is no separate "decode" step to remember, just run the same operation again. Set the shift slider to 13 and you have a ROT13 encoder and decoder in one.

Breaking it: why this cipher is not secure

The Caesar cipher has only 25 useful keys, so an attacker can simply try them all — that is exactly what the Brute-Force table in this tool does. Type any ciphertext and it lists the decoded output for all 26 shifts simultaneously; the correct one is the row that reads as plain language. With longer messages you do not even need to try every shift, because frequency analysis gives it away: E is the most common letter in English, so whichever ciphertext letter appears most often is probably E, and the gap between it and E reveals the shift. Either way, a computer cracks it in microseconds and a person can do it on paper in under a minute. Never use a Caesar cipher to protect anything that actually matters — for real secrecy you need modern algorithms like AES.

Genuine uses today

  • Learning cryptography. It is the cleanest possible introduction to keys, encoding, decoding, and brute-force attacks before tackling harder ciphers.
  • Puzzles and escape rooms. Caesar-shifted clues are a staple of treasure hunts, cryptic crosswords, and geocaching.
  • Light spoiler hiding. ROT13 keeps a casual reader from accidentally seeing an answer while letting anyone reveal it on demand.
  • Classroom exercises. Mapping out the shift table is a tactile way to teach modular arithmetic.

Common mistakes

  • Confusing encode and decode direction. Encoding with shift 3 and then decoding with shift 23 also works (because 3 + 23 = 26), which surprises people; pick a mode and keep the shift consistent.
  • Expecting numbers to shift. This tool leaves digits and symbols unchanged, so a license plate or a date stays readable in the ciphertext.
  • Treating it as encryption. It is a teaching toy and a puzzle tool — anyone with this very page can break your message instantly.

Everything runs in your browser, so the text you type is never uploaded — though given how trivially a Caesar cipher is broken, secrecy was never the point.

Frequently Asked Questions

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}