QuirkText

ROT13 Encoder and Decoder

ROT13 moves every letter 13 places along the alphabet, so running it twice gives back the original. Paste your text below, or switch to ROT47 to rotate digits and symbols too.

Variant
Result
PlainABCDEFGHIJKLMNOPQRSTUVWXYZ
ROT13NOPQRSTUVWXYZABCDEFGHIJKLM

Runs entirely in your browser. Your data never leaves your device.

How to use it

  1. Pick a variant: ROT13 for letters only, or ROT47 for letters, digits and symbols.
  2. Type or paste your text into the box. The sample is "Why did the chicken cross the road?".
  3. Read the result below the box. It updates as you type, and there is no separate decode button.
  4. To decode, paste the rotated text in and read the output. Press Copy result to take it with you.

What ROT13 does

ROT13 stands for "rotate by 13 places". Every letter moves 13 steps forward in the alphabet, and letters near the end wrap around to the start. A becomes N, B becomes O, N becomes A. Case is preserved. Digits, spaces and punctuation are not touched.

It is a Caesar cipher with one fixed shift. That shift is special: the alphabet has 26 letters, and 13 is half of 26. Shift twice and you land back where you started.

The ROT13 table

A-MABCDEFGHIJKLM
becomesNOPQRSTUVWXYZ

The other half is the same table read in reverse: N-Z maps back to A-M.

ROT13 decoder: why one step does both jobs

Most ciphers need a separate decoder. ROT13 does not, because it is its own inverse. Number the letters A=0 to Z=25 and the rule is (x + 13) mod 26. Apply it twice and you get (x + 26) mod 26, which is x.

So when you search for a ROT13 decoder, the encoder is the answer. Paste the rotated text into the tool above and the output is the plain text.

Worked example: "Hello"

  1. H is position 7. 7 + 13 = 20, which is U.
  2. e is position 4. 4 + 13 = 17, which is r.
  3. l is position 11. 11 + 13 = 24, which is y. Both l letters give y.
  4. o is position 14. 14 + 13 = 27. That is past 25, so subtract 26 and you get 1, which is b.

The result is Uryyb. Run it again: U (20) + 13 = 33, minus 26 is 7, which is H. You are back at Hello.

Common words in ROT13

PlainROT13
HelloUryyb
thegur
WhyJul
secretfrperg
spoilerfcbvyre
passwordcnffjbeq
ROT13EBG13

Note that "ROT13" itself becomes "EBG13". The digits stay put.

ROT47: rotating digits and symbols too

ROT13 only handles letters. ROT47 takes the 94 printable ASCII characters, from "!" (code 33) to "~" (code 126), and rotates them by 47 places. Letters, digits and punctuation all change. 47 is half of 94, so ROT47 is also its own inverse.

The tool's second option runs this. Here is "Hello" in ROT47, step by step:

  1. H has code 72. 72 - 33 = 39, plus 47 = 86. 86 is below 94, so no wrap. 86 + 33 = 119, which is w.
  2. e has code 101. 101 - 33 = 68, plus 47 = 115. Subtract 94 for the wrap to get 21. 21 + 33 = 54, which is 6.
  3. l has code 108. 108 - 33 = 75, plus 47 = 122, wrap to 28. 28 + 33 = 61, which is =.
  4. o has code 111. 111 - 33 = 78, plus 47 = 125, wrap to 31. 31 + 33 = 64, which is @.

The result is w6==@. The default sample sentence in the tool, "Why did the chicken cross the road?", gives Jul qvq gur puvpxra pebff gur ebnq? in ROT13.

ROT47 spaces are left alone, since a space (code 32) is outside the 33-126 range.

ROT13 on the command line

On Unix and Linux you can do it without a website. The tr command maps one character set to another:

tr 'A-Za-z' 'N-ZA-Mn-za-m'

That maps A-Z to N-ZA-M and a-z to n-za-m. Feed text to it and you get ROT13 back. It is the same table as the one above.

Is ROT13 secure? Limits and mistakes

No. There is no key, the mapping is public, and letter frequencies are preserved, so frequency analysis breaks it. Even worse, a shift this common is the first thing anyone tries. It is meant to keep a spoiler from being read by accident, not to keep a secret from a person who wants it.

Real software has been caught using it for passwords. In December 1999 it was found that Netscape Communicator used ROT13 as part of an insecure scheme to store email passwords. If you need to hide data, use real encryption, not a letter swap.

Other things to watch for:

  • Accented letters. "é" is not in A-Z, so it stays unchanged.
  • Mixing variants. Text rotated with ROT47 will not decode with ROT13, and the reverse. Pick the same variant for both directions.
  • Expecting Atbash. Atbash reverses the alphabet instead of shifting it, so Hello becomes Svool, not Uryyb.

Where ROT13 came from

ROT13 jokes were popular on newsgroup servers such as net.jokes as early as the 1980s. Posters used it to hide offensive jokes, puzzle answers and spoilers. Readers had to choose to decode it, which was the whole point.

The underlying idea is the Caesar cipher, a plain letter shift. ROT13 is the one shift that reverses itself.

Related tools

For a variable shift with brute-force help, use the Caesar cipher tool. For a cipher with a keyword, try Vigenere. If your puzzle text looks like letters and equals signs, it may be Base64 instead.

Sources

Checked October 2026.

Frequently asked questions

What is ROT13?

ROT13 is a letter substitution that replaces each letter with the one 13 places after it, wrapping from Z back to A. Hello becomes Uryyb. It hides text from a casual glance, not from anyone who wants to read it.

How do I decode ROT13?

Apply ROT13 again. The Latin alphabet has 26 letters and 13 is exactly half, so a second pass returns the original. Paste the rotated text into the tool and the output is the plain message.

What is the difference between ROT13 and ROT47?

ROT13 rotates only the letters A-Z and a-z. ROT47 rotates all 94 printable ASCII characters from "!" to "~" by 47 places, so digits and symbols change as well. Hello becomes w6==@ in ROT47.

Is ROT13 encryption?

Not in any useful sense. There is no key, and the mapping is public. It is easy to break by frequency analysis, and it was never meant to protect secrets. Use it for spoilers and puzzle answers.

Why is ROT13 used for spoilers and jokes?

It makes text unreadable at a glance but takes one click to reverse. Usenet readers used it to hide jokes, puzzle answers and spoilers, so nobody saw them by accident. You will still see it in some forums and geocaching hints.

Does ROT13 change numbers?

No. ROT13 leaves digits, spaces and punctuation alone. A related variant called ROT5 rotates digits by 5, and ROT13 plus ROT5 together is sometimes called ROT18. ROT47 covers digits and symbols in a single pass.

How is ROT13 different from a Caesar cipher?

ROT13 is a Caesar cipher with a fixed shift of 13. Other shifts, like 3, are not self-inverse, so you must decode them with the opposite shift.