Search for a tool
Caesar Cipher

Tool for encoding and decoding with the Caesar cipher, a simple and famous shift cipher that replaces each letter with another one further down the alphabet. Compatible with ROT13 and other variants.

Results

Caesar Cipher -

Tag(s) : Substitution Cipher

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Caesar Cipher' tool for free! Thank you!

Caesar Cipher

Caesar Cipher Decoder

 

Test all possible shifts (26-letter alphabet A-Z)

Manual decryption and parameters







See also: ROT Cipher — Shift Cipher

Caesar Encoder

 







See also: ROT Cipher — Roman Numerals — Vigenere Cipher

Answers to Questions (FAQ)

What is the Caesar cipher? (Definition)

The Caesar cipher (or Caesar code) is a monoalphabetic substitution cipher in which each letter is replaced by another letter located a fixed number of positions further along the alphabet.

The shift distance is defined by a number called the shift or offset, which can be to the right (A to B) or to the left (B to A).

For every shift to the right (by +N), there is an equivalent shift to the left (by 26-N), because the alphabet wraps around. The Caesar cipher is therefore sometimes called a rotation cipher.

How to encrypt using the Caesar cipher?

The Caesar cipher is based on an alphabet shift. The most commonly used shift is 3 letters, so that A becomes D.

Plain AlphabetABCDEFGHIJKLMNOPQRSTUVWXYZ
Caesar Alphabet (đź ś3)DEFGHIJKLMNOPQRSTUVWXYZABC

Example: Encrypt DCODEX with a shift of 3. To encrypt D, take the alphabet and look three letters further: the result is G. Therefore, D is encrypted as G. To encrypt X, wrap around the alphabet: after X comes Y, after Y comes Z, and after Z comes A. Therefore, X is encrypted as A. DCODEX is encrypted as GFRGHA.

Another, more mathematical way to encrypt is to encode any letter x using (x+3) mod 26.

Assign the values A=0, B=1, …, Z=25, add a constant (the shift), and take the result modulo 26 (the length of the alphabet) to obtain the encrypted text.

Example: To encrypt D (which has the value 3), add the shift 3: 3+3=6, then find the letter corresponding to 6, namely G. Therefore, D is encrypted as G. To encrypt X=23, calculate 23+3=26, then 26 mod 26 = 0. Since 0=A, X is encrypted as A, etc. DCODEX is encrypted as GFRGHA.

How to decrypt the Caesar cipher?

Decryption with the Caesar cipher replaces each letter with another letter located earlier in the alphabet, according to the shift used.

Example: Decrypt GFRGHA with a shift of 3. To decrypt G, take the alphabet and look three letters before: the result is D. To decrypt A, wrap around the alphabet: before A comes Z, before Z comes Y, and before Y comes X. Therefore, GFRGHA is decrypted as DCODEX.

Another, more mathematical way to decrypt is to assign the values A=0, B=1, …, Z=25, subtract a constant (the shift), and take the result modulo 26 (the length of the alphabet) to obtain the plaintext.

Example: Take G=6, subtract the shift: 6-3=3, then find 3=D. Therefore, G is decrypted as D. For A=0, calculate 0-3=-3, then -3 mod 26 = 23. Since 23=X, A is decrypted as X, etc. GFRGHA is decrypted as DCODEX.

How to recognize Caesar cipher ciphertext?

A message encrypted with the Caesar cipher has the same shift applied to every letter. Its letter-frequency distribution is therefore shifted by the same number of positions.

The index of coincidence is identical to that of the plaintext (as with any monoalphabetic substitution cipher).

References to Caesar, the Roman general and emperor, his contemporaries (Cicero, Brutus, Cleopatra), or more generally to antiquity and the Roman Empire may provide clues.

Keywords such as Julius (Iulius/Ivlivs), Ave, Augustus, or even Caesar salad may also evoke the Roman emperor.

The English pronunciation of Caesar is close to seizure.

How to decipher the Caesar cipher without knowing the shift?

It is possible to decrypt a text encrypted with the Caesar cipher even without knowing the shift used. The main methods are:

— Brute-force attack (trying all possible keys): there are only 25 non-trivial shifts (since a shift of 26 returns the original text). The correct shift can be identified by testing each possibility until a meaningful text is obtained.

— Frequency analysis (identifying the most common letters): languages have characteristic letter frequencies. In English, the letter E is the most common. If another letter appears very frequently in the ciphertext, it may represent a shifted E. Calculating the difference between this letter and E makes it possible to estimate the shift.

Example: If the letter X is the most frequent, this may indicate a shift of 19, since X is 19 positions after E in the alphabet.

— Use dCode, which applies these methods automatically.

Is the Caesar cipher secure?

No, the Caesar cipher is not secure. It is an easy cipher to break. With a 26-letter alphabet, there are only 25 non-trivial keys, making brute-force attacks very easy. dCode can automatically decrypt a message encrypted with the Caesar cipher in less than a second.

What are the variants of the Caesar cipher?

