ROT13 is a letter substitution that rotates every ASCII uppercase letter A-Z and every ASCII lowercase letter a-z by exactly 13 positions inside its own alphabet while leaving every other UTF-16 code unit exactly where it was, so the same operation encodes and decodes the same text. Apply that mapping twice and every shifted letter returns to its starting value, because the 26-letter alphabet divides evenly into two halves of 13, a symmetric property known as the self-inverse behaviour of ROT13. A quick ROT13 decoder example illustrates it clearly: Hello, World! becomes Uryyb, Jbeyq! — the H moves to U, the e to r, the l to y, the o to b, the W to J, the r to e, and the d to q — while the comma, space, and exclamation mark pass through untouched in their original positions. Mixed content behaves the same way: Order #42 — ship by Friday! rotates to Bqre #42 — fuvc ol Sevqny!, because only ASCII letters rotate and the digits 4 and 2, the em dash, and the spaces all stay exactly where they were. That strict, narrow behaviour mirrors the official rot_13 codec shipped with Python's standard library, which the in-browser ROT13 Encoder Decoder applies character by character without trying to interpret the input.

The ROT13 Alphabet Shift at a Glance
Because the alphabet contains 26 letters, ROT13 simply swaps the first half with the second half. Letter A becomes N, B becomes O, C becomes P, and so on through M becoming Z; then the wrap begins, with N mapping back to A, O to B, and Z to M. The lowercase alphabet behaves independently in exactly the same way, so a maps to n, b to o, m to z, n to a, and z to m. The tool applies the two ASCII alphabets separately rather than changing case or consulting any locale-aware alphabet, so uppercase letters always remain uppercase and lowercase letters always remain lowercase.
The mechanics for a single uppercase letter can be written out as a short formula. Take the letter H, which has ASCII code 72. Subtract the uppercase base of 65 to get its alphabet position of 7. Add 13 to that position to get 20. Take 20 modulo 26 (it is already inside the alphabet, so it stays 20). Add the uppercase base of 65 back, giving 85. ASCII code 85 is the letter U, which is exactly what ROT13 produces for H. Lowercase letters follow the same pattern using a base of 97, so h with ASCII code 104 becomes u with ASCII code 117. For a printable lookup of every letter pair, the ROT13 Decoder Cheat Sheet: ASCII Mapping and How to Use It keeps the full ASCII mapping on screen for quick verification.
| Plain | ROT13 | Plain | ROT13 |
|---|---|---|---|
| A | N | N | A |
| B | O | O | B |
| C | P | P | C |
| D | Q | Q | D |
| E | R | R | E |
| F | S | S | F |
| G | T | T | G |
| H | U | U | H |
| I | V | V | I |
| J | W | W | J |
| K | X | X | K |
| L | Y | Y | L |
| M | Z | Z | M |
ROT13 Decoder Example: Before and After Text Pairs
Short, hand-checkable pairs show every important behaviour at a glance. Each pair below uses plain text on the first line and the ROT13 output on the second.
- Hello, World! → Uryyb, Jbeyq! — every ASCII letter rotates (H to U, e to r, l to y, l to y, o to b, W to J, o to b, r to e, l to y, d to q) while the comma, space, and exclamation mark stay put.
- Order #42 — ship by Friday! → Bqre #42 — fuvc ol Sevqny! — only the ASCII letters rotate; the digits 4 and 2, the hash, the em dash, and the spaces all pass through unchanged.
- café → pnsé — c, a, and f are ASCII letters and rotate normally, but é is not an ASCII character, so it stays exactly as it was.
- e followed by U+0301 (combining acute) → r followed by U+0301 — only the ASCII letter e rotates to r; the combining mark stays attached to whatever follows it.
- Hello 🎉 世界 → Uryyb 🎉 世界 — every non-ASCII code unit, including the emoji surrogate pair and the two CJK characters, remains in the same position.
These pairs also make the self-inverse property obvious: applying ROT13 to Uryyb, Jbeyq! reproduces Hello, World! exactly, and applying it again to Bqre #42 — fuvc ol Sevqny! reproduces Order #42 — ship by Friday! exactly. The changed-letter count reported next to the output matches the number of ASCII letters that rotated in each pair: 10 letters in the first, 17 letters in the second, 3 letters in the third, 1 letter in the fourth, and 5 letters in the fifth.
How to Use the ROT13 Encoder Decoder Tool
Paste text, apply ROT13, review the result, then copy or reverse. The tool runs entirely in the current browser tab, so nothing leaves the device until a user explicitly copies the output.
- Open the ROT13 Encoder Decoder in your browser.
- Paste text containing any mix of ASCII letters and other characters into the input area.
- Select Apply ROT13 to trigger the rotation.
- Review the transformed output alongside the count of ASCII letters that changed.
- Copy the result with the copy button, or apply ROT13 again to recover the original text.
Editing the source clears the previous result, statistics, copy status, and any validation error so that stale values cannot mislead a reader. Empty input is rejected before transformation; non-empty input that contains no ASCII letters at all still produces a valid result with a changed count of zero. The input cap is 1,000,000 UTF-16 code units, and one code unit beyond that boundary is rejected before transformation with an explicit message rather than being silently sliced or sampled.
Why One Operation Encodes and Decodes
ROT13 is a special case of the Caesar cipher with a fixed shift of 13. In a 26-letter alphabet, a shift of 13 applied twice equals a shift of 26, which lands every letter back on its starting position. Formally, for any supported letter x, ROT13(ROT13(x)) equals x. This symmetry is what makes the same tool handle both directions, so there is no separate decode button — decoding is just encoding applied to already-encoded text.
The same property also explains why applying ROT13 a third time produces the same output as applying it once, and why applying it any odd number of times produces the encoded form while applying it any even number of times produces the original. Two passes recover the source, four passes produce the source again, and so on. Because the mapping is deterministic and narrow, the browser tool never loses information that was inside the two supported ASCII alphabets.
Characters That Stay Untouched
The mapping is deliberately narrow. Only ASCII uppercase A through Z and lowercase a through z are transformed; every other code unit passes through unchanged in its original position. This strict behaviour matches the official Python rot_13 codec source, which supplies a direct alphabet table cross-check rather than a generic Unicode transform.
| Character class | Example | Behaviour under ROT13 |
|---|---|---|
| ASCII A-Z | ABC, Hello | Each letter shifts to the one 13 positions ahead |
| ASCII a-z | abc, hello | Each letter shifts to the one 13 positions ahead |
| Digits 0-9 | 0, 42, 2024 | Unchanged |
| Common punctuation | ! ? , . : ; ' " | Unchanged |
| Whitespace | space, tab, newline | Unchanged |
| Accented Latin | é, ñ, ü, ç | Unchanged |
| Greek, Cyrillic, Arabic | α, Ж, ع | Unchanged |
| CJK characters | 中, 日本語, 한글 | Unchanged |
| Emoji | 🎉, 🚀 | Unchanged |
| Combining marks | U+0301, U+0302 | Unchanged, attached to whatever code unit follows |
The changed-letter count reported next to the output reflects exactly the rows in the first two groups: it counts only ASCII letters that actually rotated, and it never inflates that number with digits, accents, or other code units. Each matched letter always changes to a different ASCII letter, so the count is also the number of code-unit positions whose value changed. The output length always equals the input length in UTF-16 code units, because every transformed ASCII code unit is replaced by exactly one ASCII code unit and every other code unit is retained.
Practical Uses for ROT13 Decoder Examples
ROT13 has been a fixture of Usenet newsgroups and online forums for decades. Common casual uses include obscuring spoilers so that the answer to a puzzle or the plot of a film does not appear in plain text when a reader scrolls past, hiding punchlines that some readers might prefer not to see accidentally, and making example command lines, file paths, or log snippets uncomfortable to skim during a screenshot or a quick glance. RFC 1855, the Netiquette Guidelines, describes ROT13 as a useful tool for material a reader might choose to avoid seeing by accident.
Beyond the historical cases, ROT13 is a popular teaching example. Beginners learning about substitution ciphers often practise on ROT13 decoder examples because the mapping is small, deterministic, and reversible by inspection. It is also a reliable test fixture for encoder pipelines, character-class regexes, and locale handling, and a quick way to spot whether a piece of code accidentally changes case or strips Unicode characters. Any context that benefits from a reversible, public, keyless transform is a natural fit; any context that needs secrecy is not.
Limits and Security Notes
ROT13 is not secure encryption. It has no key, every transformation uses the same public substitution, and anyone who recognises the pattern can reverse it immediately by applying ROT13 again. It should not be used to protect passwords, API tokens, personal information, private messages, production configuration, or any other secret. It is casual reversible obfuscation and nothing more.
The browser tool also has strict, documented limits. The input cap is 1,000,000 UTF-16 code units, and input at the exact boundary is accepted and transformed in full; one code unit beyond that boundary is rejected before transformation with an explicit message rather than being silently sliced, sampled, or capped. NUL is treated as ordinary string data, not as a C-style terminator. The tool does not implement arbitrary Caesar shifts, ROT5 for digits, ROT18, ROT47, Unicode transliteration, language-aware substitution, compression, or encryption. For a configurable ASCII shift, the Caesar Cipher tool is the right neighbour; for actual confidentiality, an audited cryptographic system is required.
Related reading: Plan the Steps to Use a ROT47 Encoder Decoder.