Velto
Text & String

Caesar Cipher

A Caesar cipher moves every letter of a message the same number of places along the alphabet, so a shift of 3 turns Hello, World! into Khoor, Zruog!. This encoder and decoder runs any shift from 0 to 25, leaves digits, spaces, punctuation and accents exactly as they were, then lists all 25 shifts at once when the key is unknown.

Decoded text

Shift 0, text unchanged

Wklv lv d vhfuhw phvvdjh

20 letters shifted, 4 characters passed through unchanged.

Same text in ROT13

Jxyi yi q iushuj cuiiqwu

Shift 13 is the only key that undoes itself: applying ROT13 twice gives the original text back.

All 25 shifts
ShiftDecoded text
1 Vjku ku c ugetgv oguucig
2 Uijt jt b tfdsfu nfttbhf
3 This is a secret message
Most likely
4 Sghr hr z rdbqds ldrrzfd
5 Rfgq gq y qcapcr kcqqyec
6 Qefp fp x pbzobq jbppxdb
7 Pdeo eo w oaynap iaoowca
8 Ocdn dn v nzxmzo hznnvbz
9 Nbcm cm u mywlyn gymmuay
10 Mabl bl t lxvkxm fxlltzx
11 Lzak ak s kwujwl ewkksyw
12 Kyzj zj r jvtivk dvjjrxv
13
ROT13
Jxyi yi q iushuj cuiiqwu
14 Iwxh xh p htrgti bthhpvt
15 Hvwg wg o gsqfsh asggous
16 Guvf vf n frperg zrffntr
17 Ftue ue m eqodqf yqeemsq
18 Estd td l dpncpe xpddlrp
19 Drsc sc k combod wocckqo
20 Cqrb rb j bnlanc vnbbjpn
21 Bpqa qa i amkzmb umaaiom
22 Aopz pz h zljyla tlzzhnl
23 Znoy oy g ykixkz skyygmk
24 Ymnx nx f xjhwjy rjxxflj
25 Xlmw mw e wigvix qiwweki

The highlighted row is the one containing the most common English words. It is a hint, not a verdict.

Examples

How to use

  1. 1

    Type or paste the message in the text box. Up to 5,000 characters go through in one pass. Anything that is not an A-Z letter stays exactly where it sits.

  2. 2

    Choose the direction. Encode moves letters forward through the alphabet while decode moves them back, so a message written at shift 3 comes back by decoding at shift 3.

  3. 3

    Drag the shift from 0 to 25 and watch the result update as it moves. Shift 0 returns the text untouched, while shift 13 gets flagged as ROT13.

  4. 4

    Open the 25-shift table when you do not know the key. The highlighted row holds the most common English words, so check the rows around it before settling on one.

What is a Caesar cipher and how does it work?

A Caesar cipher replaces every letter of a message with the letter sitting a fixed number of places further along the alphabet, that fixed number being the key. Take a shift of 3 as an example: A becomes D, B becomes E, then the end of the alphabet wraps back round to the front so that Z becomes C.

Only the 26 letters move. Digits, spaces, punctuation and accented characters travel through untouched, which is how Hello, World! encodes to Khoor, Zruog! with the comma and the exclamation mark still sitting where they were. Capitals stay capital, so the outline of a sentence holds even once the words stop making sense.

How do you encode a message with the Caesar cipher?

Encoding takes two things, the message and a number between 1 and 25. Take the word HELLO at shift 3 as an example: H moves to K, E moves to H, the two L letters both move to O, then the final O moves to R, which spells KHOOR.

Shift 0 hands back the text exactly as it was typed, a case the tool flags with a shift 0 badge instead of passing it off as a result. Shift 25 walks every letter one step backwards, so HELLO comes out as GDKKN.

ShiftA becomesHELLO becomesKnown as
0AHELLOtext unchanged
1BIFMMPthe key Augustus used
3DKHOORthe key Caesar used
13NURYYBROT13
25ZGDKKNone letter backwards

How do you decrypt a Caesar cipher without the key?

Try every key. Only 25 shifts are worth testing, since shift 0 changes nothing. Reading 25 candidate lines takes about as long as reading one paragraph, which is the whole job of a Caesar cipher decoder. The table under the tool builds those 25 lines for whatever text gets pasted in.

Take Wklv lv d vhfuhw phvvdjh as an example: line 3 of that table reads This is a secret message while the other 24 lines stay unreadable, so the key was 3 without anyone having to guess. The tool highlights one row by counting common English words in each candidate, which points at where to look first. Text holding no recognisable English word leaves every row at zero, so nothing gets highlighted.

On a two-letter message that count has nothing to work with. Xf decodes to We at shift 1 and to Go at shift 17, both ordinary English words that the counter scores the same. Glancing down the neighbouring rows costs nothing and settles the ambiguity, which is why the tool calls that line a hint rather than a verdict.

Why does ROT13 undo itself?

ROT13 is the Caesar cipher at shift 13, exactly half of the 26-letter alphabet. Shifting a letter 13 places and then 13 places again lands 26 places along, a full lap that arrives back at the starting letter, so encoding and decoding become the same operation.

Hello, World! comes out as Uryyb, Jbeyq! under ROT13. Pushing Uryyb, Jbeyq! back through ROT13 returns the original text. Forums lean on that property to hide spoilers and punchlines, since the same button covers the text and uncovers it again.

When was the Caesar cipher invented?

The technique goes back at least as far as the first century BC, to the private correspondence of Caesar himself. The Roman historian Suetonius, in his life of Julius Caesar, writes that anyone wanting to read those private letters had to put D in the place of A and carry on the same way through the alphabet, which describes a shift of three.

Augustus ran the same trick on a different key. Suetonius reports that he wrote B for A, with a doubled A standing in where the Latin alphabet stopped at X. The method carries Caesar's name thanks to that account. No ancient source credits him with inventing letter substitution itself.

Is the Caesar cipher secure?

No. Anyone can work through all 25 shifts by hand over a coffee. The table on this page does it in the time a browser needs to redraw, so the demonstration sits right under the input box.

Frequency analysis cracks longer texts faster still, since E remains the most common letter in English whatever the shift moves it to. That weakness is what makes the cipher good at teaching. Puzzle hunts, escape rooms, beginner CTF challenges and classroom demonstrations lean on it because a pencil is enough to solve it.

Rewriting a message into another representation, the way a binary converter does, is not encryption either, since anyone can reverse it without holding a key. The same gap separates a shifted alphabet from a password built by a password generator, where the strength comes from a keyspace nobody can walk through by hand. Anything worth protecting belongs behind real encryption.

Parameters

Every field of this tool can be prefilled from the URL. Use these query parameters:

ParameterTypeDefault
textstringHello, World!
shiftnumber3
modeencode | decodeencode

Example : https://www.veltotools.com/string/caesar-cipher?text=Hello%2C+World%21&shift=3&mode=encode

API

The same tool is available as a free JSON API, with the same parameters as above. No key, no sign-up.

GET https://www.veltotools.com/api/v1/string/caesar-cipher?text=Hello%2C+World%21&shift=3&mode=encode
$ curl "https://www.veltotools.com/api/v1/string/caesar-cipher?text=Hello%2C+World%21&shift=3&mode=encode"

Frequently asked questions

Updated Aug 30, 2026

Related tools