ROT13 & Caesar Cipher

Encode and decode text with ROT13 or a custom Caesar cipher shift (1-25). Free online tool, no signup, runs in your browser.

Preparing private browser tool…

Your file will stay on this device.

What ROT13 is and why it is self-inverse

ROT13 is a Caesar cipher with a shift of thirteen. Each letter is replaced by the letter thirteen positions later in the alphabet, wrapping around from Z back to A: A becomes N, B becomes O, and N becomes A again. Hello, World! becomes Uryyb, Jbeyq! with punctuation, digits and spacing left exactly as they were.

Thirteen is half of twenty-six, which gives ROT13 its defining property: applying it twice returns the original text. There is no separate decode operation, because encoding and decoding are the same function. That is why tools and mail clients historically offered a single rot13 command rather than an encrypt and a decrypt pair.

This tool generalises to any shift from 0 to 25, so it also handles classic Caesar variants such as ROT5 and the single-shift puzzles that appear in capture-the-flag challenges. The alphanumeric mode additionally rotates digits by the same amount modulo ten, so with a shift of thirteen the digits move by three: 2025 becomes 5358. That combination is sometimes labelled ROT13.5 or ROT18.

ROT13 provides no security whatsoever

This needs stating plainly. ROT13 has no key. The transformation is fixed and public, so there is no secret for an attacker to guess and nothing to brute force. Anyone who recognises the output, and it is highly recognisable, can reverse it by running the same operation again. Even for an arbitrary Caesar shift there are only 25 possibilities, all of which a person can try by hand in under a minute and a script can try instantly.

It is therefore not encryption, not obfuscation of any practical strength, and not a way to protect anything. Never use it for passwords, API keys, personal data, or any content whose disclosure would matter. Rotating a string before storing it provides exactly the same protection as storing it in the clear, while creating a false impression that something was done.

For actual confidentiality use a real algorithm with a real key: AES-GCM or ChaCha20-Poly1305 for symmetric encryption, and a password-based key derivation function such as Argon2id or scrypt if the key comes from a passphrase. If you only need to make text safe for transport rather than secret, base64 is the honest choice, since nobody mistakes it for protection.

Where ROT13 is genuinely used

Its real purpose has always been social rather than cryptographic: hiding text from casual reading rather than from an adversary. On Usenet it was the convention for spoilers, punchlines and offensive jokes, so a reader had to make a deliberate choice to decode before seeing the content. That convention survives in forum posts, puzzle hunts and crossword discussion.

It also appears as a light deterrent against automated scanning. Rotating an email address or a keyword in page source stops the most naive scrapers and pattern matchers, though anything more sophisticated than a regular expression defeats it immediately. Treat this as noise reduction, not protection.

In teaching and in puzzles it earns its place. ROT13 is the smallest possible worked example of a substitution cipher, of modular arithmetic applied to text, and of a function that is its own inverse, which makes it a common first exercise in a cryptography course and a common warm-up stage in a capture-the-flag challenge.

What the transformation leaves untouched

Only the 26 ASCII letters in each case are rotated. Case is preserved, so an uppercase letter maps to an uppercase letter and lowercase to lowercase. Spaces, punctuation, line breaks and any character outside the basic Latin alphabet pass through unchanged, which is why accented letters, Cyrillic, Greek, CJK characters and emoji come out of the tool exactly as they went in.

That pass-through behaviour is what makes ROT13 output so easy to recognise. Word lengths, capitalisation, apostrophes and sentence punctuation all survive, so the shape of the text is intact and a reader can often identify short words such as a, I and the by pattern alone. Frequency analysis on anything longer than a sentence identifies the shift immediately.

The digit handling in alphanumeric mode is a separate rotation modulo ten rather than an extension of the letter alphabet, so letters and digits never map into each other. Note that the round trip differs between the two alphabets: applying a shift of 13 twice returns every letter to its original but moves digits by six, so use the complementary shift when digits have to round-trip exactly.

Frequently asked questions

Is ROT13 encryption?
No. Encryption requires a secret key; ROT13 has none. The transformation is fixed, public and reversed by applying it a second time, so it offers zero confidentiality. It hides text from a casual glance and from nothing else.
Why does encoding twice give back the original?
The alphabet has 26 letters and the shift is 13, exactly half. Two shifts of 13 total 26, which is a full cycle back to the starting letter. That makes ROT13 its own inverse, so one operation handles both directions.
Can I use ROT13 to hide a password or an API key?
No. Anyone who sees the rotated string can reverse it instantly, and the output is recognisable enough that they will know to try. Use AES-GCM or ChaCha20-Poly1305 with a properly derived key for anything that must stay secret, and a secret manager for credentials.
What happens to accented letters, Cyrillic or emoji?
They pass through unchanged. Only the 26 unaccented ASCII letters in each case are rotated, so anything outside that range appears in the output exactly as it was typed.
What is the difference between ROT13 and a Caesar cipher?
ROT13 is a Caesar cipher with the shift fixed at 13. A general Caesar cipher can use any shift from 1 to 25, which this tool supports with the slider. Only the shift of 13 has the self-inverse property.
Why do digits change in alphanumeric mode?
That mode applies a second rotation to the digits 0 to 9, using the shift taken modulo ten. With a shift of 13 the digits move by three, so 2025 becomes 5358. Letters and digits are rotated in separate alphabets and never map into each other.