Caesar Cipher Encoder & Decoder
Encode or decode text with a Caesar cipher by shifting each A-Z letter a fixed number of positions. Only English letters are transformed; everything else passes through untouched.
How to use this tool
- 1
Type or paste your message into the text area.
- 2
Drag the Shift slider to pick a key from -25 to +25; the default is 3.
- 3
Read the transformed text in the gray output box, which updates instantly as you type or move the slider.
- 4
To decode a message, set the shift to the negative of the value used to encode it (for example, use -3 to undo a +3 shift).
What is a Caesar cipher and how does this tool shift letters?
The Caesar cipher is a substitution cipher named after Julius Caesar, who reportedly used it for military messages around 50 BC. Each letter moves a fixed number of positions through the 26-letter English alphabet, wrapping around from Z back to A. This tool implements exactly that with a regular expression that matches only [a-zA-Z]. Uppercase and lowercase are handled separately so case is always preserved, and the math uses modular arithmetic — ((code + shift) mod 26) — that correctly wraps in both directions, so a negative shift simply decodes. Because the pattern only touches ASCII letters A through Z, digits, spaces, punctuation, emoji, and accented or non-Latin characters (such as é, ñ, or Cyrillic) pass straight through unchanged. There is no separate encrypt or decrypt button: encoding with shift n and decoding with shift -n are the same operation. Note that this is a teaching and puzzle tool, not real security. With only 25 distinct keys, a Caesar cipher is broken in seconds by trying every shift (brute force) or by frequency analysis, so never use it to protect anything sensitive.
Common use cases
Teaching cryptography basics in a classroom by letting students watch each letter shift in real time.
Solving or creating Caesar-cipher puzzles in escape rooms, ARGs, and CTF challenges.
Decoding ROT13 text from forums or email by setting the shift to 13 or -13.
Brute-forcing an unknown shift: scrub the slider through all 25 values until readable text appears.
Generating lightly obfuscated spoiler text or hint answers that readers must shift back to reveal.
Prototyping and debugging encode/decode logic before wiring up a stronger cipher in your own code.
Frequently asked questions
What is a shift of 13?▼
How do I decode a message?▼
Why are my numbers, spaces, and symbols unchanged?▼
Is the Caesar cipher secure?▼
Does case get preserved?▼
Is my text uploaded anywhere?▼
What is the maximum shift, and what about shifts over 25?▼
Related tools
Bcrypt Hash Generator
Generate bcrypt password hashes (client-side).
HMAC Generator
Generate HMAC signatures with SHA-256, SHA-1, MD5.
AES Encryption
Encrypt and decrypt text with AES-256 in your browser.
2FA QR Code Generator
Generate TOTP/2FA QR codes for authenticator apps.
Password Strength Tester
Test password strength against entropy and dictionaries.
ROT13 Encoder
Encode and decode ROT13 text instantly.