Caesar Cipher

Slide every letter along the alphabet by a number you choose.

Cipher text

How it works

The Caesar cipher replaces each letter with the one a fixed number of places further along the alphabet. With a shift of 3, A becomes D, B becomes E, and at the end the alphabet wraps round, so X becomes A. To decode, shift the same distance back.

It is named after Julius Caesar. The Roman writer Suetonius records that he wrote to his generals with a shift of three. In an age when few people could read at all, that was enough.

It is also known as a shift cipher, and it is the starting point for nearly every lesson on codes, because it shows the two parts every cipher has: a method, which is shifting, and a key, which is the number.

The weakness is the size of the key. There are only 25 possible shifts, so anyone can try them all in a minute. If you do not know the shift, the Caesar decoder on this site lists every option at once.

Numbers, spaces and punctuation pass through unchanged, and capital letters stay capital.

Worked example

With a shift of 3, HELLO becomes KHOOR. H moves three places to K, E to H, L to O, and O to R.

Caesar cipher alphabet, shift 3

PlainABCDEFGHIJKLM
CipherDEFGHIJKLMNOP
PlainNOPQRSTUVWXYZ
CipherQRSTUVWXYZABC

Common questions

What shift did Julius Caesar use?

Three places, according to Suetonius. His nephew Augustus is said to have used a shift of one.

Is a Caesar cipher with shift 13 the same as ROT13?

Yes. Thirteen is half of 26, so doing it twice brings you back to the start. That makes the same step both encode and decode.

How secure is the Caesar cipher?

Not at all by modern standards. With only 25 keys it can be broken by hand in minutes. It is for learning and for puzzles.

Related tools