Skip to main content

    ROT13 Encoder / Decoder

    Encode or decode text using the ROT13 cipher. Apply it twice to get the original text back.

    Free to use. Runs in your browser.

    Paste text to apply the ROT13 Caesar cipher, each letter is shifted 13 places. Applying ROT13 twice returns the original text. Commonly used for spoilers and puzzle answers.

    Input

    ROT13 Output

    How it works: Each letter is shifted 13 positions in the alphabet. Since there are 26 letters, applying ROT13 twice returns the original text. Numbers and special characters are unchanged.

    ROT13: The Simplest Cipher

    ROT13 is a letter substitution cipher that replaces each letter with the one 13 positions later in the alphabet. A becomes N, B becomes O, C becomes P, and so on. Since the English alphabet has 26 letters, applying ROT13 twice gives you back the original text, it's its own inverse.

    ROT13 isn't encryption, it provides zero security against anyone who knows what it is (which is everyone). It's a spoiler tag for text. Usenet newsgroups used it in the 1980s and 90s to hide punchlines, puzzle solutions, and movie spoilers. Today you'll still see it used in forums, CTF challenges, and as the canonical example of a Caesar cipher in computer science courses.

    The beauty of ROT13 is its symmetry: encode and decode are the same operation. Paste encoded text, get the original. Paste plain text, get the encoded version. The same button does both.

    ROT13 Alphabet Mapping

    OriginalA-MN-Z
    InputA B C D E F G H I J K L MN O P Q R S T U V W X Y Z
    OutputN O P Q R S T U V W X Y ZA B C D E F G H I J K L M

    What this means for you: Each letter swaps with its partner 13 positions away. A↔N, B↔O, C↔P... The mapping is perfectly symmetrical, which is why encoding equals decoding. Numbers, spaces, and punctuation are unchanged.

    Caesar Ciphers and ROT Variants

    CipherShift"HELLO" BecomesUsed For
    ROT11IFMMPEducational examples
    ROT33KHOOROriginal Caesar cipher
    ROT55 (digits only)N/A (affects 0-9)Obscuring phone numbers
    ROT1313URYYBText spoiler hiding (self-inverse)
    ROT4747 (ASCII 33-126)w6{{~Obscuring all printable ASCII

    What this means for you: ROT13 is special because 13 is exactly half of 26 (the alphabet size), making it self-inverse. No other ROT value has this property for the English alphabet. ROT47 extends the concept to all printable ASCII characters.

    Where You'll Encounter ROT13

    CTF challenges

    Capture The Flag competitions frequently use ROT13 as a warm-up challenge or as one layer in a multi-step decoding puzzle. If you see text that looks like garbled English, try ROT13 first, it's the most common simple encoding in CTFs.

    Forum spoiler tags

    Before HTML spoiler tags existed, Usenet and early forums used ROT13 to hide spoilers. You had to deliberately decode the text to read it. The convention persists in some communities and mailing lists.

    Programming interviews

    Implementing ROT13 is a classic interview question that tests string manipulation, character codes, and modular arithmetic. The one-liner version in most languages is surprisingly elegant.

    Email address obfuscation

    Some websites encode email addresses with ROT13 in HTML to deter simple spam bots, then decode them with JavaScript when displayed. It's slightly better than plain text, though modern bots handle it easily.

    ROT13 One-Liners by Language

    LanguageImplementation
    JavaScripts.replace(/[a-z]/gi, c => String.fromCharCode(c.charCodeAt(0) + (c.toLowerCase() < 'n' ? 13 : -13)))
    Pythonimport codecs; codecs.encode(s, 'rot_13')
    Bashecho "text" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
    Rubys.tr('A-Za-z', 'N-ZA-Mn-za-m')
    PHPstr_rot13($s)

    Python and PHP have built-in ROT13 functions, that's how common it is. The Bash tr approach is the classic Unix way and works in any terminal.

    Related Tools

    How to use this tool

    1

    Paste or type text in the input panel

    2

    The ROT13 output appears instantly in the right panel

    3

    Paste ROT13 text to decode it, encoding and decoding are the same

    Common uses

    • Hiding spoilers in text-based forums and messages
    • Solving CTF and puzzle challenges
    • Learning about substitution ciphers in CS courses
    • Obfuscating text in a reversible, recognisable way

    Share this tool

    Frequently Asked Questions

    What is ROT13?
    ROT13 is a letter substitution cipher that shifts each letter 13 positions in the alphabet. A becomes N, B becomes O, and so on. Since the alphabet has 26 letters, applying ROT13 twice gives you back the original text, encoding and decoding are the same operation.
    Is ROT13 secure?
    No. ROT13 provides zero security, it's trivially reversible by anyone who knows what it is (which is everyone in tech). It's an obfuscation tool, not encryption. Think of it as putting a spoiler behind a curtain, not locking it in a safe.
    Is my text sent to a server?
    No. The conversion uses a simple character-by-character JavaScript function in your browser. Nothing is transmitted, stored, or logged. The tool works completely offline.
    Why is ROT13 special among Caesar ciphers?
    Because 13 is exactly half of 26 (the English alphabet size). This makes it self-inverse, the same function encodes and decodes. No other shift value has this property. ROT1 encoding needs ROT25 to decode; ROT13 needs just ROT13 again.
    What happens to numbers and punctuation?
    They're unchanged. ROT13 only affects letters A-Z and a-z. Numbers, spaces, punctuation, and symbols pass through unmodified. This is standard for all ROT13 implementations.
    Where is ROT13 actually used?
    Historically, Usenet newsgroups used it for spoiler text. Today it appears in CTF (Capture The Flag) competitions, programming puzzles, email obfuscation, and as the go-to example of a Caesar cipher in computer science courses.
    What's a Caesar cipher?
    A substitution cipher that shifts letters by a fixed number. Named after Julius Caesar, who reportedly used a shift of 3 (A→D, B→E). ROT13 is a Caesar cipher with shift 13. All Caesar ciphers are trivially breakable, there are only 25 possible shifts to try.
    Can I decode text I didn't encode?
    If you suspect text is ROT13 encoded, paste it in. If it becomes readable English, it was ROT13. If it stays garbled, it's encoded with something else (or it's not English). The reversible nature of ROT13 means you can always try it non-destructively.
    How is ROT13 implemented in code?
    The one-liner in most languages maps each letter through the 13-shift. In JavaScript: text.replace(/[a-zA-Z]/g, c => String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c.charCodeAt(0) + 13) ? c.charCodeAt(0) + 13 : c.charCodeAt(0) - 13)). It's a classic interview question.
    What's ROT47?
    ROT47 extends the concept to all printable ASCII characters (94 characters from ! to ~), shifting by 47. It encodes numbers and symbols too, not just letters. 'Hello 123!' becomes 'w6==~ `abP'. More comprehensive than ROT13 but less commonly used.
    Is ROT13 case-sensitive?
    ROT13 preserves case. Uppercase A-M maps to N-Z (and vice versa). Lowercase a-m maps to n-z (and vice versa). 'Hello' becomes 'Uryyb', the capitalisation pattern is maintained.
    Why do I see ROT13 in CTF competitions?
    CTF challenges use ROT13 as a warm-up or as one layer in multi-step decoding puzzles. If you encounter text that looks like garbled English (recognisable word patterns but wrong letters), try ROT13 first, it's the most common simple encoding in CTF events.

    Results are for general informational purposes only and should be checked before use. They are not professional advice. See our Disclaimer and Terms of Service.