Caesar Cipher Encoder & Decoder

Shift every letter by a fixed amount to encode, shift back to decode — or let CodeCipher crack an unknown shift for you.

Cipher text shift 3
Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj

ABCDEFGHIJKLMNOPQRSTUVWXYZDEFGHIJKLMNOPQRSTUVWXYZABC

Turn the cipher wheel

The outer ring is the plain alphabet; the inner ring is the cipher alphabet. Drag the inner ring (or focus it and use the arrow keys) to set the shift. Read a plain letter on the outside and its cipher letter directly inside it.

With shift 3, A → D, H → K, Z → C. Every position is moved the same distance, which is exactly why the cipher is weak: learn one letter pair and you know the whole key.

ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZshift3

All 25 shifts, most English-like first

Ranked with a chi-squared test against standard English letter frequencies. The right answer is usually first for any sentence longer than a few words.

ShiftDecoded text
6Nby kocwe vliqh zir dogjm ipyl nby futs xia
12Hvs eiwqy pfckb tcl xiadg cjsf hvs zonm rcu
16Dro aesmu lbygx pyh tewzc yfob dro vkji nyq
2Rfc osgai zpmul dmv hsknq mtcp rfc jyxw bme
13Gur dhvpx oebja sbk whzcf bire gur ynml qbt
25Uif rvjdl cspxo gpy kvnqt pwfs uif mbaz eph
9Kyv hlztb sifne wfo aldgj fmvi kyv crqp ufx
19Aol xbpjr iyvdu mve qbtwz vcly aol shgf kvn
11Iwt fjxrz qgdlc udm yjbeh dktg iwt apon sdv
22Xli uymgo fvsar jsb nyqtw sziv xli pedc hsk
23Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj
1Sgd pthbj aqnvm enw itlor nudq sgd kzyx cnf
3Qeb nrfzh yoltk clu grjmp lsbo qeb ixwv ald
10Jxu gkysa rhemd ven zkcfi eluh jxu bqpo tew
4Pda mqeyg xnksj bkt fqilo kran pda hwvu zkc
18Bpm ycqks jzwev nwf rcuxa wdmz bpm tihg lwo
7Max jnbvd ukhpg yhq cnfil hoxk max etsr whz
8Lzw imauc tjgof xgp bmehk gnwj lzw dsrq vgy
20Znk waoiq hxuct lud pasvy ubkx znk rgfe jum
14Ftq cguow ndaiz raj vgybe ahqd ftq xmlk pas
21Ymj vznhp gwtbs ktc ozrux tajw ymj qfed itl
17Cqn zdrlt kaxfw oxg sdvyb xena cqn ujih mxp
24Vjg swkem dtqyp hqz lworu qxgt vjg ncba fqi
5Ocz lpdxf wmjri ajs ephkn jqzm ocz gvut yjb
15Esp bftnv mczhy qzi ufxad zgpc esp wlkj ozr

Breaking it with letter frequency

In ordinary English, E is the most common letter (about 12.7%), followed by T, A and O. A Caesar shift moves those peaks but keeps their pattern. Count the letters in the cipher text, find the tallest peak, and the distance from it to E is probably the key. This is the same frequency analysis the 9th-century scholar al-Kindi described, the earliest known written account of codebreaking.

A Vigenère cipher defeats simple frequency analysis by using several Caesar shifts in rotation. ROT13 and Atbash are two other fixed substitutions worth knowing.

Questions people ask

How does the Caesar cipher work?

Every letter is replaced by the letter a fixed number of places further along the alphabet, wrapping from Z back to A. With a shift of 3, A becomes D, B becomes E and Z becomes C. Decoding shifts the same number of places back.

How do I decode a Caesar cipher without the key?

There are only 25 possible shifts, so try them all. The brute-force list on this page shows every shift and ranks them by how closely their letter frequencies match English, so the real message is usually at the top.

Did Julius Caesar really use it?

Yes. The Roman historian Suetonius wrote, in The Lives of the Caesars, that Julius Caesar wrote confidential letters by replacing each letter with the one three places later, and that Augustus used a shift of one.

Is the Caesar cipher secure?

Not at all. With only 25 keys it can be broken by hand in minutes and by computer instantly. It is useful for puzzles, geocaching and teaching the ideas behind cryptography, never for protecting real information.

What is the difference between Caesar and ROT13?

ROT13 is simply a Caesar cipher with a shift of 13. Because 13 is half of 26, applying it twice gets you back to the original, so the same operation both encodes and decodes.

Related tools