Home / Caesar cipher and ROT13 explained

Caesar cipher and ROT13 explained

Updated December 3, 2026

Two of the simplest ciphers there are. Learn how they work and why neither one keeps a secret.

Encoding, not encryption. These tools convert between ways of writing the same information. They are not secure encryption, so do not rely on them to protect anything private. Everything runs in your browser, and what you type is not sent anywhere.

The Caesar cipher

The Caesar cipher is named for Julius Caesar who, according to the Roman historian Suetonius, used it with a shift of three (A becoming D when encrypting, and vice versa when decrypting) to protect messages of military significance. Each letter moves a fixed number of places along the alphabet, and the alphabet wraps round after Z.

The alphabet shifted by 3 and by 13
PlainShift 3Shift 13PlainShift 3Shift 13
ADNNQA
BEOORB
CFPPSC
DGQQTD
EHRRUE
FISSVF
GJTTWG
HKUUXH
ILVVYI
JMWWZJ
KNXXAK
LOYYBL
MPZZCM

With a shift of 3, HELLO becomes KHOOR: H→K, E→H, L→O, L→O, O→R.

Cracking it

The Caesar cipher can be broken easily even with only the coded text. Since there are only a limited number of possible shifts (25 in English), you can try each one, and the correct decryption is the one which makes sense in the language of the message. Here is KHOOR decoded with every shift:

All 26 shifts of KHOOR
ShiftKHOOR read with this shiftShiftKHOOR read with this shift
0KHOOR13XUBBE
1JGNNQ14WTAAD
2IFMMP15VSZZC
3HELLO16URYYB
4GDKKN17TQXXA
5FCJJM18SPWWZ
6EBIIL19ROVVY
7DAHHK20QNUUX
8CZGGJ21PMTTW
9BYFFI22OLSSV
10AXEEH23NKRRU
11ZWDDG24MJQQT
12YVCCF25LIPPS

Only the row for shift 3 reads as a word. The Caesar cipher tool shows this table for any text you paste.

ROT13

ROT13 is the Caesar cipher with a shift of 13. Because there are 26 letters and 26 = 2 × 13, ROT13 is its own inverse: two successive applications restore the original text. The shift-13 column of the alphabet table above is ROT13. Here are three examples:

ROT13 examples
TextAfter ROT13
Hello, World!Uryyb, Jbeyq!
ABJNMNOWAZ
Uryyb, Jbeyq!Hello, World!

ROT13 is not intended to be used where secrecy is of any concern, since a constant shift means the encryption effectively has no key. It is mostly used to hide text from a casual glance. The ROT13 tool does it in either direction.

Worked examples

Caesar cipher examples
TextShiftResult
HELLO3KHOOR
HELLO13URYYB
Attack at dawn5Fyyfhp fy ifbs