ROT13 Encoder/Decoder

Encode and decode text using ROT13 cipher.

ROT13 Cipher

ROT13 shifts each letter 13 positions through the alphabet. A becomes N, B becomes O, and so on. Since there are 26 letters, applying ROT13 twice returns the original text - the same operation encodes and decodes.

This isn't encryption - it provides no security. But it's useful for hiding spoilers, puzzle answers, or potentially offensive content that readers can choose to reveal.

Example

"Hello World" becomes "Uryyb Jbeyq"
Apply ROT13 again and it's back to "Hello World"

Understanding the ROT13 Cipher

ROT13 is a letter substitution cipher that replaces each letter with the letter 13 positions after it in the alphabet. Since the alphabet has 26 letters, applying ROT13 twice returns the original text'it's self-reversible. "Hello" becomes "Uryyb" and encoding "Uryyb" returns "Hello."

ROT13 is a special case of the Caesar cipher (which can shift by any amount). It provides no actual cryptographic security'it's trivial to decode. Its purpose is obscuring text from casual reading, like hiding spoilers or puzzle answers in plain sight where intentional decoding is required.

Frequently Asked Questions

Is ROT13 secure encryption?

Absolutely not. ROT13 is trivially easy to decode'there's only one possible "key" (13), and anyone familiar with it can decode instantly. Use proper encryption (AES, RSA) for actual security. ROT13 is purely for obscuration, not protection.

Why the number 13 specifically?

Because 13 is half of 26 (the alphabet size). This means the same operation encodes and decodes'you don't need separate functions. Any other shift would require a different function to reverse. This made ROT13 convenient for early computer systems.

What happens to numbers and special characters?

ROT13 only affects letters (A-Z, a-z). Numbers, punctuation, spaces, and other characters remain unchanged. "Hello 123!" becomes "Uryyb 123!" with the numbers and punctuation preserved.

What are other Caesar cipher variants?

ROT13 is just one Caesar cipher variant. ROT5 shifts digits only (0-9). ROT18 combines ROT13 for letters and ROT5 for numbers. ROT47 shifts all ASCII printable characters. The original Caesar cipher used a shift of 3.

Where is ROT13 commonly used?

Historically used in Usenet newsgroups to hide spoilers and offensive content. Still used in programming joke contexts, puzzle games, and educational materials about cryptography. It's a standard example in computer science courses on basic encryption.