PureDevTools

ROT13 Encoder / Decoder

Encode and decode text with the ROT13 letter substitution cipher

All processing happens in your browser. No data is sent to any server.

0 characters

Type or paste text above to see the ROT13-transformed result. ROT13 is its own inverse — apply it twice to get the original text back.

You’re reading through a forum thread and someone posted a spoiler wrapped in ROT13. Or you’re looking at an old Usenet archive where punchlines and puzzle answers were routinely obfuscated with ROT13(). You need to decode it — quickly, without installing anything.

What Is ROT13?

ROT13 (“rotate by 13 places”) is a specific instance of the Caesar cipher that shifts each letter of the Latin alphabet by 13 positions. Because the alphabet has 26 letters, applying ROT13 twice returns the original text — making the same operation both the encoder and decoder.

Plain:    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher:   N O P Q R S T U V W X Y Z A B C D E F G H I J K L M

The mapping is case-preserving: uppercase letters stay uppercase, lowercase stay lowercase. Non-alphabetic characters — digits, punctuation, spaces, Unicode — pass through unchanged.

Input:  Hello, World! 123
Output: Uryyb, Jbeyq! 123

History and Origin

ROT13 became popular on Usenet newsgroups in the early 1980s as a lightweight way to hide spoilers, offensive jokes, and puzzle answers. The rot13 command was included in early BSD Unix distributions (4.2BSD, 1983), and the tr command made it trivial:

echo "Hello" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
# Uryyb

Unlike real encryption, ROT13 was never intended to provide security. Its purpose is social: to prevent accidental reading of text that the viewer must deliberately choose to decode. The Usenet convention was explicit — if you saw ROT13: in a post, you knew you were opting in to read the content.

ROT13 vs Other Caesar Cipher Shifts

The Caesar cipher is a family of substitution ciphers parametrized by a shift value (1–25). ROT13 is special because shift-13 is its own inverse — no separate decode operation is needed. Any other shift value (e.g., ROT1, ROT5, ROT7) requires a different shift to reverse.

ShiftEncode “ABC”Self-inverse?
ROT1BCDNo (needs ROT25)
ROT5FGHNo (needs ROT21)
ROT13NOPYes

This self-inverse property is the reason ROT13 became the convention rather than any other shift — it simplifies tooling, reduces mistakes, and means a single button does both operations.

ROT13 in Modern Software

Despite its simplicity, ROT13 still appears in modern codebases:

When NOT to Use ROT13

ROT13 provides zero cryptographic security. It is trivially broken by anyone who recognizes the pattern (or tries all 25 Caesar shifts in under a second). Never use ROT13 for:

For real encryption, use AES-GCM, ChaCha20-Poly1305, or another authenticated encryption algorithm. ROT13 is for social obfuscation only.

Implementation Details

The JavaScript implementation in this tool maps each character through a lookup:

function rot13(str) {
  return str.replace(/[A-Za-z]/g, c => {
    const base = c <= 'Z' ? 65 : 97;
    return String.fromCharCode(((c.charCodeAt(0) - base + 13) % 26) + base);
  });
}

This is O(n) in string length with no memory overhead. The tool processes input in real time as you type. No data is sent to any server.

Variants: ROT5, ROT18, ROT47

This tool implements standard ROT13 (letters only), which is the most widely recognized variant.

Related Tools

More Encoding & Crypto Tools