ROT13 Encoder/Decoder_
Paste a block of gibberish and read it, or turn readable text into gibberish — this ROT13 decoder and encoder does both with the same control, because the cipher undoes itself. Every letter moves 13 places along the alphabet, so A becomes N and N becomes A; run it twice and you have your original text back.
Everything happens in this tab. The text you paste is converted by JavaScript on this page and never sent anywhere, which matters more than it sounds — people paste half-remembered puzzle answers, private forum spoilers and snippets of work code into these boxes.
| Shift | Result | Copy |
|---|
The ROT13 alphabet, letter by letter
| Uppercase | Becomes | Lowercase | Becomes |
|---|---|---|---|
| A | N | a | n |
| B | O | b | o |
| C | P | c | p |
| D | Q | d | q |
| E | R | e | r |
| F | S | f | s |
| G | T | g | t |
| H | U | h | u |
| I | V | i | v |
| J | W | j | w |
| K | X | k | x |
| L | Y | l | y |
| M | Z | m | z |
| N | A | n | a |
| O | B | o | b |
| P | C | p | c |
| Q | D | q | d |
| R | E | r | e |
| S | F | s | f |
| T | G | t | g |
| U | H | u | h |
| V | I | v | i |
| W | J | w | j |
| X | K | x | k |
| Y | L | y | l |
| Z | M | z | m |
Read it in either direction — the mapping is symmetric, which is what makes one pass encode and decode. Every character not in this table is left exactly as it was.
The rotation family compared
| Cipher | What it moves | Self-inverse? | Where you meet it |
|---|---|---|---|
| ROT13 | The 26 Latin letters, A–Z and a–z | Yes — 13 is half of 26 | Usenet and forum spoilers, puzzle answers, mild obfuscation in source |
| ROT5 | The ten digits, 0–9 | Yes — 5 is half of 10 | Hiding numbers alongside ROT13 text; rarely used on its own |
| ROT18 | Letters and digits together (ROT13 + ROT5) | Yes — both halves are | Puzzle text that mixes words and numbers, where ROT13 alone would leave the numbers readable |
| ROT47 | All 94 printable ASCII characters, ! to ~ | Yes — 47 is half of 94 | Obfuscating strings that include punctuation and symbols; the output looks like line noise rather than words |
| Caesar, shift N | The 26 Latin letters, by any N from 1 to 25 | Only when N is 13 | The general case. Shift 3 is the cipher Suetonius attributes to Caesar himself |
Every one of these is a Caesar cipher. The named variants are just the shifts where the rotation happens to be exactly half the character set, which is the only reason a single control can encode and decode.
What ROT13 is, and what it is not
The name, and where it came from
ROT13 means “rotate by 13”. It is the Caesar cipher — the substitution Suetonius credits to Julius Caesar, who used a shift of three — with the shift set to thirteen. The convention that made it famous is younger: on the Usenet newsgroups of the early 1980s, net.jokes and later rec.humor asked posters to rotate anything offensive or spoiling, so a reader had to make a deliberate choice to see it. Every newsreader grew a “decrypt” key, and the habit outlived the network. That is the whole meaning of ROT13: not a lock, but an envelope.
Why thirteen, and not any other number
Thirteen is half of twenty-six. Move a letter thirteen places and then thirteen more and you have moved it twenty-six places — all the way around the alphabet and back to where it started. That single arithmetic fact is why this page has one control instead of an encode button and a decode button, and it is why the mapping table above reads the same in both directions. Switch the rotation to a custom Caesar shift and watch the note under the output change: at any shift but thirteen the property vanishes, and you need the opposite shift to get your text back.
What the ROT13 algorithm actually does
For each character: if it is between A and Z, subtract A, add 13, take the remainder on division by 26, add A back. Repeat for a to z. Anything else is copied across untouched. That is the entire algorithm, and it is why the output is always exactly as long as the input and why uppercase stays uppercase. On a Unix machine the same job is tr 'A-Za-z' 'N-ZA-Mn-za-m', which is where a lot of people first meet it.
It offers no security whatsoever
There is no key. Knowing the method is knowing the secret, and the method is the name of the tool. Anyone who recognises rotated text can undo it in a second — with this page, with a newsreader, with tr, in their head after enough practice. ROT13 is a courtesy that stops accidental reading; treating it as protection for anything that matters is a category error. If you need text to stay unreadable to someone who wants to read it, you need encryption, and encryption needs a key you keep.
How to use
- 01Paste your text into the left box, or upload a text file. The conversion runs as you type — there is nothing to press, and nothing is uploaded while you do it.
- 02To decode, paste the encoded text in the same box. This is the part that surprises people: there is no separate ROT13 decoder mode, because rotating gibberish by 13 gives you words back exactly as rotating words gave you gibberish.
- 03Press Use output as input to translate the result again and watch it return to what you started with. Two presses is the proof that the cipher is its own inverse, and it is the fastest way to convince yourself the tool did what it claims.
- 04Switch the rotation if ROT13 alone is not enough: ROT5 moves digits, ROT18 moves both, ROT47 moves every printable ASCII character including punctuation. The note under the output always says whether the setting you picked can decode itself.
- 05If you are holding rotated text and do not know the shift, press Brute force all 25 shifts. One of the twenty-five rows will be readable English — that is your answer, and row 13 is plain ROT13.
Where this actually gets used
Hiding a spoiler in a thread
You want to answer a question about a film's ending without spoiling it for everyone scrolling past.
The butler did it
Gur ohgyre qvq vg
Reading someone else's spoiler
A reply is a block of nonsense with “rot13” next to it. Same box, same control, no mode to switch.
Gur ohgyre qvq vg
The butler did it
A puzzle hunt or CTF clue
A challenge string is rotated by an unknown amount. Brute force prints all twenty-five candidates and you read down the column.
Wkh nhb lv xqghu wkh pdw
The key is under the mat
Keeping a string out of a casual grep
An easter egg or a placeholder you do not want turning up in a search of the repository. Not security — just not sitting in plain sight.
const hint = "Gel gur pbasvt svyr";
Try the config file
Tips & best practices
- There is no wrong direction. If the output looks like nonsense, you had plain text; if it looks like words, you had rotated text. The tool cannot be set the wrong way round.
- Numbers survive ROT13 untouched, so a rotated message with a date or a code in it still shows that date. Switch to ROT18 if the digits matter.
- On any Unix machine,
tr 'A-Za-z' 'N-ZA-Mn-za-m'does the same thing to a pipe or a file, and it is faster than a browser for anything large. - ROT47 output is unreadable in a way ROT13 output is not — punctuation and spacing get scrambled too, so it does not look like a word puzzle. Use it when you want the text to look like noise rather than like a cipher.
- Rotating twice with the same setting is a no-op, not double protection. Two people applying ROT13 to the same message just publish it.
- For a Caesar shift that is not 13, remember the pair: shift 3 is undone by shift 23, shift 7 by 19. The note under the output does the arithmetic for you.
- Encoding for transport rather than for hiding? Use the Base64 encoder or the URL encoder — those survive channels that mangle bytes, which ROT13 does nothing about.
- Changing only the case of your text rather than the letters themselves is the case converter. It is the near-opposite of this page: it keeps letter identity and changes case, where ROT13 keeps case and changes identity.
Gotchas — what people get wrong
It is not encryption, and it protects nothing
ROT13 has no key. The method is the secret and the method is public — it is in the name of this page. Anyone who wants to read your text can, instantly. It is a convention for hiding spoilers and puzzle answers from people who are not looking, and using it as a privacy measure for anything real is a mistake with no upside, because a proper cipher costs you nothing extra.
Applying it twice returns the original
This trips people up in both directions. If you ROT13 a message and then ROT13 it again before posting, you have posted the plain text. And if a thread looks like it is already rotated but reads fine, someone has done exactly that. The Use output as input control makes the round trip visible in two presses.
Only the 26 Latin letters move — everything else leaks
Accented letters pass straight through, so café becomes pnsé with the é intact, and the shape of the word survives to identify it. Cyrillic, Greek, Chinese, Japanese, Korean, Arabic and every emoji are untouched, which means a rotated message in any of those scripts is not hidden at all. Numbers, punctuation and spacing also survive, so word lengths and sentence structure remain perfectly readable.
It is a social convention, not a technical control
The reason ROT13 works on a forum is that everyone has agreed not to decode it until they want to. That agreement is the entire mechanism. It does not travel — a rotated string in a database or a log file is protected by nothing at all, because no one there agreed to anything.
Brute force finds the shift, not the meaning
The all-25 panel tells you which rotation produces readable text. If none of the twenty-five rows reads as language, the text was not a Caesar cipher — it may be Base64, hex, or a substitution with a real key, and this is the wrong tool for it.
Technical details
- ROT13 range
- U+0041–U+005A and U+0061–U+007A — the unaccented Latin alphabet, both cases
- ROT5 range
- U+0030–U+0039, the ASCII digits
- ROT47 range
- U+0021–U+007E, the 94 printable ASCII characters
- Caesar shift
- 1–25, clamped; the field is rewritten so it can never show one value and encode another
- Iteration
- By code point, not UTF-16 unit — a surrogate pair is carried across whole, never split
- Preserved exactly
- Length, case, whitespace, line endings, and every character outside the selected range
- Limits
- Text over 8 MB is declined outright. Beyond 1 MB the pane shows a prefix only; Copy and Download hand back the entire rotation
- Network
- None from tool code. A test sweep calls every function this page uses with
fetchandXMLHttpRequestreplaced by stubs that throw, so a stray request fails the build instead of shipping. Disconnect from the network and the page still works.
Frequently asked questions
What does ROT13 mean?
Rotate by 13. Each letter is replaced by the one 13 places further along the alphabet, wrapping around from Z back to A. The name is literal and it is also the entire specification.
How do I decode ROT13?
Paste the encoded text into the same box you would use to encode. There is no separate decoder, because rotating by 13 twice returns the original — the operation that encoded the text is the operation that decodes it.
Is ROT13 secure?
No, and it has never claimed to be. There is no key to guess: knowing that text is ROT13 is enough to read it. It is a way to stop someone reading something by accident, not a way to stop them reading it on purpose.
Why does ROT13 use 13 and not some other number?
Because 13 is half of 26. Any other shift needs its opposite to undo it, which means an encode mode and a decode mode. At 13 the cipher is its own inverse, and that symmetry is the only reason the convention caught on.
What happens to numbers, punctuation and spaces?
Nothing — ROT13 covers only the 26 Latin letters. If you need digits rotated too, switch to ROT18, which is ROT13 and ROT5 applied together. ROT47 goes further and rotates punctuation as well.
Does it work on accented letters or other alphabets?
They pass through unchanged. é stays é, Cyrillic stays Cyrillic, Japanese stays Japanese. This is worth knowing before you rely on it: a rotated sentence containing accented words leaks the shape of those words, and a rotated sentence in a non-Latin script is not hidden at all.
What is the difference between ROT13 and a Caesar cipher?
ROT13 is a Caesar cipher. Caesar covers any shift from 1 to 25; ROT13 is the one at 13. Pick “Caesar (custom shift)” in the rotation control to use the general form, and the note under the output will tell you which shift undoes the one you chose.
I have rotated text but I do not know the shift. What now?
Press Brute force all 25 shifts. There are only twenty-five possibilities, so the tool prints every one and you read down the list for the row that turns into language. If none of them does, the text is not a rotation cipher.