Caesar Cipher Tool

Simple Caesar ciphering for study, puzzles, and practice. Choose shift, direction, and symbol handling easily. See results, copy output, and download reports quickly here.

Calculator

Encrypt or decrypt with a shift, plus export options.
Maths
Select a mode.
Enter a shift from 0 to 25.
Presets only change the shift value.
Please enter text.
Keep lowercase letters lowercase in output.
If off, non-letters are removed.
Remove leading and trailing whitespace.
Useful for quick analysis and recovery.

Example data table

Mode Shift Input Output
Encrypt 3 HELLO WORLD KHOOR ZRUOG
Decrypt 3 KHOOR ZRUOG HELLO WORLD
Encrypt 13 Attack at dawn! Nggnpx ng qnja!
Tip: Enable “Show all shifts” when you don’t know the shift.

Formula used

Caesar shifting moves each letter by a fixed offset in the alphabet. Letters wrap around using modular arithmetic.

How to use this calculator

  1. Pick Encrypt or Decrypt.
  2. Choose a shift from 0 to 25 (or use a preset).
  3. Paste your text, then set case and symbol handling.
  4. Press Submit to show results above the form.
  5. Use Copy, CSV, or PDF to export.
  6. Turn on Show all shifts to test every shift quickly.

Shift arithmetic and modular wrap

The tool maps each letter to an index from 0 to 25 and applies a constant offset. With 26 symbols, every shift behaves predictably: adding k then applying mod 26 keeps the result inside the alphabet. A shift of 0 returns the original message, while 25 is equivalent to shifting back by 1.

Direction control for encryption and decryption

Encryption uses forward rotation E(x)=(x+k) mod 26. Decryption reverses it with D(x)=(x−k) mod 26, which is identical to adding (26−k). This symmetry means the same engine can handle both directions reliably, even when the shift is near the boundaries.

Case and symbol handling rules

Letter casing is treated as a formatting choice rather than a mathematical one. When “Preserve case” is enabled, uppercase and lowercase letters are shifted within their own ranges. Symbols, digits, and whitespace can be kept for readability or removed to focus analysis on letters only, which is useful for frequency comparisons.

Frequency chart for quick diagnostics

The A–Z bar chart compares letter counts in the original text and the transformed output. A Caesar shift preserves the overall distribution shape but shifts which letters carry the peaks. For longer texts, recurring patterns such as common vowels can be spotted quickly, supporting shift guessing when the key is unknown. For short samples, the chart can look noisy, so longer text stabilizes counts. When symbols are removed, the plotted totals match the letter-count badges, which helps verify that only letters were transformed and nothing was lost unexpectedly.

All-shifts table for recovery and verification

When the shift is not provided, evaluating all 26 possibilities is feasible. The tool produces outputs for shifts 0 through 25 in a searchable table. This approach is deterministic and fast, and it helps confirm the correct key by visually locating a readable sentence or recognizable words.

Exports for reporting and classroom use

CSV export stores timestamp, mode, shift, input, and output in a single row, which supports logging and comparison across experiments. PDF export creates a print-ready summary with input, output, and formula notes. These files are helpful when documenting exercises, puzzles, or demonstrations of modular arithmetic in practice. These exports also support quick peer review sessions.

FAQs

1) What shift values are valid?

Shifts range from 0 to 25 because the Latin alphabet has 26 letters. Any larger number repeats cyclically, so 29 behaves like 3.

2) Does this work for numbers and punctuation?

Numbers and punctuation are not shifted. You can keep them for readability, or remove them to analyze only letters.

3) Why does ROT13 have a special preset?

ROT13 uses shift 13, exactly half of 26. Encrypting twice returns the original text, making it popular for simple obfuscation.

4) How can I recover text if I don’t know the shift?

Enable “Show all shifts” to generate every possible output. Then scan for a readable sentence or recognizable words.

5) Why do the frequency bars look similar after shifting?

A Caesar shift rearranges letters but preserves counts. Peaks move to different letters, while the overall distribution shape remains comparable.

6) Is this cipher secure for protecting sensitive data?

No. With only 26 keys, it can be broken quickly. Use modern cryptography for confidentiality and keep Caesar cipher for learning and puzzles.

Related Calculators

url decode tool

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.