Skip to content
UniKit

ROT13 cipher

Apply ROT13 — self-inverse, so encrypting and decrypting are the same operation — or any ROT-N shift from 1 to 25, with case preservation, a custom alphabet (including pinyin ü) and a shifted-alphabet preview.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Input

Text to process

Shift settings

ROT13 is self-inverse: applying it twice returns the original text, so encryption and decryption are the same operation. With a custom alphabet length, it is self-inverse only when shift × 2 is divisible by the length.

13
ROT-13 / 26 self-inverse
Mapping preview

a → n · b → o · c → p · d → q

Shifted alphabet

nopqrstuvwxyzabcdefghijklm

Result

Type some text to see the shifted result.

What this tool does

  • Post spoilers or puzzle answers on forums: ROT13 is the traditional internet way to hide them, and readers can rotate the text back themselves.
  • Lightly obfuscate text so it is not read by accident — for example a draft note shown to a colleague. ROT13 offers no real confidentiality.
  • Explain the Caesar shift: drag the shift value to see the whole alphabet rotate, then use the mapping preview to make "shift by N" concrete.
  • Need a non-Latin alphabet (pinyin with ü, an internal symbol table)? Paste it into the custom alphabet field — characters outside the alphabet pass through unchanged.

Example

Input

Hello, World! (ROT13, default alphabet)

Output

Uryyb, Jbeyq!

Applying ROT13 to Uryyb, Jbeyq! returns Hello, World! — ROT13 is self-inverse, so encryption and decryption are the same operation.

Frequently asked questions

Can I use ROT13 for real encryption?

No. It only rotates the 26 letters by 13 positions and anyone can undo it instantly; historically it was used for spoiler hiding and playful text. Use modern encryption such as AES if you actually need to protect data.

Why is ROT13 self-inverse?

The alphabet has 26 characters, so shifting by 13 maps each letter to the one opposite it: a↔n, b↔o, and so on. Applying it twice lands back where you started, which is why one operation serves as both encryption and decryption. With a 27-character pinyin alphabet, 13 × 2 = 26 is not divisible by 27, so it stops being self-inverse.

Is capitalisation preserved?

Yes. The character is looked up as-is first, then in lowercase, and the result is converted back to uppercase when the original was uppercase — so Hello becomes Uryyb, not uryyb.

What are the limits on a custom alphabet?

At least 2 characters with no duplicates, and the shift must be an integer from 1 to alphabet length − 1. Characters outside the alphabet (Chinese, digits, punctuation) are left untouched.

Is ROT-N the same as the Caesar cipher?

Essentially yes: the Caesar cipher is alphabet substitution with a fixed shift, and ROT13 is the special case where N = 13. The only difference is that Caesar traditionally used 3, while ROT13 deliberately picks 13 so that it is self-inverse.

Keywords:rot13rot-ncaesar cipherrot13 decoderrot13 encoder凯撒密码ROT13 加密ROT13 解密字母移位自定义字母表自反加密

Related tools