Caesar Cipher Encoder & Decoder (ROT13)

Encrypt and decrypt messages with the Caesar cipher or ROT13 — right in your browser.

How to use

  1. Type or paste your message, then choose a shift between 1 and 25 — or click "ROT13" for the classic 13-letter rotation.
  2. Click "Encrypt" to shift every letter forward in the alphabet, or "Decrypt" to shift it back and reveal the original message.
  3. Copy or download the result. Everything runs in your browser — your text never leaves your device.

About this tool

The Caesar cipher is one of the oldest known encryption techniques, named after Julius Caesar, who reportedly used a three-letter shift to protect military correspondence. The idea is disarmingly simple: every letter in the message is replaced by the letter a fixed number of positions further down the alphabet, wrapping around at the end — with a shift of 3, A becomes D, B becomes E and Z becomes C. ROT13 is the special case with a shift of 13: because the Latin alphabet has 26 letters, applying ROT13 twice restores the original text, which made it a favorite on early internet forums for hiding spoilers and puzzle answers.

This tool implements the cipher exactly as the textbooks describe it. Each letter from A to Z is shifted by the amount you choose, uppercase and lowercase are preserved, and numbers, punctuation and spaces pass through untouched. Decryption simply applies the inverse shift. Accented characters have no place in the classic 26-letter alphabet, so by default the tool strips accents before ciphering (é becomes e); untick the option and they will pass through unchanged instead. The whole transformation happens in plain JavaScript on your device.

Today the Caesar cipher is an educational tool, not a security tool. With only 25 possible shifts, anyone can break it in seconds by brute force, and letter-frequency analysis cracks it even faster — which is precisely why it is such a good introduction to cryptography. Use it to teach kids how encryption works, to build treasure hunts and escape-room puzzles, to decode ROT13 spoilers, or to solve geocaching mystery caches. For anything that actually needs to stay secret, use real cryptography such as AES or TLS.

The formula

Encryption: E(x) = (x + n) mod 26, where x is the letter position (A=0..Z=25) and n is the shift. Decryption: D(x) = (x − n) mod 26. ROT13 is the case n = 13, where encryption and decryption are the same operation.

Frequently asked questions

What is the difference between the Caesar cipher and ROT13?

ROT13 is a Caesar cipher with the shift fixed at 13. Since the alphabet has 26 letters, encrypting twice with ROT13 returns the original text — the same button encodes and decodes.

Is the Caesar cipher secure?

No. There are only 25 possible shifts, so trying them all takes seconds, and frequency analysis breaks it instantly. It is great for learning and games, never for protecting real secrets.

How do I decrypt a message without knowing the shift?

Try every shift from 1 to 25 and look for readable text. Paste the message, click "Decrypt" and change the shift number until words appear — with only 25 options it rarely takes more than a minute.

What happens to numbers, punctuation and accents?

Numbers and punctuation are never changed — only letters A to Z are shifted. Accented letters are converted to their plain form first (é → e) by default; disable "Remove accents first" to keep them untouched.

Does my text leave my browser?

No. Encryption and decryption run 100% in JavaScript on your device. Nothing is sent to any server, transmitted or stored.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.