ROT13 Encoder/Decoder

Rotate every letter 13 places through the alphabet, the simple, self-reversing cipher traditionally used to obscure spoilers, puzzle answers, and joke punchlines. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-18

Overview

Introduction

ROT13 has been a running joke and a practical convention on the internet for decades, a lightweight way to hide a spoiler or puzzle answer just enough that you have to make a conscious choice to read it.

What makes it useful beyond the joke: it's completely symmetric. No key to manage or lose, and running the same operation on the ciphertext restores the original text. That property, plus being simple enough to compute by hand, is exactly why it became the de facto standard for hiding spoilers rather than any more robust scheme.

What Is ROT13 Encoder/Decoder?

ROT13 is a Caesar cipher variant that shifts each letter 13 positions through the alphabet, wrapping from Z back to A. Because the alphabet has 26 letters, applying it twice restores the original text.

It's a special case of the general Caesar cipher, which shifts letters by an arbitrary amount. 13 gets chosen specifically because it's half of 26, the size of the English alphabet, which makes the shift its own inverse. Shift by any other amount and you'd need to track that amount separately to decode. Shift by 13 and encoding and decoding become the same operation.

How ROT13 Encoder/Decoder Works

The tool checks each character. Letters shift 13 positions within their case, uppercase stays uppercase, lowercase stays lowercase, using modular arithmetic on their character code. Every non-letter character passes through unchanged.

Case is preserved by using separate base offsets for uppercase and lowercase letters before applying the modular shift, so 'A' rotates within A-Z and 'a' rotates within a-z instead of one bleeding into the other's range. Everything that isn't one of the 26 English letters, digits, punctuation, spaces, accented characters, is left completely untouched, which is why ROT13'd text stays readable as a sentence shape even before you decode it.

When To Use ROT13 Encoder/Decoder

Use it to encode or reveal spoiler text, puzzle answers, or joke punchlines in forums and newsgroups where ROT13 is the traditional convention, or just to see how the classic cipher works.

It also comes up as a teaching example. The transformation is small enough to trace by hand on a single letter, which is why it's a common first exercise for understanding modular arithmetic and substitution ciphers before moving on to anything with actual cryptographic strength.

Often used alongside String Reverser.

Features

Advantages

  • Instant and fully reversible by running it again on the same text.
  • Simple enough to compute by hand, part of its traditional appeal for casual spoiler-hiding.
  • Leaves punctuation, spacing, and digits completely intact.

Limitations

  • Provides no real security or confidentiality, since it's trivially reversible by anyone who recognizes it.
  • Only rotates the 26 letters of the basic English alphabet. Accented letters and other scripts are left unchanged.

ROT13 vs. Base64 vs. Real Encryption

ROT13 vs. Base64 vs. Real Encryption
ROT13 (this tool)Base64Real encryption (e.g. AES)
Provides real confidentialityNoNoYes
Reversible without a keyYes, run it twiceYes, decode directlyNo, requires the secret key
Typical useSpoilers, puzzle answersBinary-safe data transportProtecting sensitive data

Examples

Encoding a spoiler

Input

The butler did it

Output

Gur ohgyre qvq vg

Each letter shifts 13 places, and running ROT13 on the output again restores the original sentence.

Decoding by applying ROT13 again (self-inverse)

Input

Gur ohgyre qvq vg

Output

The butler did it

ROT13 has no separate decode step. Feed already-rotated text back through the same transformation and you get the original back, since two 13-position shifts add up to a full 26-letter loop.

Text mixed with digits and punctuation

Input

Meet me at 3:00pm, ok?

Output

Zrrg zr ng 3:00cz, bx?

Only the letters shift. The digits, colon, comma, and question mark all pass through completely unchanged.

The full alphabet mapping

Input

ABCDEFGHIJKLMNOPQRSTUVWXYZ

Output

NOPQRSTUVWXYZABCDEFGHIJKLM

A maps to N, B to O, and so on, 13 letters ahead with wraparound. This is the complete substitution table the cipher applies to every uppercase letter, and separately, to lowercase.

Best Practices & Notes

Best Practices

  • Use ROT13 only for casual obfuscation (spoilers, puzzle answers), never as a substitute for real encryption.
  • Remember it's symmetric. The same operation both encodes and decodes the text.
  • If you need actual confidentiality, use a real cryptographic algorithm instead.
  • Need a shift other than 13, or digits and symbols shifted too? Reach for a general Caesar cipher or ROT47 implementation instead of this tool.
  • Don't rely on ROT13 to survive an automated content filter or scanner. Decoding it is trivial for scripts as well as humans, so it only deters casual, accidental reading.

Developer Notes

This performs a single pass replacing each ASCII letter using modular arithmetic (charCode - base + 13) % 26, with separate base offsets for uppercase (65, 'A') and lowercase (97, 'a') so the two ranges never cross. Everything that isn't matched by the /[a-zA-Z]/ character class, digits, punctuation, whitespace, accented letters, non-Latin scripts, passes through the replace callback untouched. No external cipher library involved; the whole transformation is a single regular-expression replace with inline arithmetic, which is also why it runs instantly even on large input.

ROT13 Encoder/Decoder Use Cases

  • Hiding a spoiler or puzzle answer in a forum post using the traditional ROT13 convention
  • Demonstrating how a basic substitution cipher works for a class or tutorial
  • Quickly obscuring a joke punchline in shared notes
  • Storing spoiler text in a shared document or wiki page under the traditional expectation that readers decode it themselves before reading

Common Mistakes

  • Mistaking ROT13 for real encryption and using it to protect genuinely sensitive information.
  • Expecting it to affect numbers or punctuation, when only the 26 letters are rotated.
  • Expecting it to obscure accented letters or non-Latin scripts, when only the basic English alphabet is shifted.
  • Using ROT13 to hide something from an automated system or a determined reader, instead of just from casual, accidental viewing.

Tips

  • To decode ROT13 text, just run it through this same tool again. It's fully symmetric.
  • ROT13 is a special case of a Caesar cipher. For a different shift amount, you'd need a general Caesar cipher tool.
  • Text mixing English words with accented names or a non-Latin script? Expect only the plain English letters to change.

References

Frequently Asked Questions