ROT13 Cipher

ROT13 — the 13-letter Cæsar cipher. Each letter is replaced by the one 13 positions later in the alphabet. Encoding and decoding are the same operation.

Example: Hello WorldUryyb Jbeyq

ROT13 ("rotate by 13") is a Cæsar cipher that shifts every letter by 13 positions in the alphabet. Because the English alphabet has 26 letters, applying ROT13 twice returns the original text — encoding and decoding are the same operation.

It's not real cryptography (anyone can decode it instantly), but it's been the standard way to hide spoilers, punchlines, and answers on Usenet, forums, and chat platforms since the 1980s.

How the encoding works

ROT13 is a special case of the Caesar cipher with a shift of 13. The algorithm iterates over each character in the input string. If the character is an uppercase ASCII letter (AZ, Unicode code points 65–90), it is mapped to the character 13 positions later, wrapping around: new_code = ((old_code - 65 + 13) % 26) + 65. Similarly, lowercase letters (az, code points 97–122) use new_code = ((old_code - 97 + 13) % 26) + 97. All other characters—digits, punctuation, spaces, non-ASCII letters—remain unchanged. Because the alphabet has 26 letters, applying ROT13 twice yields the original text; thus enciphering and deciphering are identical operations. The implementation handles UTF-8 input, but the transformation only affects the Latin alphabet range.

How to use this encoder

  1. Enter or paste your text into the input box.
  2. Click the Encode / Decode button.
  3. The processed text appears instantly in the output area.
  4. Copy the result using the copy button or manual selection.

Edge cases worth knowing

Mixed case
Upper and lower case are preserved; 'Hello' becomes 'Uryyb'.
Non-alphabetic characters
Digits, punctuation, spaces, and symbols are left untouched.
Unicode letters outside A-Z
Only ASCII Latin letters are shifted; accented or non-Latin characters pass through unchanged.
Empty string
Empty input produces empty output.

Encoding pro tips

  • Use ROT13 to hide spoilers or quiz answers in chat messages—recipients can decode with the same tool.
  • Combine with other encoding methods (e.g., Base64) for layered obfuscation (though not security).
  • Test that your input is pure ASCII/Latin; accented characters are not shifted, which may confuse readers.
  • For bulk processing, many text editors (Vim, Emacs) have built-in ROT13 commands.

vs other encoders

ROT13 is trivially reversible, but different approaches exist to achieve the same result.

This toolPython one-linertr command
Ease of useNo setup, instant resultRequires Python installed and command lineRequires Unix shell and tr utility
Case preservationPreserved automaticallyHandled with separate mappingsPreserved when using appropriate character classes
Non-English supportOnly ASCII Latin lettersCan be extended to other alphabetsLimited to ASCII; needs extra scripting

A bit of history

ROT13 emerged in the early 1980s on Usenet, a decentralized bulletin-board system. It was used to obscure potentially offensive jokes, spoilers, or answers to puzzles, allowing readers to choose whether to decrypt. The number 13 was chosen because it is exactly half of 26, making encryption and decryption identical—a convenience for users. While not a secure cipher, ROT13 became a cultural artifact of early online communities, predating modern content-warning systems.

When to use this encoding

Hiding spoilers

Posting a movie or TV plot point? ROT13-encode it. Readers who want the spoiler can decode; everyone else sees gibberish and skips.

Hiding punchlines or jokes

Set up a joke in plain text, ROT13 the punchline. Readers who want it decode; the rest move on.

Solution / answer key

Quiz answers, puzzle solutions, riddle reveals — ROT13 lets you publish the answer below the question without it being visible to skimmers.

Teaching cryptography basics

The simplest possible example of a substitution cipher. Demonstrates the principle without overwhelming the learner.

Light obfuscation in code comments

ROT13'd content in a comment is unsearchable as plain text — useful as a notes-to-self area or to bypass crude content filters.

Encoding FAQ

Is ROT13 secure?

No, not for any real privacy purpose — anyone can decode it in seconds. Use it only for casually hiding content from accidental viewing.

Does it affect numbers and punctuation?

No — only A–Z and a–z are shifted. Numbers, spaces, punctuation, and other characters pass through unchanged.

Why does encoding twice give back the original?

13 + 13 = 26, and 26 mod 26 = 0 — back to the start. ROT13 is its own inverse, which is why both encode and decode use the same operation.

Are there other Caesar ciphers?

ROT13 is one of 25 possible Cæsar ciphers (shifts of 1 through 25). ROT13 is uniquely useful because of the symmetric encode/decode property.

Embed our tools on your website

Free for any site. No signup. Iframe loads from our servers and stays up-to-date automatically.

📋 Embed the Word Counter

Copy this snippet:

Live preview:

📋 Embed this ROT13 Cipher

Copy this snippet:

Live preview:

Want more options? All embeddable tools →