b2KIT

ROT13 / ROTn Cipher Tool

Apply ROT13 or any ROTn (1-25) letter rotation cipher to text for simple obfuscation.

Tested tool guide Tested browser tools Checked August 16, 2026

What ROT13 / ROTn Cipher Tool does, with a checked example

ROT13 is the classic 13-position letter rotation: every letter moves 13 places forward in the alphabet and wraps around at Z. This tool applies that shift, and any other shift from 1 to 25, to a block of text. The thing users most often trip on: for ROT13, encoding and decoding are the same operation, because 13 + 13 = 26, but for any other ROTn you must decode with shift 26 - n, not with n. Only ASCII letters rotate; digits, punctuation, spaces, and accented or non-Latin characters pass through unchanged, and case is preserved.

Worked example

A concrete input and expected output from the current implementation.

Input

HELLO WORLD (ROT13)

Expected output

URYYB JBEYQ

Each letter advances 13 positions: H becomes U, E becomes R, L becomes Y, O becomes B, W becomes J, and D becomes Q. Because 13 + 13 = 26, feeding the output back through ROT13 returns HELLO WORLD.

How the result is produced

1

The fixed 13-position shift

Map each letter a-z to the letter 13 places later in the alphabet: a to n, b to o, and so on through m to z, then wrapping so n becomes a. Uppercase and lowercase letters are handled separately, and anything that is not a Latin letter - digits, spaces, punctuation, accented characters - is copied through untouched. Since the alphabet has 26 letters, two applications of the 13-shift cover exactly one full cycle, which is what makes ROT13 its own inverse.

2

Generalizing to any shift 1-25

Pick a shift n and each letter advances n positions instead of 13. Two applications advance 2n, so re-applying the same shift restores the original only when 2n is a multiple of 26, which happens for n = 13 alone. To decode a ROTn message, re-run the tool with the complementary shift 26 - n. Shifts outside 1-25 (0, 26, negatives, larger multiples) should be reduced modulo 26 before use.

Good uses

  • Unscrambling ROT13 spoiler text, joke punchlines, and quiz answers on forums and newsgroups, where ROT13's encode-and-decode-in-one-step convention has been used for decades.
  • Scrubbing a line before pasting it into chat, a log, or a bug report so it cannot be read in passing - knowing anyone can decode it in one step, including you, since the same tool reverses it.
  • Decoding ROTn text where the shift is stated (ROT5, ROT18), or double-checking a manually written Caesar shift against this tool's output.

Limits and checks

  • ROT is obfuscation, not encryption. Only 25 shifts exist and letter frequency survives unchanged, so a determined reader breaks it by hand in minutes. Never use it for passwords, keys, or anything that must stay secret.
  • Only ASCII letters rotate. ROT13 of PIN 2024! is CVA 2024! - the digits and punctuation stay put. If you expect numbers to move too, you want a ROT47-style scheme, which this tool does not apply.
  • For n other than 13, re-running with the same n does not decode. A message shifted by 5 into mjqqt needs shift 21 to return to hello; feeding it back through 5 only scrambles it further.

Common questions

Why does applying ROT13 twice give me back the original text?

The alphabet has 26 letters and 13 + 13 = 26, so two shifts cover exactly one full cycle and every letter lands where it started. This self-inverse property is why ROT13 became the standard spoiler cipher on Usenet: the same operation both hides and reveals text. ROT13 is the only shift in the 1-25 range with this property.

Can I use this to protect something sensitive?

No. Every ROT variant is trivially breakable: at most 25 shifts to try, and letter frequency is preserved exactly, so a short manual analysis identifies the shift quickly. ROT exists to hide content from a casual glance - spoilers, answers, in-jokes - not to provide secrecy. For real protection, use a proper encryption scheme with a secret key.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools