InputsLive
Direction
Shift amount (N)0–25; 13 = ROT13
Plaintext to encryptletters are shifted; digits, spaces and punctuation stay
Brute force — show all 25 shifts
Result
Encrypted output
KHOOR
Each letter moved 3 places forward along the alphabet; 5 letters were shifted.
Shift (N)3
ModeEncrypt
Letters shifted5

The Caesar cipher is for puzzles, ROT13 spoilers and teaching — not security. Never use it for real secrets. Nothing you type is stored or sent; everything runs in your browser.

Results are estimates. Consult a professional.

What it is

What is the Caesar cipher?

The Caesar cipher is the oldest and simplest substitution cipher: it replaces each letter of a message with the letter a fixed number of places further along the alphabet. That fixed number is the key, called the shift. It is named after Julius Caesar, who — according to the Roman historian Suetonius — protected his military correspondence by shifting each letter three places, turning A into D, B into E, and so on. The cipher wraps around the end of the alphabet, so X, Y and Z become A, B and C.

The tool above encrypts and decrypts text with any Caesar shift from 0 to 25, live as you type. Choose a direction, drag the shift slider, and paste your text: the output updates instantly. Letters keep their case (so Hello stays capitalised), and every non-letter — digits, spaces, punctuation — passes through untouched. You can also switch on the brute-force view to see all 25 possible decryptions at once, which is how you crack a Caesar message when you do not know the shift.

A cipher for fun, not for secrets
The Caesar cipher is great for puzzles, classroom demonstrations, and hiding spoilers — but it offers no real security. With only 25 possible keys it can be broken by hand in seconds. The security section below explains why, and what to use instead.
How it works

How the Caesar shift works (mod 26)

Number the alphabet from 0 to 25, so A = 0, B = 1, up to Z = 25. To encrypt a letter at position x with shift N, add N and wrap around using modular arithmetic — "mod 26" means take the remainder after dividing by 26, which is what makes Z roll over to A. To decrypt, subtract N instead.

number the alphabet: A = 0, B = 1, …, Z = 25
encrypt: E(x) = (x + N) mod 26
decrypt: D(x) = (x N) mod 26
non-letters are left unchanged; case is preserved
The Caesar cipher and its shift formula E(x) = (x + n) mod 26 are described in Wikipedia's "Caesar cipher" article, which also documents Suetonius's account of Julius Caesar's shift-of-three usage and the cipher's vulnerability to brute force and frequency analysis.
Using the tool

What the Caesar cipher tool takes

The tool needs three things: your text, a shift amount, and a direction. Set those and the result appears immediately — there is no submit button.

  • Text — the message to transform. Paste plaintext to encrypt, or ciphertext to decrypt. Only A–Z and a–z are shifted; everything else is copied through as-is.
  • Shift amount (N) — a slider from 0 to 25. This is the cipher's key. A shift of 13 is the special ROT13 case described below.
  • Direction — Encrypt adds the shift, Decrypt subtracts it. To read a message someone sent you, set the same shift they used and choose Decrypt.
  • Brute force (optional) — turn this on to list all 25 decryptions at once, for when you have ciphertext but not the key.
Example

Worked example: HELLO with a shift of 3

Encrypting "HELLO" with Caesar's own shift of 3

We will encrypt the word HELLO with a shift of 3 — the exact shift Julius Caesar used — and confirm it against the tool's default result.

Shift each letter forward by three

Move every letter three places along the alphabet: H → K, E → H, L → O, L → O, O → R. None of these reach past Z, so no wrap-around is needed here. The result is KHOOR.

Check it with the formula

Take the H: it is position 7, so E(7) = (7 + 3) mod 26 = 10, which is K. The O is position 14, so E(14) = (14 + 3) mod 26 = 17, which is R. Both agree with the letter-by-letter shift.

HELLO → KHOOR
This is the tool's default: with the text "HELLO", shift 3, and Encrypt selected, the output reads KHOOR. Switch to Decrypt with the same shift and KHOOR turns back into HELLO.
ROT13

ROT13 — the self-inverse shift of 13

ROT13 is the Caesar cipher with a shift of exactly 13. Because the alphabet has 26 letters and 13 is half of 26, shifting forward 13 and shifting back 13 land on the same place: 13 + 13 = 26, which is 0 mod 26. That gives ROT13 a handy property — it is its own inverse. Applying ROT13 to text and then applying it again returns the original, so the same operation both scrambles and unscrambles.

For example, HELLO under ROT13 becomes URYYB, and URYYB under ROT13 becomes HELLO again. Because encrypting and decrypting are identical, ROT13 is widely used online to hide content that should not be read accidentally — spoilers, puzzle answers, and joke punchlines — without truly protecting it. In the tool, setting the shift to 13 produces the same output whether Encrypt or Decrypt is selected.

Same operation both ways
ROT13's self-inverse property is a convenience, not security. It is meant to make text unreadable at a glance, not to keep it secret — anyone can reverse it instantly.
Cracking it

Breaking a Caesar cipher: all 25 shifts

Because a Caesar cipher has only 25 useful keys, you can crack any message without knowing the shift: simply try them all and read the one that makes sense. This is the brute-force attack. To see it, take the KHOOR we produced in the worked example, paste it into the tool, and switch on the brute-force view — it lists every decryption for you. Below is exactly what it shows for KHOOR.

