RDRepDex AI
Text Tools

Caesar Cipher Solver

Encode and decode Caesar ciphers.

Free · Runs in your browser · Nothing is uploaded

Paste some cipher text and every shift will be ranked by how much it looks like English.

Paste enciphered text and this Caesar cipher solver tries all twenty-six possible shifts at once, then ranks them by how much each result looks like English. You do not need to know the key, because with only twenty-six options there is no need to be clever — the entire keyspace fits on one screen. There is also an encode mode with a shift slider if you want to go the other way. Everything happens in your browser.

Why brute force is the correct approach here

A Caesar cipher shifts every letter forward through the alphabet by a fixed amount. Shift by three and A becomes D, B becomes E, and Z wraps around to C. The key is that single number, which means there are exactly twenty-five useful keys — twenty-six if you count a shift of zero, which leaves the message unchanged.

Twenty-five possibilities is nothing. A person can check them by hand in a few minutes; a computer does it faster than you can release the key. This is what cryptographers mean when they say a cipher has an insufficient keyspace: it does not matter how cleverly the algorithm scrambles the text if an attacker can simply try every key.

That is why this tool does not attempt anything sophisticated. It generates all twenty-six shifts, scores each one, and shows you the ranking. The scoring only exists to save you the trouble of reading twenty-six lines — the actual cryptanalysis is the brute force.

How the Caesar cipher solver decides which shift is English

Each candidate is scored on the fraction of its words that appear in a list of the most common English words — the, be, to, of, and, a, in, that, and so on through roughly a hundred and forty entries. A shift that produces recognisable function words scores high. A shift that produces gibberish scores zero, because gibberish rarely contains the word THE by accident.

The percentage next to each result is that fraction. Decoding a shifted version of the quick brown fox sentence gives the correct plaintext at thirty-three percent — the, over and the again are the hits — while every wrong shift sits at zero. A clear winner at any percentage above roughly fifteen is almost always the real answer.

The method has a predictable weakness, and it is worth knowing. Short inputs give it nothing to work with. A three-word phrase might contain no common function words at all, in which case every shift scores zero and the ranking is meaningless. When that happens, ignore the ordering and read the twenty-six candidates yourself — the right one is still in the list, it just has not been identified for you.

ROT13 and the shift that undoes itself

A shift of thirteen has a property no other shift has: applying it twice returns the original text. Thirteen is exactly half of twenty-six, so shifting forward thirteen and then forward thirteen again lands you back where you started. Encoding and decoding are the same operation.

That convenience made ROT13 a fixture on early internet forums, where it was used to hide spoilers, punchlines and answers to puzzles. Nobody involved thought it was security. It was a politeness convention — a way of making text unreadable at a glance so you had to actively choose to read it, with a single command to flip it back.

It survives today in that same role. If you see a block of apparent nonsense in a forum thread or a puzzle, ROT13 is the first thing to try, and this tool will surface it at the top of the ranking automatically.

What the cipher preserves, and why that leaks so much

This implementation shifts letters and leaves everything else exactly as it was. Spaces stay spaces, punctuation stays put, and capital letters stay capital — encode Hello, World! with a shift of thirteen and you get Uryyb, Jbeyq! with the comma, the exclamation mark and both capitals intact.

Preserving the formatting makes the tool pleasant to use and makes the output readable. It also, in a real-world sense, leaks a great deal. Word lengths survive the cipher untouched, and word lengths are enormously informative — a one-letter word in English is almost certainly A or I, and a three-letter word at the start of a sentence is very often THE.

Historically, this is why serious cipher systems stripped spaces and punctuation and wrote the output in uniform five-letter groups. Removing word boundaries denies the attacker exactly the structure that makes a substitution cipher easy to break by eye.

The other approach: counting letters

If the common-word ranking fails, the classical technique still works. English letter frequencies are famously lopsided — E is by far the most common letter, followed by T, A, O, I and N, while J, Q, X and Z are rare.

A Caesar cipher does not change frequencies, it only relabels them. Whatever letter appears most often in the ciphertext is probably standing in for E. Count the gap between that letter and E, and you have the shift. If Q dominates the ciphertext, try a shift of twelve, since Q is twelve places past E.

This works on shorter texts than the word-based method, and it is worth knowing as a fallback. It is also how the same attack scales to the harder ciphers: a general substitution cipher, where each letter maps to an arbitrary other letter, has an astronomically larger keyspace but falls to exactly this kind of frequency analysis given enough text.

What to use when you need actual secrecy

Nothing on this page provides security. A Caesar cipher was breakable in the ninth century, when the Arab polymath al-Kindi wrote down frequency analysis, and it has been trivially breakable ever since. It is a puzzle, a teaching example and a spoiler-hider.

The historical successors are instructive. The Vigenere cipher uses a keyword to apply a different shift to each position, which defeats simple frequency counting and stayed unbroken for roughly three centuries. The Enigma machine changed its substitution after every single letter. Both eventually fell.