The Caesar cipher is best known for its shift of 3, but all other shifts are possible. Some shifts are known by other cipher names.

Another variant consists of modifying the original alphabet, for example by introducing digits.

A Caesar cipher with a shift of N corresponds to an affine cipher of the form (AĂ—x+B) mod 26, with A=1 and B=N.

Caesar is sometimes written César (in French) or Ceaser (a misspelling).

How to encrypt digits and numbers using the Caesar cipher?

The Caesar cipher applies only to letters in the chosen alphabet. However, there are several ways to handle numbers:

— Write numbers using Roman numerals: numbers then become letters and can be encrypted normally.

Example: Nine becomes IX, which becomes LA with a shift of 3.

— Shift digits using the same shift as the letters.

Example: 9 becomes 2 with a shift of +3 in a decimal alphabet (modulo 10). If digits are treated as numerical values instead, 9 becomes 12.

— Include digits in the alphabet.

Example: With the alphabet ABCDEF123, 21 becomes BA with a shift of 3.

Why is it called the Caesar cipher?

Julius Caesar (Gaius Iulius Caesar) used this technique for some of his correspondence, particularly military communications, as reported by Suetonius. The shift of 3 is traditionally associated with him.

However, other civilizations may also have used this type of cipher independently.

What is the Augustan cipher?

The Augustan cipher is a variant of the Caesar cipher attributed to Emperor Augustus. According to Suetonius (Life of Augustus, 88), each letter is replaced by the next letter in the alphabet: A becomes B, B becomes C, etc. Unlike the standard Caesar cipher, the encryption does not wrap around the alphabet: Z is replaced by AA.

What are other names for the Caesar cipher?

The Caesar cipher is also known as a shift cipher. The shift can be hidden in the name of variants or mnemonic codes, for example:

CD code, C = D, the shift is 1.

Hello (LO) code, L = O, the shift is 3.

Jail (JL) code, J = L, the shift is 2.

Ellen (LN) code, L = N, the shift is 2.

Cutie (QT) code, Q = T, the shift is 3.

Eiffel (FL) code, F = L, the shift is 6.

WC code, W = C, the shift is 6.

Empty (MT) code, M = T, the shift is 7.

Baden Powell (founder of the Scout movement), B = P, the shift is 14.

Any (NE) code, N = E, the shift is 17.

See You (CU) code, C = U, the shift is 18.

I See (IC) code, I = C, the shift is 20.

Easy (EZ) code, E = Z, the shift is 21.

CEASAR (a misspelling of CAESAR), where E = A or A = E, corresponds to a shift of either +22 or +4.

Any two-letter code can represent an association between an encrypted letter and its plaintext equivalent (see gramograms).

ROT13 uses a shift of 13 and is reversible.

ROT5 applies a shift of 5 to digits and is reversible.

ROT47 applies a shift of 47 to printable ASCII characters and is reversible.

More generally, ROT-N denotes a shift of N positions. If N is less than 26, the Latin alphabet can be used; otherwise, a larger or custom alphabet is required.

How to encrypt CAESAR using the Caesar cipher?

The 25 ways to encrypt CAESAR using the Caesar cipher (shifts from 1 to 25): DBFTBS, ECGUCT, FDHVDU, GEIWEV, HFJXFW, IGKYGX, JHLZHY, KIMAIZ, LJNBJA, MKOCKB, NLPDLC, OMQEMD, PNRFNE, QOSGOF, RPTHPG, SQUIQH, TRVJRI, USWKSJ, VTXLTK, WUYMUL, XVZNVM, YWAOWN, ZXBPXO, AYCQYP, BZDRZQ.

How to write the Caesar cipher algorithm in pseudocode?

For N from 1 to Text Length Do

Set C = the Nth character of the Text

If C is a letter in the alphabet Then

Calculate R = the position of C in the alphabet (A=0, B=1, …, Z=25)

Calculate R2 = (R + Shift) Modulo 26

Write the letter at position R2 in the alphabet

Else

Keep C unchanged

End If

End For

When was the Caesar cipher invented?

The cipher was named after Julius Caesar, who was born in 100 BCE. Ancient accounts, notably that of Suetonius, indicate that he used this type of substitution to protect some communications, particularly military messages.

The exact date when the cipher was created and the identity of its actual inventor remain unknown.

Source code

dCode retains ownership of the "Caesar Cipher" source code. Any algorithm for the "Caesar Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Caesar Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Caesar Cipher" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Caesar Cipher" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).

Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).

To cite dCode.fr on another website, use the link: https://www.dcode.fr/caesar-cipher

In a scientific article or book, the recommended bibliographic citation is: Caesar Cipher on dCode.fr [online website], retrieved on 2026-11-02, https://www.dcode.fr/caesar-cipher

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Caesar Cipher' tool for free! Thank you!


https://www.dcode.fr/caesar-cipher
© 2026 dCode — The ultimate collection of tools for games, math, and puzzles.
â–˛  
Feedback