DevTools Logo

Caesar Cipher Tool

Caesar Cipher Tool

Encrypt, decrypt and brute-force Caesar shifts with English-frequency ranking. ROT13 included.

Runs in your browser
3
Try an example

Text

Result

Paste text to shift it

Use Khoor Zruog with shift 3 to see 'Hello World'.

The Caesar tool shifts A–Z letters by any amount from 0 to 25 while preserving case and passing other characters through. Decrypt mode applies the inverse shift, and the ROT13 button applies the classic symmetric shift 13. For unknown ciphertext, the brute-force panel decrypts at all 25 non-trivial shifts and ranks them with a chi-squared score against standard English letter frequencies; candidates shorter than 12 letters are marked 'insufficient data'. Clicking a ranked row applies that shift. This is a teaching toy, not encryption for real secrets.

Classic homework cipher

Khoor Zruog

Decode with shift 3 to get 'Hello World'. Encrypt mode with the same shift performs the inverse transform.

Unknown shift

Wkh txlfn eurzq ira mxpsv ryhu wkh od cb jrre

The brute-force panel ranks shift 3 first because its decrypted letters match English monogram frequencies best.

ROT13 spoiler

Uryyb Jbeyq

The ROT13 button applies shift 13; pressing it again on the output restores the original text.

    Examples

    Known shift

    Input
    Khoor Zruog · decrypt · shift 3
    Output
    Hello World

    Each letter is moved back three positions, case and spaces are preserved.

    ROT13

    Input
    Uryyb Jbeyq
    Output
    Hello World

    ROT13 is a Caesar shift of 13 and is its own inverse.

    About this tool

    The Caesar Cipher Tool encrypts and decrypts text by shifting A–Z letters a fixed number of positions, wrapping around the alphabet. Choose any shift from 0 to 25, switch between encrypt and decrypt, preserve or strip non-letters, and use the one-click ROT13 shortcut for spoiler text.

    For ciphertext with an unknown shift, the brute-force panel decrypts at every non-trivial shift and ranks the results with a chi-squared score against standard English letter frequencies. Shorter candidates are explicitly marked as insufficient data. The tool is a teaching and puzzle aid — a Caesar shift offers no real security.

    What this tool does not do

    • Only the 26 Latin letters are transformed; other scripts pass through unchanged.
    • Frequency ranking assumes English plaintext and can misrank short or unusual texts.
    • The brute-force view shows the top eight candidates, not all 25, to keep the panel readable.
    • No input is stored, but share links (if used elsewhere) contain the plaintext — never treat them as secret.

    How to use this tool

    1. Paste text

      Enter ciphertext for decoding or plaintext for encoding; letters, spaces and punctuation are handled as you choose.

    2. Pick a shift

      Drag the shift slider (0–25) or press the ROT13 button; the result updates instantly.

    3. Solve unknown shifts

      Scroll to the ranked brute-force table and click the most plausible candidate to apply it.

    4. Copy

      Copy or download the decoded text.

    Use cases

    Homework and puzzles

    Decode classroom ciphertext or CTF challenge strings quickly.

    Spoiler concealment

    Use ROT13 to hide plot points or answers behind a reversible transform.

    Teaching frequency analysis

    Show students how letter distributions reveal the likely shift.

    Brute-force confidence

    Score (χ²)Badge
    < 40likely
    40–90possible
    > 90unlikely
    nullinsufficient data

    Chi-squared compares observed letter counts with expected English monogram frequencies; lower is better.

    Common mistakes

    Mistake:Using a Caesar cipher for secrets.

    Fix:There are only 26 possible shifts; this tool is for education and puzzles, never passwords or confidential data.

    Mistake:Expecting accented letters to shift.

    Fix:Only A–Z and a–z are shifted; é, ü and non-Latin scripts pass through unchanged with a notice.

    Mistake:Trusting scores for tiny inputs.

    Fix:Candidates with fewer than 12 letters are marked insufficient data instead of being ranked confidently.

    Frequently asked questions

    How do I decode a Caesar cipher without knowing the shift?

    Paste the ciphertext and look at the brute-force panel. It decrypts at all 25 non-trivial shifts and ranks them by chi-squared similarity to English letter frequencies. Click a row to apply that shift to the main output.

    What shift is ROT13?

    ROT13 is a Caesar shift of 13. Because 13 + 13 = 26, applying it twice returns the original text, which makes it convenient for hiding spoilers without a separate decode step.

    Are spaces and punctuation encrypted?

    No. By default only A–Z and a–z letters are shifted; spaces, digits and punctuation pass through unchanged. Turn on 'Strip non-letters' if you need a pure letter stream.

    How does frequency analysis find the shift?

    The scorer counts each letter, computes the expected counts from standard English monogram frequencies and sums (observed − expected)² / expected. The smallest chi-squared value is the best candidate. Inputs with fewer than 12 letters are marked 'insufficient data'.

    Is a Caesar cipher secure?

    No. There are only 26 possible shifts, so a Caesar cipher can be broken instantly by brute force. Use it for homework, puzzles and spoilers only — never for passwords or confidential information.

    References & standards