Free ROT13 decoder and encoder. Decode or encode ROT13 instantly in your browser, use any Caesar shift 1–25, and brute-force all 26 shifts at once.
ROT13 is a letter–substitution cipher that rotates every letter 13 places through the 26–letter alphabet: A becomes N, B becomes O, and Z wraps around to M. This ROT13 decoder and encoder applies that transformation instantly as you type, in your browser, with nothing uploaded to a server. Because 13 is exactly half of 26, the same operation both encodes and decodes — so there is only one button to press and no way to get the direction wrong.
The tool is not limited to ROT13. The shift slider covers every Caesar shift from 0 to 25, with one–click presets for ROT13 (shift 13) and the classical Caesar cipher (shift 3), a separate encode/decode mode, an option to rotate digits alongside letters, and a brute–force panel that shows all 26 possible decodings of your text at once. If you have a string from a CTF challenge, a puzzle, or a geocache hint and you do not know the shift, the brute–force view hands you the answer without any guessing.
Punctuation, spaces and symbols always pass through untouched, and capitalisation is preserved: an uppercase letter stays uppercase after rotation.
Every letter is paired with the one 13 places away, and each pair swaps in both directions. That is what makes ROT13 an involution — a function that is its own inverse.
| Plain | 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 |
| Plain | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
| ROT13 | A | B | C | D | E | F | G | H | I | J | K | L | M |
Read either half of the table in either direction — the mapping is identical both ways. Worked examples: Hello World! becomes Uryyb Jbeyq!, and running Uryyb Jbeyq! through the tool again returns Hello World!. The phrase Encrypted in a simple cipher becomes Rapelcgrq va n fvzcyr pvcure. Note how the exclamation mark, the spaces and the capital letters survive intact — only the 52 letter characters are touched.
Assign each letter a number, A = 0 through Z = 25. Encoding with a Caesar shift of n is E(x) = (x + n) mod 26 and decoding is D(x) = (x − n) mod 26. Set n = 13 and apply it twice:
(x + 13 + 13) mod 26 = (x + 26) mod 26 = x mod 26 = x
The two shifts cancel exactly, because 26 is congruent to 0 modulo 26. Thirteen is the only non–zero shift with this property — the unique non–identity involution in the cyclic group of order 26. Every other Caesar shift needs a separate decode step and you must remember which direction you were going. That is the entire practical advantage of ROT13 over its 24 siblings, and it is why the convention stuck: one operation, no key to track, no direction to get wrong.
This distinction matters more than any other on this page. Encryption depends on a secret key that the attacker does not possess. ROT13 has no key at all: the shift is fixed, public and universally known, so anyone who recognises the cipher reverses it in seconds. What ROT13 provides is obfuscation — it stops text from being read accidentally, which is a genuine and useful property, but it stops nobody who is actually looking.
The wider Caesar family is barely better. With only 25 usable shifts, exhaustive search is trivial — the brute–force panel in this tool performs exactly that attack and displays all 26 candidate plaintexts at once. Even without brute force, frequency analysis breaks it immediately: English text is roughly 12.7% E, 9.1% T and 8.2% A, and a Caesar shift preserves that distribution perfectly while relabelling it. Under ROT13, R carries E’s 12.7%, G carries T’s 9.1%, and N carries A’s 8.2%. Count the letters, find the offset, done. Arab mathematicians worked this out in the ninth century; it has not been a secure technique for over a millennium.
| Property | ROT13 | Caesar cipher | Atbash | AES–256 |
|---|---|---|---|---|
| Type | Fixed substitution, shift 13 | Substitution, shift 1–25 | Substitution, mirror A↔Z | Block cipher with key schedule |
| Key | None — shift is public | The shift value | None — mapping is public | 256–bit secret key |
| Key space | 1 | 25 usable shifts | 1 | 2256 |
| Self–inverse? | Yes | No, except shift 13 | Yes | No — distinct encrypt/decrypt |
| Affects | Letters A–Z only | Letters A–Z only | Letters A–Z only | Arbitrary binary data |
| How it breaks | Recognise it — instant | Brute–force 25 keys, or frequency analysis | Recognise it — instant | No known practical attack |
| Provides security? | No | No | No | Yes |
| Real use | Hiding spoilers and punchlines | Teaching, puzzles, history | Teaching, puzzles, biblical texts | Protecting confidential data |
Key space is not the only axis on which modern ciphers pull away. A real algorithm is built for diffusion and confusion — the two design goals Claude Shannon formalised in 1945. Diffusion spreads the influence of every plaintext bit across the whole ciphertext, and confusion makes the relationship between key and output as tangled as possible, which together produce the avalanche effect: change one bit of input and roughly half the output bits flip. ROT13 has neither property. Its mapping is perfectly local and perfectly stable — A is always N, in every message, forever — which is exactly what makes pattern analysis work against it and useless against AES. Modern schemes also add guarantees ROT13 has no concept of: authentication and integrity, so tampering is detected rather than silently accepted, and forward secrecy in protocols like TLS, so compromising one session key does not retroactively expose earlier ones.
The classical three differ only in which fixed pattern they use; none has meaningful key space, so none provides security. AES–256 differs on the single axis that matters: a 256–bit secret key yields roughly 1077 possible transformations, so knowing the algorithm tells an attacker nothing without the key. That gap — a handful of guessable arrangements versus an astronomically large keyed space — is the entire difference between obfuscation and encryption. Atbash, incidentally, is the other keyless involution: it mirrors the alphabet so A becomes Z and B becomes Y. It is an ancient Hebrew cipher that appears in the Book of Jeremiah, where ROT13 is a 1980s Usenet convention, but cryptographically the two are equally empty.
The Caesar cipher is the ancestor. Suetonius records that Julius Caesar protected military correspondence around 58 BC by shifting each letter three places — A to D, B to E. It worked at the time not because it was strong but because literacy was rare and cryptanalysis did not yet exist as a discipline. Once frequency analysis was developed, simple substitution was finished as a security technique, and the arms race moved on to polyalphabetic schemes like Vigenère, then to rotor machines like Enigma, and eventually to the keyed algorithms in use today.
ROT13 arrived in that lineage as a convention rather than a cipher. Usenet users adopted it around 1982–1983 in newsgroups such as net.jokes as a standard way to hide punchlines and potentially offensive material behind a deliberate decode step. The Unix one–liner tr 'A-Za-z' 'N-ZA-Mn-za-m' made applying it effortless on any terminal, and the convention outlived the newsgroups that created it.
Native spoiler markup now exists on most platforms — Discord’s ||spoiler||, Reddit’s >!spoiler!<, the HTML <details> element — and where it exists it is the better choice. ROT13 persists because it needs no platform support at all: it works in plain–text email, in code comments, in an IRC channel, and in decades of archived content that already uses it.
Never for anything that must stay confidential. Passwords, personal data, financial records, health information and credentials require real encryption — AES–256 or equivalent. ROT13 cannot authenticate a sender, cannot detect tampering, and cannot protect a secret embedded in code or configuration; obscuring a hardcoded credential with it provides precisely zero protection against anyone who reads the file. No regulatory framework — HIPAA, PCI DSS, GDPR — recognises it as encryption, so using it in place of encryption is a compliance finding waiting to happen. Reach for the Hash Generator for integrity checks and a proper symmetric cipher for confidentiality; ROT13’s only correct application is voluntary obfuscation. It is equally wrong for anything that must stay secret over time: even mundane information with a long secrecy requirement needs real encryption, because ROT13 buys you nothing but the seconds it takes a reader to recognise the pattern.
Two misconceptions are worth naming directly. The first is that ROT13 offers “a bit” of security — it offers none; the only thing it stops is an unintentional glance. The second is that ROT13 is obsolete. It was never viable as encryption, so it cannot have become obsolete at a job it never did; for the job it actually does — voluntary, reversible obfuscation that works in any medium that carries text — it remains perfectly adequate and is still in daily use.
| Variant | What it rotates | Self–inverse? |
|---|---|---|
| ROT13 | Letters A–Z by 13 | Yes |
| ROT5 | Digits 0–9 by 5 | Yes |
| ROT18 | ROT13 on letters plus ROT5 on digits | Yes |
| ROT47 | 94 printable ASCII characters (! to ~) by 47 | Yes |
All four are self–inverse for the same modular reason, and none of them adds security — they simply extend the obfuscation to more character classes. Turning off “Preserve Numbers” in the tool above rotates digits alongside letters, giving you the ROT18 behaviour when the shift is 13.
| Language | One–liner |
|---|---|
| Shell | tr 'A-Za-z' 'N-ZA-Mn-za-m' |
| Python | codecs.encode(text, 'rot_13') |
| JavaScript | s.replace(/[a-z]/gi, c => String.fromCharCode((c.charCodeAt(0) & 96) + (c.toLowerCase().charCodeAt(0) - 84) % 26)) |
| PHP | str_rot13($text) |
| Vim | g?G (or g? with any motion) |
| Emacs | M-x rot13-region |
Writing your own is a standard exercise: for each character, if it is a letter, find its 0–25 position, add 13, take the result modulo 26, and map back to a letter; otherwise pass it through unchanged. Handle uppercase and lowercase from separate base values so capitalisation survives.
If your ciphertext is not ROT13, the neighbouring tools will place it. The Caesar Cipher tool focuses on arbitrary shifts with automatic key detection. The Cipher Identifier analyses an unknown ciphertext and suggests which classical scheme produced it — the right first stop when brute–forcing 26 shifts yields nothing readable. The Atbash Cipher tool handles the mirrored alphabet, the Vigenère Cipher tool covers keyword–based polyalphabetic substitution, and the XOR Cipher tool steps up to byte–level operations. All of them are in the free security tools collection.
ROT13 is a substitution cipher that replaces every letter with the one 13 places further along the alphabet, wrapping around at Z. A becomes N, N becomes A, and non–letter characters are unchanged. It is a Caesar cipher with the shift permanently fixed at 13, and it is used for obfuscation — hiding spoilers and puzzle answers — not for security.
Apply ROT13 again. Because the cipher is its own inverse, encoding and decoding are the same operation, so pasting encoded text into the decoder above with the shift at 13 returns the original. On the command line, tr 'A-Za-z' 'N-ZA-Mn-za-m' does the same job.
No. Encryption relies on a secret key that the attacker lacks; ROT13 has no key at all. It is a single fixed, publicly known transformation, so anyone who recognises it reverses it instantly. It is obfuscation — it prevents accidental reading and nothing more.
Because 13 is exactly half of 26. Shifting 13 places twice gives a total shift of 26, which wraps completely around to the original letter, so the same operation encodes and decodes. It is the only non–trivial Caesar shift with this self–reversing property.
ROT13 is a Caesar cipher, with the shift fixed at 13. A general Caesar cipher can use any shift from 1 to 25, and that shift acts as a key you must know to decode. ROT13 fixes and publishes the shift, so there is no key and no separate decode step. Every ROT13 is a Caesar cipher; almost no Caesar cipher is ROT13.
Brute force it — there are only 25 possibilities. Paste the ciphertext into the tool above and open the brute–force panel to see all 26 shifts decoded at once, then pick the one that reads as English. For longer texts, frequency analysis reaches the same answer directly: the most common ciphertext letter almost always maps from E.
Both are keyless self–inverse substitution ciphers, but the mapping differs. ROT13 shifts each letter 13 places, so A becomes N. Atbash mirrors the alphabet, so A becomes Z, B becomes Y and C becomes X. Atbash is far older — it appears in the Book of Jeremiah — while ROT13 dates from 1980s Usenet. Neither offers any security.
Standard ROT13 rotates only the letters A–Z and a–z; digits, spaces, punctuation and symbols pass through unchanged, and capitalisation is preserved. This tool can optionally rotate digits as well — uncheck “Preserve Numbers” — which reproduces the ROT18 variant.
No, never. It provides no protection for passwords, personal data, financial details or credentials, and no compliance framework accepts it as encryption. Use AES–256 or another modern algorithm for anything that must remain confidential.
Its legitimate uses are all non–cryptographic: hiding spoilers and puzzle solutions in forums, gating an offensive joke behind a deliberate decode step, hiding geocaching hints, lightly obscuring an email address from simple scrapers, and teaching cryptography fundamentals. In every case the goal is preventing accidental reading, not stopping a determined reader. This tool is free, needs no signup, and runs entirely in your browser, so nothing you encode leaves your machine.
Not sure which cipher you have? Use the Cipher Identifier to auto-detect cipher types from unknown ciphertext using frequency analysis and Index of Coincidence.
ROT13 ("rotate by 13 places") is a special case of the Caesar cipher that shifts each letter exactly 13 positions in the 26-letter English alphabet. Because 13 is exactly half of 26, applying ROT13 twice returns the original text — making the same operation serve as both encryption and decryption. This self-inverse property makes ROT13 uniquely convenient among Caesar cipher variants.
ROT13 provides zero cryptographic security. Its sole purpose is casual obfuscation — hiding text from accidental reading without any pretense of keeping it secret from anyone who makes even minimal effort. Despite this, ROT13 has found enduring use in Internet culture for hiding spoilers, punchlines, puzzle answers, and mildly sensitive content.
Each letter is replaced by the letter 13 positions after it in the alphabet. Non-alphabetic characters (numbers, punctuation, spaces) are unchanged:
| Original | A | B | C | D | E | ... | M | N | O | P | ... | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ROT13 | N | O | P | Q | R | ... | Z | A | B | C | ... | L | M |
Example: "HELLO WORLD" → "URYYB JBEYQ"
| Variant | Applies To | Shift | Self-Inverse |
|---|---|---|---|
| ROT13 | Letters (A-Z) | 13 | Yes — applying twice returns original |
| ROT5 | Digits (0-9) | 5 | Yes — applying twice returns original |
| ROT18 | ROT13 + ROT5 | 13 for letters, 5 for digits | Yes |
| ROT47 | ASCII 33-126 | 47 | Yes — covers all printable ASCII |
ROT13 is not encryption and provides no security whatsoever. It must never be used to protect sensitive data. Key weaknesses:
ROT13 ("rotate by 13 places") is a simple letter substitution cipher that replaces each letter with the letter 13 positions after it in the alphabet. It works by: (1) Taking each letter A-Z, (2) Rotating it 13 positions forward (A→N, B→O, C→P... M→Z, N→A...), (3) Leaving non-alphabetic characters unchanged. ROT13 is self-reciprocal - applying it twice returns the original text. Example: "Hello World" → "Uryyb Jbeyq" → "Hello World". ROT13 is NOT encryption - it provides zero security and can be instantly reversed. It's commonly used to obscure spoilers, puzzle solutions, offensive content, and email addresses from spam bots. Think of ROT13 as a "content warning" rather than security measure.
The Caesar cipher is a substitution cipher named after Julius Caesar, who reportedly used it for military communications. It shifts each letter by a fixed number of positions (the key). Caesar historically used a shift of 3 (A→D, B→E, C→F). ROT13 is a specific Caesar cipher with a shift of 13. Key characteristics: Simple substitution - Each letter maps to exactly one other letter. Symmetric - ROT13 is its own inverse (13 + 13 = 26 = full alphabet). Easily broken - Only 25 possible keys (ROT1 through ROT25), making brute force trivial. Historical significance - One of the oldest known ciphers, used for over 2000 years. The Caesar cipher is completely insecure by modern standards but remains important for understanding cryptography fundamentals. It's vulnerable to frequency analysis and brute force attacks.
Absolutely not! ROT13 provides ZERO security and should never be used for protecting sensitive information. Here's why it's completely insecure: (1) Trivial to reverse - ROT13 is its own reverse, anyone can decode it instantly. (2) No key - There's no secret, everyone knows how ROT13 works. (3) Pattern preservation - Word lengths and patterns remain visible. (4) Frequency analysis - Letter frequency remains unchanged, making it vulnerable. Appropriate uses for ROT13: Hiding spoilers in discussions, Obscuring puzzle answers, Content warnings (offensive text), Basic email obfuscation (weak spam bot protection). For actual security, use modern encryption: AES-256 for data encryption, TLS/SSL for communications, Proper password hashing (bcrypt/Argon2). ROT13 is educational and fun, but never mistake it for security.
Frequency analysis is a cryptanalysis technique that exploits the fact that letters appear with predictable frequencies in natural language. In English: Common letters - E (12.7%), T (9.1%), A (8.2%), O (7.5%). Rare letters - Z (0.07%), Q (0.10%), X (0.15%). To break substitution ciphers: (1) Count letter frequencies in the ciphertext, (2) Compare to known language frequencies, (3) Map most common cipher letters to most common plain letters, (4) Look for common patterns (TH, HE, AN, THE, AND), (5) Gradually reveal the plaintext. Example: If "X" appears 13% of the time in ciphertext, it's likely "E" in plaintext. This technique breaks all simple substitution ciphers including Caesar cipher and ROT13 (though ROT13 is even easier - just rotate). Frequency analysis was discovered by Arab mathematician Al-Kindi in the 9th century and rendered substitution ciphers obsolete for security.
Several methods can detect the rotation key: Method 1: Brute Force - Only 25 possible rotations (ROT1-ROT25), try them all and look for readable text. Takes seconds manually, instant with tools. Method 2: Frequency Analysis - Compare letter frequencies to English. The rotation where frequencies match best is likely correct. Method 3: Common Words - Look for common English words (THE, AND, FOR) in each rotation. Method 4: Index of Coincidence - Statistical measure of letter distribution. English text has IC ≈ 0.067, random text ≈ 0.038. Try all rotations and pick the one with IC closest to 0.067. Method 5: Pattern Recognition - Look for common patterns like "TH", "ING", "TION". This tool can automatically detect the most likely rotation by testing all 25 possibilities and scoring each based on English language patterns and letter frequencies.
ROT13 is widely used for non-security text obfuscation: Usenet and Forums - Hiding spoilers for movies, TV shows, books (established in 1980s). Puzzle Communities - Geocaching hints, puzzle solutions, riddles. Reddit - r/riddles and puzzle subreddits use ROT13 for answers. Email Obfuscation - Weak protection against spam harvesters (email@example.com → rznvy@rknzcyr.pbz). Content Warnings - Offensive jokes, adult content warnings. Easter Eggs - Hidden messages in source code or websites. Historical note: ROT13 became standard in Usenet newsgroups because early news readers had built-in ROT13 decode features, making it trivial for readers to decode spoilers when ready but hiding them from accidental viewing. Modern use continues this tradition of "soft hiding" rather than real security.
Several historical substitution ciphers share similarities with ROT13: Atbash - Reverses alphabet (A→Z, B→Y, C→X). Ancient Hebrew cipher, equally insecure. ROT5/ROT18/ROT47 - ROT5 rotates digits, ROT18 = ROT13+ROT5, ROT47 rotates ASCII printable characters. Affine Cipher - Uses mathematical formula: E(x) = (ax + b) mod 26. More keys than Caesar but still breakable. Substitution Cipher - Arbitrary letter mapping (not just rotation), 26! possible keys but vulnerable to frequency analysis. Vigenère Cipher - Uses multiple Caesar shifts based on keyword. More secure than simple substitution but still breakable with enough text. All these ciphers are broken by modern standards and provide no real security. They're primarily educational or used for puzzles and games. For a comprehensive look at modern cryptography, see ciphers like AES, RSA, and elliptic curve cryptography.
Yes! ROT13 is based on modular arithmetic: Mathematical Definition: E(x) = (x + 13) mod 26, D(x) = (x - 13) mod 26, where x is the letter position (A=0, B=1, ... Z=25). Self-Inverse Property: ROT13 applied twice returns original text because: (x + 13 + 13) mod 26 = (x + 26) mod 26 = x. This makes ROT13 its own inverse (E = D). Algebraic Structure: ROT13 is an involution in the cyclic group Z₂₆. It belongs to the symmetric group of letter permutations. General Caesar Cipher: E(x) = (x + k) mod 26, where k is the key (1-25). ROT13 is special case where k=13, making it self-reciprocal. This mathematical foundation extends to more complex ciphers: Affine ciphers use E(x) = (ax + b) mod 26, Hill cipher uses matrix multiplication mod 26, Vigenère uses polyalphabetic substitution. Understanding ROT13's math provides foundation for studying modern cryptographic algorithms.
ROT13 decodes by applying the same transformation again - rotate each letter 13 positions in the alphabet. Since the alphabet has 26 letters, applying ROT13 twice returns the original text. Use our ROT13 cipher tool to instantly encode or decode any text.