Skip to main content

    ROT13 Encoder / Decoder

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

    No signup. 100% private. Processed in your browser.

    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