Skip to content

↑↓ navigate ↵ open Esc close Search runs locally

ROT13 Encoder & Decoder (ROT5 and ROT18 too)

Encode or decode ROT13 as you type. Switch to ROT5 for digits or ROT18 for letters and digits, and see every ROT variant of your text side by side.

  • Runs in your browser
  • Nothing is uploaded
  • Free, no sign-up
The same operation encodes and decodes
0 chars
ROT13
Runs in your browser. Nothing is uploaded. Tip: run it twice to get the original back

How to use the ROT13 tool#

  1. Type or paste your text into the left box. The ROT13 result appears on the right as you type.
  2. To decode, paste ROT13 text the same way: ROT13 is its own inverse, so the same operation turns it back.
  3. Pick a Variant: ROT13 for letters, ROT18 to also rotate digits, or ROT5 to rotate digits only.
  4. Use Every ROT variant under the tool to compare and copy the other versions.

Examples#

Encode a greeting

Input
Hello, World!
Output
Uryyb, Jbeyq!

Letters move 13 places; the comma, space and ! stay as they are, and so does the letter case.

Decode a classic ROT13 joke

Input
Jul qvq gur puvpxra pebff gur ebnq?
Output
Why did the chicken cross the road?

Decoding is the same operation as encoding.

ROT18: letters and digits

Input
Order 66
Output
Beqre 11

ROT18 is ROT13 for letters plus ROT5 for digits, so 6 becomes 1.

ROT5: digits only

Input
Call 555-0123
Output
Call 000-5678

Each digit moves 5 places (5 → 0, 0 → 5); letters are left alone.

What is ROT13?#

ROT13 ("rotate by 13 places") replaces each letter with the letter 13 positions after it in the alphabet, wrapping around from Z back to A. A becomes N, B becomes O, and N becomes A again. Digits, spaces, punctuation and letter case are left untouched.

Because the alphabet has 26 letters, rotating by 13 twice brings you back to the start. That makes ROT13 its own inverse: the same operation encodes and decodes. It is a special case of the Caesar cipher with a shift of 13.

The ROT13 table#

LetterABCDEFGHIJKLM
ROT13NOPQRSTUVWXYZ

The table works in both directions: the first half of the alphabet swaps with the second half. Lowercase letters follow the same pattern.

ROT5, ROT18 and ROT47#

VariantWhat it rotatesShiftHello 123 becomes
ROT13Letters A–Z, a–z13 of 26Uryyb 123
ROT5Digits 0–95 of 10Hello 678
ROT18Letters (ROT13) and digits (ROT5)13 + 5Uryyb 678
ROT47All printable ASCII from ! to ~47 of 94w6==@ `ab

All four are self-inverse, because each one rotates by exactly half the size of its alphabet.

Where ROT13 is used#

  • Spoilers and puzzle answers: it started on Usenet in the early 1980s, so readers had to choose to decode a joke punchline or a film ending.
  • Hiding text from casual reading: for example email addresses in old web pages, or answers in programming exercises.
  • Teaching: it is the classic first example of a substitution cipher.
  • Software Easter eggs: Windows stores some registry entries (UserAssist) in ROT13, and Unix systems often ship a rot13 command or alias.

ROT13 is not encryption. There is no key and only one way to "decode", so anyone can read ROT13 text in a second. Never use it to protect passwords or personal data.

ROT13 in code#

JavaScript#

javascript
const rot13 = (s) =>  s.replace(/[a-z]/gi, (c) => {    const base = c <= 'Z' ? 65 : 97;    return String.fromCharCode(((c.charCodeAt(0) - base + 13) % 26) + base);  }); rot13('Hello, World!'); // "Uryyb, Jbeyq!"

Python#

python
import codecs codecs.encode('Hello, World!', 'rot13')   # 'Uryyb, Jbeyq!'

PHP#

php
echo str_rot13('Hello, World!');   // Uryyb, Jbeyq!

Command line#

bash
echo 'Hello, World!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'   # Uryyb, Jbeyq! # ROT18 (letters + digits)echo 'Order 66' | tr 'A-Za-z0-9' 'N-ZA-Mn-za-m5-90-4'  # Beqre 11

Common errors and fixes#

  • The digits in my text did not change

    Plain ROT13 only rotates letters. Choose ROT18 (letters and digits) or ROT5 (digits only), or use ROT47 to also rotate punctuation.

  • The result is still unreadable after decoding

    The text was probably encoded with a different rotation. Check the Every ROT variant panel, or try the Caesar cipher solver, which tests every possible shift.

  • Accented letters such as é or ü did not change

    ROT13 is defined only for the 26 basic Latin letters. Accented and non-Latin characters are left as they are, in every standard implementation.

  • tr gives a different result on my system

    Some tr versions treat ranges by locale. Run it with LC_ALL=C in front of the command so A-Z means exactly the 26 ASCII letters.

Frequently asked questions#

How do I decode ROT13?

Apply ROT13 again. Shifting by 13 twice moves each letter 26 places, back to where it started, so encoding and decoding are the same operation.

Is ROT13 secure?

No. It has no key and is trivially reversed. It only hides text from accidental reading, such as spoilers.

What is the difference between ROT13 and ROT47?

ROT13 rotates only letters. ROT47 rotates all 94 printable ASCII characters, including digits and punctuation, by 47 places, so the result looks much more scrambled.

What are ROT5 and ROT18?

ROT5 rotates the digits 0–9 by 5 places. ROT18 combines ROT13 for letters with ROT5 for digits. Both are self-inverse, like ROT13.

Is ROT13 a Caesar cipher?

Yes. ROT13 is a Caesar cipher with a shift of 13, the one shift that is its own inverse in a 26-letter alphabet.

Is my text uploaded?

No. The rotation runs entirely in your browser.

Your next tool is one search away.

Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.

Browse all tools

Tip: press Ctrl D to bookmark dev247.