For anything that genuinely matters, use modern authenticated encryption from a maintained library — and do not implement it yourself. The lesson of the Caesar cipher is not that shifting is bad, it is that a cipher's strength lives in its keyspace and its resistance to analysis, neither of which you can eyeball.

Caesar Cipher Solver: choosing the right approach

Caesar Cipher Solver is designed around this task: Encode and decode Caesar ciphers. When preparing input for caesar cipher solver, specify the intended use and the details that must remain accurate. Use the instructions below to judge whether the current output fits that purpose.

Choose one transformation and define what should remain unchanged. Case, order, spelling, delimiters, and visible styling are separate properties of a string.

Character substitution follows a mapping, while natural-language translation follows meaning and grammar. A novelty encoding can be playful or educational without being a secure communication method.

Decide what would count as a successful result before you begin. For symbol mappings and reversible text, that means checking the relevant constraint rather than choosing whatever looks most polished. Keep a short note of the intended audience or destination, any details that must remain exact, and the change you actually need. This gives you a basis for comparing alternatives and prevents a later edit from quietly changing the task.

Worked examples

Input
Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj
Result
ROT23 (33%) — The quick brown fox jumps over the lazy dog

Only the correct shift produces recognisable common words, so it wins the ranking outright while every other candidate scores zero.

Input
Hello, World! encoded with a shift of 13
Result
Uryyb, Jbeyq!

Punctuation and capitalisation survive untouched. Run the result through a shift of 13 again and the original comes back, because ROT13 is its own inverse.

Input
A short phrase with no common words
Result
All 26 shifts score 0% and the ranking is arbitrary

This is the known failure case. The correct answer is still in the list — read the candidates yourself rather than trusting the order.

Frequently asked questions

Do I need to know the shift to decode?+

No. The tool generates all twenty-six shifts and ranks them by how English-like each result is. With such a small keyspace, trying every key is faster and more reliable than trying to deduce the right one.

What does the percentage next to each result mean?+

It is the fraction of words in that candidate that appear in a list of the most common English words. A high percentage means the shift produced real English. Zero across every candidate usually means the input was too short for the scoring to find anything.

Why is ROT13 special?+

Thirteen is half of twenty-six, so applying it twice returns the original text — encoding and decoding are the same operation. That made it a convenient convention for hiding spoilers and puzzle answers on early internet forums.

Does it preserve punctuation and capital letters?+

Yes. Only letters are shifted. Spaces, punctuation, digits and letter case all pass through unchanged, which keeps the output readable — though in a real cipher, preserving word lengths leaks a lot of information to an attacker.

The ranking picked the wrong answer. What now?+

Read the full list. The scoring only ranks candidates, it never discards any, so the correct plaintext is always present. For short inputs, try counting letters instead: the most frequent letter in the ciphertext is usually standing in for E, and the distance from that letter back to E gives you the shift.

Is a Caesar cipher secure?+

Not at all. It has twenty-five usable keys and has been reliably breakable since al-Kindi described frequency analysis in the ninth century. Use it for puzzles and teaching, never for protecting anything real.

Is my text uploaded anywhere?+

No. Every shift is computed in your browser and nothing you paste is transmitted or stored.

Does a reversible encoding keep a message secret?+

No. Reversibility through a simple public mapping makes recovery straightforward. Use appropriate security tools for confidential communication; treat these encodings as utilities, puzzles, or visual transformations.

Why does copied text look different in another editor?+

The destination can interpret characters, line endings, and paragraph styles differently. A plain-text tool handles the text it receives, while the editor may add its own visual spacing. Compare the stored characters with the editor's formatting settings before deciding which part needs correction.

Should I keep a copy before cleaning a long document?+

Yes. Keep the original separately, especially when working with quotations, structured lists, or unusual characters. Some transformations discard information. An unchanged copy lets you compare the result and recover formatting that turns out to be meaningful after the cleanup.

Can I process prose and source code together?+

It is safer to separate them. Prose often tolerates normalized spacing, but code can depend on indentation, quotation marks, and exact characters. Clean only the passage that needs the chosen operation and inspect code with tools appropriate to its language and format.

How should I handle text copied from a two-column PDF?+

Check reading order before cleaning characters. A PDF selection may interleave columns or include headers and page numbers. Removing spaces or breaks cannot reconstruct a scrambled argument. Compare the copied passage with the page and rebuild the correct sequence first.

Will plain-text cleanup retain bold text and links?+

Do not assume so. Bold styling, link destinations, and document layout are separate from ordinary text characters. Keep the formatted original if those details matter, then apply the required styles in the destination after the text itself has been reviewed.

What should I do with a quoted passage?+

Preserve an exact source copy and follow the quotation rules relevant to your publication. Even small punctuation or spacing changes can matter in a quotation. If you create a normalized working version, distinguish it from the authoritative original rather than silently replacing it.

Why does an apparent blank line remain after cleanup?+

The gap may come from paragraph margins or line-height settings rather than blank characters. Inspect the destination editor's formatting. A character-based tool cannot remove spacing that exists only in a document style or a webpage's layout rules.

More Text Tools tools

Browse all 293 tools →