UTILS.
100% in-browser
🔤

Caesar Cipher Encoder / Decoder

Encode or decode text with a variable-shift Caesar cipher, and brute-force all 26 shifts at once with an automatic best-guess to crack unknown keys.

— output appears here —

About this tool

The Caesar Cipher Encoder / Decoder is a free, in-browser tool for the oldest and most famous substitution cipher. Each letter is shifted a fixed number of places along the alphabet: encoding maps a letter at position x to (x + shift) mod 26, and decoding reverses it with (x − shift + 26) mod 26. Upper- and lower-case bands are shifted independently and any non-letter — spaces, digits, punctuation — passes through unchanged. A shift of 3 is the shift Julius Caesar himself is said to have used; a shift of 13 is the self-inverse ROT13.

Everything runs locally in your browser, so nothing you type is uploaded or stored. Pick encode or decode and set a shift from 0 to 25, or switch to brute-force mode to see all 26 possible decryptions at once. Because there are only 25 non-trivial keys, a Caesar cipher is trivially breakable by trying them all — which is exactly what brute-force mode does.

To save you scanning, brute-force mode scores each candidate with a chi-square test against standard English letter frequencies and marks the most likely plaintext with a star (★). The lower the chi-square value, the closer the letter distribution matches ordinary English, so the starred row is usually the correct decryption. This makes the tool handy for CTF challenges, escape rooms, and classroom cryptography without needing to know the key in advance.

Frequently asked questions

What is the Caesar cipher formula?
Encoding is E(x) = (x + shift) mod 26 and decoding is D(y) = (y − shift + 26) mod 26, where each letter is numbered 0–25. A shift of 3 turns A into D; a shift of 13 is ROT13, which is its own inverse.
How does brute-force mode crack it?
It prints all 26 possible shifts of your text at once. Since there are only 25 real keys, one row is always the plaintext. The tool also flags the most English-looking row with a star using a letter-frequency chi-square score.
Are spaces and punctuation kept?
Yes. Only A–Z and a–z are shifted, each within its own case. Spaces, numbers, and punctuation are passed through unchanged, so the shape of your message is preserved.
What is ROT13?
ROT13 is a Caesar cipher with a shift of 13. Because 13 is exactly half of 26, applying it twice returns the original text, so the same operation both encodes and decodes. Set the shift to 13 to use it.

More tools