FormatterHQ

ROT13 Encoder / Decoder

Rotate every letter by 13 places to hide or reveal spoilers, puzzle answers and punchlines. ROT13 is its own inverse, so the same button encodes and decodes.

Input TEXT
Output TEXT
Ready.

How to use the ROT13 Encoder / Decoder

  1. Paste or type the text you want to encode or decode.
  2. Click Apply ROT13; the result also updates automatically as you type.
  3. Copy the output. To reverse it, apply ROT13 again to the result.

ROT13 encoder and decoder

ROT13 ("rotate by 13") replaces each letter with the one 13 positions further along the alphabet, wrapping from Z back to A. Because the English alphabet has 26 letters, rotating twice by 13 brings you back where you started. That makes ROT13 unusual: encoding and decoding are the same operation, and this tool needs only one button.

Example

The sample input mixes a plain question with an already encoded answer:

Why did the chicken cross the road? Gb trg gb gur bgure fvqr!

After Apply ROT13, the question becomes gibberish and the answer becomes readable:

Jul qvq gur puvpxra pebff gur ebnq? To get to the other side!

How the mapping works

PlainA B C D E F G H I J K L M
ROT13N O P Q R S T U V W X Y Z

The second half of the alphabet maps back to the first half. Uppercase and lowercase letters keep their case. Digits, spaces, punctuation, emoji and accented letters such as é or ñ pass through unchanged, because only the 26 basic Latin letters are rotated.

ROT13 in code and editors

Because ROT13 is so simple, many tools have it built in:

  • Shell: echo 'Uryyb' | tr 'A-Za-z' 'N-ZA-Mn-za-m' prints "Hello".
  • Python: codecs.encode('Hello', 'rot13').
  • PHP: str_rot13('Hello').
  • Vim: the g? operator rotates text, and g?? rotates the current line.
  • Emacs: M-x rot13-region.

If decoding leaves digits and punctuation scrambled, the text probably uses ROT47 instead. ROT47 rotates all printable ASCII characters from ! to ~ by 47 places, so numbers and symbols change too, and ROT13 cannot undo it.

What ROT13 is used for

ROT13 became popular on Usenet in the 1980s as a polite way to hide spoilers, joke punchlines and puzzle solutions. Readers had to take a deliberate step to see the text, but no key was needed. It is still used in forums, geocaching hints, programming exercises and as an easy first example of a substitution cipher.

ROT13 is not encryption

There is no secret involved, and anyone who recognizes the pattern can reverse it in seconds. Never use ROT13 to protect passwords, API keys or personal data. If you need to transport binary data as text, use Base64 encoding; if you need secrecy, use real cryptography such as AES.

Related ciphers

ROT13 is a Caesar cipher with a fixed shift of 13. To use any other shift, or to crack an unknown one automatically, open the Caesar cipher tool. For another self-inverse classic that mirrors the alphabet instead of rotating it, try the Atbash cipher.

Privacy

The conversion runs in your browser with a few lines of JavaScript. Nothing you type is sent to a server.

Frequently asked questions

How do I decode ROT13?
Paste the encoded text and click Apply ROT13. Because shifting by 13 twice returns to the original letter, the same operation both encodes and decodes.
Does ROT13 change numbers?
No. Only the letters A to Z and a to z are rotated. Digits, spaces and punctuation stay exactly as they are; the related ROT5 and ROT47 schemes are the ones that also rotate digits or symbols.
Is ROT13 secure?
No. It has no key, so anyone can reverse it instantly. It is meant for hiding spoilers and puzzle answers from casual reading, not for protecting information.
What happens to accented or non-English letters?
They are left unchanged. ROT13 is defined only for the 26-letter basic Latin alphabet, so characters like ä, ç or Cyrillic letters pass through as-is.

Last updated September 26, 2026

Related tools