Skip to main content
RC

ROT13 Cipher

Apply the ROT13 substitution cipher to any text — each letter is shifted by 13 places, and applying it twice returns the original.

Did you like the tool? Thanks!
Share:

ROT13 is self-inverse — applying it twice returns the original text. Non-alphabetic characters pass through unchanged.

How to Use ROT13 Cipher

Type or paste text and see it instantly transformed with the ROT13 cipher — A becomes N, B becomes O, and so on halfway around the alphabet. Because the Latin alphabet has 26 letters, applying ROT13 twice returns the exact original text. Non-alphabetic characters (digits, punctuation, spaces) pass through unchanged. Copy the result with one click.

About ROT13 Cipher

ROT13 (rotate by 13) is the simplest meaningful substitution cipher in existence and arguably the most widely used piece of cryptography on the internet — not because it secures anything (it absolutely does not — it is a trivial cipher that anyone can reverse in seconds without a key), but because it solves a very specific social problem: spoiler protection. For decades, Usenet newsgroups, online forums, and comment sections have used ROT13 to hide joke punchlines, puzzle solutions, and plot spoilers behind a thin veil of obfuscation — a reader must actively choose to decode the text, which takes deliberate effort or a simple tool like this one, giving them a moment to reconsider before something is spoiled.\n\nThe mechanics are dead simple. Take a letter, shift it forward 13 positions in the alphabet, wrapping around from Z back to A. A becomes N, B becomes O, C becomes P, continuing through M becoming Z, N becoming A, O becoming B, and finally Z becoming M. That is the entire algorithm. Because the English alphabet has 26 letters and 13 is exactly half of 26, applying ROT13 twice always returns the original text — ROT13 is its own inverse (an involution), which means you do not need separate encode and decode buttons. Press the transform button once to ROT13 the text; press it again on the result to get back exactly what you started with. This self-inverse property is why ROT13 caught on and ROT5 (shift by 5) did not — with ROT13, the same tool works for both encoding and decoding, making it trivially easy to implement and use.\n\nROT13 is a specific case of the Caesar cipher with shift equal to 13. The Caesar cipher (which this tool collection includes as a separate tool with a configurable shift) generalizes the idea to any shift value from 1 to 25. But ROT13 earned its own name and cultural status precisely because the shift of 13 makes it self-inverse, which turned it from a cryptographic curiosity into an everyday internet convention. If you have ever seen text that looked like gibberish English — all recognizable letters but forming no real words — there is a good chance you were looking at ROT13-encoded content from a forum or newsgroup.

Details & Tips

The ROT13 transformation mapping: A becomes N and N becomes A, B becomes O and O becomes B, C becomes P and P becomes C, D becomes Q and Q becomes D, E becomes R and R becomes E, F becomes S and S becomes F, G becomes T and T becomes G, H becomes U and U becomes H, I becomes V and V becomes I, J becomes W and W becomes J, K becomes X and X becomes K, L becomes Y and Y becomes L, M becomes Z and Z becomes M. The symmetry is evident in the pairing, which is why applying it twice returns to the original.\n\nImplementation detail: the tool does not use a lookup table for the mapping; it computes the rotation numerically. For each character, if it falls in A-Z (code points 65-90), it is shifted by adding 13 to the code point, and if the result exceeds 90 (Z), it wraps around by subtracting 26. For a-z (97-122), the same logic applies: add 13, if the result exceeds 122, subtract 26. This is both more compact and less error-prone than a 52-entry lookup table. Characters outside those two ranges — digits, punctuation, whitespace, Unicode above U+007F — are appended to the output unchanged.\n\nEdge cases handled: a completely empty input returns an empty string (no error). Text containing only digits and punctuation returns unchanged (no letters to rotate). Very long inputs (novels, entire log files) are processed character by character; the operation is O(n) on input length and completes instantly in the browser even for inputs in the tens of megabytes. Unicode characters outside Latin script (Cyrillic, CJK, Arabic, emoji) pass through untouched — ROT13 by convention operates only on the 26-letter English alphabet.\n\nWhy use this over the more flexible Caesar cipher tool? Convenience. ROT13 requires no shift setting — it is always 13. If you are encoding or decoding spoiler text from a forum, the convention is ROT13 specifically, not a Caesar cipher with an arbitrary shift. The dedicated tool saves you the step of setting the shift value each time. If you need a different shift (for example, ROT5 for digits, or a custom shift for a puzzle), use the Caesar Cipher tool.

Frequently Asked Questions

Why does applying ROT13 twice return the original text?
The English alphabet has 26 letters. Rotating by 13 (half of 26) twice is a full rotation of 26, which brings every letter back to itself. Mathematically, ROT13 is its own inverse — an involution.
Is ROT13 secure?
No. ROT13 is a trivial substitution cipher with no key — anyone who knows it is ROT13 can decode it in seconds. It is used for hiding spoilers and puzzle answers, not for security. For real encryption, use a modern algorithm like AES-GCM.
What is the difference between ROT13 and a Caesar cipher?
ROT13 is a Caesar cipher with the shift fixed at 13. A Caesar cipher can use any shift from 1 to 25. ROT13 is special because shift equals 13 makes it self-inverse — the same operation encodes and decodes.
What happens to numbers, punctuation, and spaces?
They pass through unchanged. ROT13 only transforms the 26 English alphabet letters (A-Z and a-z). Everything else stays exactly as it was.
Does ROT13 preserve uppercase and lowercase?
Yes. Uppercase A becomes uppercase N; lowercase a becomes lowercase n. The case of each letter is preserved through the transformation.
Can ROT13 be applied to non-English text like Chinese or Arabic?
ROT13 only affects the 26-letter English alphabet. Characters outside A-Z and a-z — including accented Latin characters, Cyrillic, CJK, Arabic, and emoji — are passed through unchanged.
Why is ROT13 used on the internet instead of a different rotation?
Because shift equals 13 is self-inverse: the same operation both encodes and decodes. This convenience made it the convention on Usenet and forums, where users needed a quick way to hide and reveal spoilers without separate encode and decode steps.
Is my text sent to a server?
No. The transformation runs entirely in your browser using JavaScript — nothing you type or paste is transmitted, logged, or stored anywhere.
What was ROT13 originally used for?
It emerged on Usenet newsgroups in the 1980s as a convention for hiding offensive jokes, puzzle solutions, and movie spoilers. The idea was that a reader would have to deliberately ROT13 the text to see the hidden content, giving them a moment to decide if they really wanted to be spoiled.
Can I use ROT13 to protect a password?
Absolutely not. ROT13 provides no real security. Use a password manager to generate and store strong, unique passwords, and use bcrypt, scrypt, or Argon2 for password hashing.

Part of These Collections

Also Available As

rot13, rot13 cipher, rot13 encoder, rot13 decoder, rot13 translator, rot13 converter, rot13 online, caesar cipher 13

Found a Problem?

Let us know if something with ROT13 Cipher isn't working as expected.

Thanks — we'll take a look.