Caesar Cipher / ROT13 Converter
Shift the alphabet by n to encrypt, by -n to decrypt; ROT13 is the special case of shift 13. When the shift is unknown, list all 25 candidates and pick the readable one.
The Caesar cipher shifts the alphabet by n places: encryption shifts forward, decryption backward, and ROT13 is the special case of a shift of 13 — 26 letters shifted 13 and then 13 again return to the start, which makes encryption and decryption the same operation. It appears in word puzzles, introductory CTF challenges and anywhere text should not be readable at a glance; a brute-force table of all 25 shifts and an alphabet mapping are included.
Its security is zero: 25 possible shifts can be tried in seconds, so there is no key space worth speaking of. Characters outside A–Z, including digits, punctuation and non-Latin scripts, are left untouched, so in mixed text only the Latin letters get encrypted. If the output is gibberish, try another shift; if none of the 25 reads, the original used a different cipher entirely.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Enter the text and the shift, or pick ROT13 or ROT47.
- Encrypt or decrypt; ROT13 is its own inverse.
- If the shift is unknown, read down the 25-row brute-force table.
- Remember this is a puzzle cipher, not a way to keep data confidential.
How it works
Basic usage
Choose "encrypt" or "decrypt", set the shift to an integer from 1–25, and the result updates instantly. The letter table below shows what each letter A–Z becomes under the current shift — clearer than any description. The stepper buttons beside the input adjust the shift step by step.
ROT13 vs. ROT47
ROT13 is the shift-13 special case: the alphabet has 26 letters, and shifting 13 twice returns to the start, so encryption and decryption are the same operation — this site provides it as a shift-13 shortcut. ROT47 works not on letters but on all 94 printable ASCII characters (digits and symbols included), and is likewise self-inverse, commonly used to make URLs or code snippets unreadable at a glance.
Why shift ciphers are insecure
A shift cipher has only 25 possibilities — trying each one recovers the text, in seconds by hand and milliseconds by script. It has no meaningful key space at all: suitable for puzzles, demos, or "not readable at a glance" — never for protecting real information.
Method: only A–Z and a–z are shifted, preserving case; every other character (digits, punctuation, spaces, non-Latin text) is left exactly as it is. The shift is normalised to 1–25 (multiples of 26 leave the text unchanged), and decryption applies the negative shift. ROT47 covers the 94 printable ASCII characters from 33 to 126.
Code example
JavaScript A shift function (decryption is a negative shift)
const shift = (s, n) => s.replace(/[a-z]/gi, (ch) => {
const base = ch <= "Z" ? 65 : 97;
return String.fromCharCode((ch.charCodeAt(0) - base + n + 26) % 26 + base);
});
shift("Hello", 3); // "Khoor"
shift("Khoor", -3); // "Hello" (decryption is a negative shift)
Python ROT13 in one line
import codecs
codecs.encode("hello", "rot13") # "uryyb"
codecs.encode("uryyb", "rot13") # applying it again restores the input (self-inverse)
# For an arbitrary shift, build a mapping table with str.translate, or follow the JS above
FAQ
Which Caesar shift is the most secure?
None of them. With only 25 possible shifts, trying each recovers the text — choosing 3 or 17 only changes whether it's guessed sooner or later. Protecting content requires modern encryption like AES; the Caesar cipher belongs in demos and puzzles.
Why is ROT13 encryption the same as decryption?
Because the alphabet is a ring of 26: shifting 13, then 13 again, totals 26 — back where you started. Applying ROT13 to a ROT13 result yields the original; set both encrypt and decrypt to shift 13.
How does ROT47 differ from the Caesar cipher?
Caesar moves only letters (A–Z / a–z), leaving digits and symbols untouched; ROT47 shifts all 94 printable ASCII characters (33–126) — digits, punctuation and brackets included — while non-ASCII characters like Chinese stay put. Both are self-inverse, but ROT47's output is harder to recognize at a glance.
The decrypted text is garbage — what does that mean?
The shift is wrong. Try another, or use brute force to list all 25 candidates: the only readable one is the answer. If none of the 25 reads sensibly, the original probably used a different scheme (Vigenère, transposition) rather than a simple shift.
What happens to Chinese text under a Caesar cipher?
Chinese characters fall outside A–Z and pass through unchanged, so only the English letters in mixed text are encrypted. This is both the cipher's limitation and the reason it applies only to Latin-alphabet text.
How do I spot the plaintext in the brute-force table quickly?
Look for language: candidates are listed by shift 1–25, and real sentences show readable words and a natural rhythm of spaces, while garbage is random letter salad. Longer text is easier to judge; three-to-five character strings may "look fine" under several shifts — use context.
How does the Caesar cipher relate to the Vigenère cipher?
Vigenère is "a string of Caesar shifts": a keyword decides each letter's shift, turning one fixed shift into a periodic sequence of shifts and sharply raising the difficulty. Caesar is just Vigenère with a one-letter keyword.
Does this tool record what I decrypt?
No. Everything computes in the browser; nothing is sent to a server or written to localStorage. With no history section, decrypting private content leaves no trace.