ShiftDecryption of KHOORReadable?
1JGNNQNo
2IFMMPNo
3HELLOYes — this is the plaintext
4GDKKNNo
5FCJJMNo
… (shifts 6–25 continue)No

Brute-force decryption of KHOOR. Only shift 3 produces a real word, so the original shift was 3. The tool lists all 25 rows; the first five are shown here.

For longer messages you do not even need to read each line — frequency analysis spots the right shift automatically by matching the most common ciphertext letter to E, the most common letter in English. Either way, a Caesar cipher falls in moments.

Use cases

What the Caesar cipher is good for

The Caesar cipher survives today not as a security tool but as a teaching and convenience tool. Its simplicity is exactly the point.

  • Puzzles and games — escape rooms, treasure hunts, cryptograms and geocaching clues use Caesar shifts because they are solvable with pencil and paper.
  • Hiding spoilers (ROT13) — forums and review sites scramble plot twists and puzzle answers with ROT13 so readers reveal them only on purpose.
  • Teaching cryptography — it is the standard first example for modular arithmetic, keys, encryption versus decryption, and why short key spaces fail.
  • Light obfuscation — making a string non-obvious at a glance, where the goal is to deter casual reading rather than to keep a secret.
Security

Why the Caesar cipher is not secure

This is the most important section on the page. The Caesar cipher must never be used to protect anything that actually needs to stay secret. It was breakable in Caesar's own time and is trivially breakable now.

  • The key space is tiny. There are only 25 non-trivial shifts, so an attacker can try every one in seconds — exactly what the brute-force view above demonstrates.
  • Frequency analysis breaks it instantly. The cipher does not hide letter patterns, so matching the commonest ciphertext letter to E reveals the shift even for long messages.
  • The same letter always maps the same way. Every E becomes the same ciphertext letter, leaking the structure of the message.
Never use it for real secrets
For anything that genuinely needs protection — passwords, personal data, private messages — use a modern, peer-reviewed algorithm such as AES, applied through a trusted library. The Caesar cipher is for learning and play only.
Wikipedia notes that the Caesar cipher "can be easily broken even in a ciphertext-only scenario," whether by brute-forcing the 25 keys or by frequency analysis, and that it offers "essentially no communications security" in modern use.
Privacy

Does this tool send my text anywhere?

No. The encryption and decryption run entirely in your browser with plain arithmetic. The text you type is never stored, logged, or sent to any server — there is no network request, because none is needed. The math is exact and self-contained, so the tool gives the same answer as any correct Caesar implementation and works the same offline.

Remember, though, that running text through this tool does not make it private — the Caesar cipher offers no real protection. Keeping the computation on your device protects your input here; it does not make the cipher's output safe to share as if it were encrypted.

Questions

Frequently asked questions about the free Caesar cipher

A caesar cipher calculator is a free online tool that helps you encrypt or decrypt text with a Caesar shift cipher (0–25), including ROT13, and brute-force all 25 shifts to crack a message. A Caesar cipher shifts each letter a fixed number of places N (0–25) along the alphabet, wrapping Z → A. Number the alphabet A=0…Z=25; encrypting adds N, decrypting subtracts it, both modulo 26. Case is preserved and non-letters pass through unchanged. ROT13 is the special case N=13, which is its own inverse. It runs entirely in your browser with instant results and no sign-up.
It is the simplest substitution cipher: each letter is replaced by the letter a fixed number of places further along the alphabet, wrapping Z back to A. It is named for Julius Caesar, who shifted letters three places to protect his correspondence. The fixed number is the key, called the shift.
If you know the shift, set the same number, choose Decrypt, and paste the ciphertext — decrypting subtracts the shift instead of adding it. If you do not know the shift, turn on the brute-force view to see all 25 decryptions and read the one that forms real words.
ROT13 is the Caesar cipher with a shift of 13. Because 13 is half of 26, shifting forward 13 and back 13 land in the same place, so ROT13 is its own inverse: applying it twice returns the original text. That makes it popular for hiding spoilers, since the same operation both scrambles and unscrambles.
No. With only 25 possible keys it is broken in seconds by trying every shift (brute force) or by frequency analysis, which matches the commonest ciphertext letter to E. Never use it to protect real secrets — use a modern algorithm such as AES through a trusted library. The Caesar cipher is for puzzles, ROT13 spoilers, and teaching only.
Yes. The encryption and decryption run entirely in your browser with plain arithmetic — your text is never stored, logged, or sent to any server, and the tool works offline. Note that running text through a Caesar cipher does not make it secure; keeping the computation local protects your input here, but the cipher's output is not safe to treat as encrypted.
About

About this Caesar cipher tool

This Caesar cipher tool runs entirely in your browser — the text you type is never stored, logged, or sent to any server, and it works the same offline. It shifts each letter along the alphabet using modular arithmetic, preserves case, and leaves digits, spaces, and punctuation unchanged. Remember it is for puzzles, ROT13 spoilers, and teaching — not real security.

Looking for more developer utilities? Browse the rest of our dev tools, or see the full library on the all calculators page.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.