Encode a greeting
Hello, World!
Uryyb, Jbeyq!
Letters move 13 places; the comma, space and ! stay as they are, and so does the letter case.
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.
Every ROT variant
Hello, World!
Uryyb, Jbeyq!
Letters move 13 places; the comma, space and ! stay as they are, and so does the letter case.
Jul qvq gur puvpxra pebff gur ebnq?
Why did the chicken cross the road?
Decoding is the same operation as encoding.
Order 66
Beqre 11
ROT18 is ROT13 for letters plus ROT5 for digits, so 6 becomes 1.
Call 555-0123
Call 000-5678
Each digit moves 5 places (5 → 0, 0 → 5); letters are left alone.
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.
| Letter | A | B | C | D | E | F | G | H | I | J | K | L | M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ROT13 | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
The table works in both directions: the first half of the alphabet swaps with the second half. Lowercase letters follow the same pattern.
| Variant | What it rotates | Shift | Hello 123 becomes |
|---|---|---|---|
| ROT13 | Letters A–Z, a–z | 13 of 26 | Uryyb 123 |
| ROT5 | Digits 0–9 | 5 of 10 | Hello 678 |
| ROT18 | Letters (ROT13) and digits (ROT5) | 13 + 5 | Uryyb 678 |
| ROT47 | All printable ASCII from ! to ~ | 47 of 94 | w6==@ `ab |
All four are self-inverse, because each one rotates by exactly half the size of its alphabet.
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.
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!"import codecs codecs.encode('Hello, World!', 'rot13') # 'Uryyb, Jbeyq!'echo str_rot13('Hello, World!'); // Uryyb, Jbeyq!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 11The 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.
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.
No. It has no key and is trivially reversed. It only hides text from accidental reading, such as spoilers.
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.
ROT5 rotates the digits 0–9 by 5 places. ROT18 combines ROT13 for letters with ROT5 for digits. Both are self-inverse, like ROT13.
Yes. ROT13 is a Caesar cipher with a shift of 13, the one shift that is its own inverse in a 26-letter alphabet.
No. The rotation runs entirely in your browser.
Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.
Tip: press Ctrl D to bookmark dev247.