StatGardenREF. DESK
Calculators/Everyday/Caesar Cipher Calculator
Everyday

Caesar Cipher Calculator calculator

Encodes or decodes text with a Caesar shift cipher, or tries all 25 shifts when the shift is unknown.

Published 21 August 2026

What this calculator does

A Caesar cipher decoder shifts every letter of a piece of text a fixed number of places through the alphabet, wrapping from Z back to A when it runs past the end. It is one of the oldest ciphers on record, reportedly used by Julius Caesar himself for military messages, and it survives today mainly as an introduction to cryptography.

This calculator handles all three directions: encoding text with a chosen shift, decoding text when the shift is already known, and brute-forcing all 25 possible shifts when it is not, so the correct one can be spotted by eye from the resulting table.

The formula

FormulaEncoded letter = (letter position + shift) mod 26; each letter shifted the same fixed number of places

Each letter is converted to its position in the alphabet, the shift amount is added (for encoding) or subtracted (for decoding), and the result wraps back into the 26-letter range before being converted back to a letter. Anything that is not a letter, such as spaces, numbers and punctuation, is left unchanged.

TermMeaning
ShiftThe fixed number of alphabet positions each letter moves, also called the key.
EncodeShifting plain text forward by the chosen amount to produce ciphertext.
DecodeShifting ciphertext back by the same amount to recover the original plain text.
Brute forceTrying every one of the 25 possible non-zero shifts and displaying each result, for when the shift used to encode a message is unknown.

The inputs explained

FieldWhat to enter
TextThe text to encode or decode. Letters are shifted; everything else passes through unchanged.
Shift amountThe number of alphabet positions to shift by. Ignored in brute-force mode, where every shift from 1 to 25 is tried.
ModeEncode to create ciphertext, decode if the shift is already known, or brute force to try every shift at once.

When to use it

Solving a puzzle or classroom cryptography exercise

Caesar ciphers are a standard teaching example precisely because they are simple enough to break by hand; entering ciphertext in brute-force mode shows every possible decoding at once.

Checking a message encoded with a known shift

If the shift used is already known, decode mode recovers the original text directly without needing to try every option.

Demonstrating why the cipher is weak

With only 25 possible shifts, a brute-force table makes it obvious how quickly a Caesar cipher can be broken without knowing the key in advance, which is the usual point of introducing it.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the encoded text changes with the shift amount

The same message encoded with a range of shift values.

Encoding "Hello World" at different shifts
Shift amountEncoded text
1Ifmmp Xpsme
3Khoor Zruog
5Mjqqt Btwqi
13Uryyb Jbeyq
20Byffi Qilfx
25Gdkkn Vnqkc
A shift of 13 is the special case known as ROT13, where encoding and decoding use exactly the same operation, since shifting forward 13 places is identical to shifting back 13 places in a 26-letter alphabet.

Questions

What shift did Julius Caesar reportedly use?

Historical accounts credit Caesar with a shift of 3, encoding A as D, B as E and so on, which is why 3 is the default shift on this calculator.

Is a Caesar cipher secure?

No. With only 25 possible non-zero shifts, it can be broken almost instantly by trying every one, which the brute-force mode above demonstrates directly. It has no practical security value beyond puzzles and teaching.

What is ROT13?

ROT13 is a Caesar cipher with a fixed shift of exactly 13. Because the alphabet has 26 letters, applying the same ROT13 operation twice returns the original text, which made it a popular simple way to hide spoilers or punchlines in early online forums.

Does capitalisation and punctuation survive encoding?

Yes. Letters keep their original case through the shift, and anything that is not a letter, such as spaces, numbers and punctuation, is left exactly as typed.

For Unicode text styling rather than letter substitution, see the bold text generator, which also offers an italic style using the same "type text, get transformed text" pattern.