Type your message
Write any message in the text box. Letters, numbers, spaces, and punctuation all work.
A Caesar cipher is one of the oldest secret codes in history. It works by shifting every letter in your message a fixed number of places down the alphabet, so A becomes D when the shift is 3. Type a message below, pick a shift, and watch it turn into a secret code in real time with a colorful spinning alphabet wheel.
Built by Zap Code for kids who love puzzles, coding, and secret messages.
Tool Snapshot
Encode and decode in real time
Type your message and watch the secret code appear instantly.
Colorful alphabet wheel
Two rings spin to show how each letter shifts.
Coding challenges
Try implementing the cipher in Python or JavaScript.
Type a message, pick a shift, and choose encode or decode. The tool keeps spaces, punctuation, and numbers exactly the way you wrote them and only shifts letters.
Mode
Tip: the original Caesar cipher used a shift of 3.
Try an example
Encoded message
KHOOR ZRUOG
Cipher Wheel
The outer ring is the regular alphabet. The inner ring spins to match your shift, showing what each letter becomes.
Outer ring: the plain alphabet (A-Z).
Inner ring: the shifted alphabet. Look at A on the outside to see what it becomes on the inside.
Julius Caesar was a famous Roman general and leader who lived more than 2,000 years ago. To send orders to his armies in private, he used a simple secret code: he replaced every letter in his message with the letter three places later in the alphabet. So the word ARMY would turn into DUPB. If an enemy intercepted the message, it just looked like nonsense.
Today we call this trick the Caesar cipher, and it is one of the first things people learn when they study cryptography, the science of secret messages. Modern computers can crack a Caesar cipher almost instantly, so it is not safe for real secrets, but it is perfect for puzzles, classroom games, and learning how encryption works.
Write any message in the text box. Letters, numbers, spaces, and punctuation all work.
Slide the shift from 1 to 25. The classic Caesar shift is 3, the same one Julius Caesar used.
Encode hides your message. Decode reveals a secret message someone sent you.
Click copy to send your secret code in a chat, on paper, or in a school project.
Now that you have played with the cipher, try writing it yourself. Each challenge has a hint and a solution you can peek at if you get stuck.
Write a function that takes a single uppercase letter and a shift number, and returns the shifted letter. Wrap around so Z + 1 becomes A.
Hint
Use the character's position in the alphabet (A = 0, B = 1, ...). Add the shift, then take the result modulo 26.
Write a function that takes a message and a shift number, and returns the encoded message. Keep spaces, numbers, and punctuation unchanged.
Hint
Loop through each character. If it's a letter, shift it. Otherwise, leave it alone.
Imagine a friend sends you a coded message but forgot to tell you the shift. Write a program that prints the message decoded with every possible shift from 1 to 25.
Hint
Reuse your encode function but use a negative shift (or call it 25 times with shifts 1 through 25).
Keep exploring beginner-friendly Zap Code tools for coding, creativity, and puzzles.
Related Tool
Test HTML, CSS, and JavaScript basics with instant feedback and score tracking.
Related Tool
Turn any word into ASCII art in five fun fonts with one-click copy.
Related Tool
Generate an age-appropriate Scratch, Python, HTML, CSS, or JavaScript project idea.
Related Tool
Paint with bright colors, load templates, and download your pixel art as a PNG.
Main Product
Want to build real apps and games? Zap Code helps kids turn ideas into working projects with AI support, live previews, and editable code.
Explore Zap CodeEverything you might want to know about the Caesar cipher, how to decode it, and how to use this tool for classrooms or coding practice.
A Caesar cipher is one of the oldest and simplest secret codes. It works by shifting every letter in your message a fixed number of places down the alphabet. For example, with a shift of 3 the letter A becomes D, B becomes E, and so on. To decode the message, you shift each letter back the same amount.
It is named after Julius Caesar, a Roman general who lived more than 2,000 years ago. He used a shift of 3 to send secret messages to his armies so that enemies who intercepted the notes could not read them. Today the cipher is mostly used for fun, puzzles, and learning the basics of cryptography.
To decode, switch this tool to Decode mode and use the same shift number that was used to encode the message. If you do not know the shift, try every number from 1 to 25 until the message becomes readable. This is called brute-forcing the cipher.
No. The Caesar cipher is a great learning tool, but it is very easy to break. Modern computers can try all 25 possible shifts in a fraction of a second. For real privacy online, websites use much stronger encryption like AES and TLS. Use the Caesar cipher for games, classroom puzzles, and learning.
Yes. This Caesar cipher encoder and decoder is 100% free to use, with no signup required. It runs entirely in your browser, so your messages never leave your device. Perfect for classrooms, homeschool lessons, and after-school code clubs.