HCODX/Caesar Cipher
100% browser-based · Adjustable shift · Case-preserving

Caesar Cipher

Encrypt or decrypt with the Caesar cipher — the simple substitution cipher named after Julius Caesar. Each letter shifts by a fixed amount; non-alphabetic characters pass through. Pick any shift from 1 to 25; ROT13 (shift=13) is its own inverse.

Plain text
Ciphered text
Cipher options
Try ROT13 (shift=13)
Input size
0 B
Output size
0 B
Shift
Status
Ready
Example

Shift each letter by 3

With shift=3, every letter advances three positions in the alphabet. A becomes D, B becomes E, and so on. Non-letters pass through untouched.

Plain text
Hello, World!
Ciphered (shift=3)
Khoor, Zruog!
Use cases

What you'll use this for

The Caesar cipher is no longer a serious cryptosystem, but it remains the go-to introduction to substitution ciphers in classrooms and puzzles.

Education

Teach classical ciphers and the concept of letter substitution — the canonical first cipher.

CTF puzzles

Solve or build capture-the-flag challenges that rely on shift-cipher tricks.

Casual obscuring

Light obscuration for non-secret text — spoiler text, etc.

Historical context

See the cipher Caesar himself used.

Step by step

How to run a Caesar cipher

1

Paste your text

Drop it into the left editor. Letters are shifted; digits, spaces, and punctuation pass through unchanged.

2

Pick shift and direction

Choose a shift between 1 and 25 and whether to encrypt (forward) or decrypt (backward).

3

Click Run cipher

Or leave auto-run on for live updates. Runs locally — no upload.

4

Copy or download

Copy to clipboard or save the result as caesar.txt.

FAQ

Frequently asked questions

No — only 25 possible shifts, trivial to brute-force. Used today only for education, puzzles, and very light text obfuscation.

Pass through unchanged. Only A-Z and a-z are shifted.

Yes.

ROT13 is Caesar with shift=13 — chosen because 13 + 13 = 26, so applying it twice returns the original. See ROT13.

Not automatically. Try all 25 shifts and look for readable English.

About

About the Caesar cipher

The Caesar cipher is one of the oldest known encryption techniques. According to Suetonius, Julius Caesar used a shift of three to protect messages of military significance — substituting each letter of the plaintext with the letter three positions further down the alphabet. The same idea, with any chosen shift, is still called a Caesar cipher today.

Security

By modern standards the Caesar cipher offers essentially no security. There are only 25 useful shifts (a shift of 0 leaves the text untouched), so an attacker can simply try them all — a brute-force attack that takes microseconds on any computer. Frequency analysis on even a short ciphertext will usually reveal the shift instantly because the letter distribution of the plaintext is preserved.

The shift mathematics

  • Label each letter of the alphabet with a number, A=0 through Z=25.
  • To encrypt with shift s: replace each letter x with (x + s) mod 26.
  • To decrypt: replace each letter y with (y − s) mod 26, equivalent to encrypting with shift 26 − s.
  • When s = 13 the operation is self-inverse — that special case is known as ROT13.

Use this tool for learning, puzzles, and very light obfuscation. For anything that actually needs to stay private, reach for a modern cipher such as AES.

Related

Related tools