Caesar Cipher Converter

Shift every letter by a fixed number to encrypt or decrypt a message.

Technology and NetUpdated 2026-11-192 min read
Caesar Cipher Converter
Up to 200 characters. Spaces and punctuation are kept unchanged.
A whole number from minus 25 to 25. A shift of 3 is the classic Caesar key.
Converted message
...
Shift used...
Operation...
Letters shifted...

What it does

The Caesar cipher, also called a shift cipher, replaces every letter with one a fixed number of positions away in the alphabet. It is named after Julius Caesar, who reportedly used a shift of three for private messages.

This tool encrypts or decrypts a message with any shift from minus 25 to 25. Spaces, digits and punctuation pass through unchanged, and uppercase and lowercase letters keep their case.

The page opens with the message ATTACK AT DAWN and a shift of three. Encryption gives DWWDFN DW GDZQ, and decryption reverses the process.

Mathematically, letters are mapped to the numbers 0 through 25. Encryption adds the key and takes the result modulo 26. Decryption subtracts the key, again modulo 26.

The cipher offers no real security today because there are only 26 possible keys. Trying each one and looking for readable text breaks it almost instantly, which makes it useful mainly for teaching the idea of a key.

How to use

  1. Type the message to convert.
  2. Enter the shift as a whole number.
  3. Choose encrypt or decrypt.
  4. Read the converted message as the main result.
  5. Check the letter count to confirm how many characters moved.
  6. Decrypt the result with the same key to recover the original message.

Formula

Encrypt: c = (p + k) mod 26. Decrypt: p = (c - k + 26) mod 26, where A is 0 and Z is 25
p
Plaintext letter position from 0 to 25.
k
The shift key, a whole number from minus 25 to 25.
c
Ciphertext letter position from 0 to 25.

Only the value of the key modulo 26 matters, so a shift of 27 behaves like 1 and a shift of minus 1 behaves like 25. The tool keeps non letter characters unchanged and applies the modulo operation separately to uppercase and lowercase ranges.

Worked example

Example: ATTACK AT DAWN with shift 3

The page opens with the message ATTACK AT DAWN and a shift of 3 in encrypt mode.

  1. A moves three places to D.
  2. T moves three places to W, and the second T does the same.
  3. A becomes D, C becomes F and K becomes N.
  4. Spaces are left untouched, so ATTACK AT DAWN becomes DWWDFN DW GDZQ.
  5. Use decrypt mode with the same shift to recover ATTACK AT DAWN.
  6. The tool reports result DWWDFN DW GDZQ and letters shifted 12.

Reference table

Sample Caesar cipher conversions
InputShiftOperationOutput
ATTACK AT DAWN3EncryptDWWDFN DW GDZQ
KHOOR ZRUOG3DecryptHELLO WORLD
HELLO WORLD1EncryptIFMMP XPSME

Limits

  • Messages are limited to 200 characters.
  • Shifts must be whole numbers from minus 25 to 25.
  • Only Latin letters are shifted; other characters pass through.
  • This is a teaching cipher and offers no real security.

Common mistakes

  • Adding the shift when decrypting instead of subtracting it.
  • Forgetting that Z wraps back to A.
  • Shifting spaces and punctuation along with letters.
  • Assuming a shift of 26 changes the message.
  • Treating the cipher as secure because the message looks scrambled.

Try it yourself

Quick checks. Answers sit tucked under each question.

Encrypt HELLO WORLD with shift 1.

IFMMP XPSME.

Decrypt KHOOR ZRUOG with shift 3.

HELLO WORLD.

What does a shift of 26 do?

Nothing. Only the shift modulo 26 matters, and 26 modulo 26 is zero.

Questions

What is a Caesar cipher?

A substitution cipher that shifts every letter by a fixed number of places.

Why is it called that?

It is named after Julius Caesar, who used a shift of three.

How do I decrypt?

Shift each letter backward by the same key, or use decrypt mode in this tool.

Is ROT13 related?

Yes. ROT13 is a Caesar cipher with a shift of 13.

Is it secure?

No. There are only 26 keys and a brute force search is trivial.

Does punctuation change?

No. Only letters are shifted, so spaces and symbols stay as they are.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.