ROT13 encoder and decoder

Apply ROT13 to text. The same step encodes and decodes. Nothing leaves your browser.

ROT13 is the Caesar cipher with the shift fixed at 13. The Latin alphabet has 26 letters, so 13 is exactly half way round. That makes ROT13 its own undo: running it once hides the text, and running it again brings the original back. People use it to hide a spoiler, a puzzle answer or a joke punchline in a forum post, so that it is not read by accident. It is not a lock. Anyone can reverse it in a second, and it adds no protection at all. This page opens with the shift set to 13, and the sample reads Why did the chicken cross the road. Paste your own text and the result updates as you type. Only the letters A to Z and a to z change, and capital letters stay capital. Digits, spaces, punctuation, emoji, accented letters and other alphabets are copied through unchanged. You can still change the shift if you need a different Caesar cipher, or switch on the table of all 25 shifts.

How it works

  1. Type or paste your message
  2. Set the shift and choose encode or decode
  3. Copy the result, or show all 25 shifts

What the shift does

A Caesar cipher moves every letter a fixed number of places along the alphabet and wraps from Z back to A. With a shift of 3, A becomes D, B becomes E and X becomes A. The shift can be any whole number from -25 to 25. A number outside that range is cut to the nearest end, so 99 is used as 25. A shift of 0 leaves the text as it is. A negative shift moves backwards, which is the same as a forward shift of 26 minus that number. Decode uses the opposite of the shift you set, so decoding with 3 undoes encoding with 3. Case is kept, so Hello with shift 3 gives Khoor.

What is and is not shifted

Only the 26 plain letters A to Z and a to z move. Everything else is copied unchanged: spaces, punctuation, line breaks, emoji, accented letters such as é and letters of other alphabets such as Greek or Chinese characters. The tool does not fold accents here, because the cipher is defined on the 26-letter alphabet. Digits stay as they are unless you turn on the option to shift digits. Then each digit from 0 to 9 moves by the shift modulo 10, so 7 with a shift of 3 becomes 0, and 5 with a shift of 13 becomes 8. Both settings apply the same way when decoding, so a round trip always returns your original text.

Show all 25 shifts

If you have a message and do not know the key, turn on Show all 25 shifts. The table lists shifts 1 to 25. Each row moves every letter back by that many places, which is the decoding of a message that was encoded with that shift. Each row shows the first 80 characters, with line breaks turned into spaces and three dots added when the text is longer. Scan down the list for the row that reads as normal words. That row number is the key. The table does not guess for you. With a short or unusual message more than one row can look plausible.

A toy cipher, not security

The Caesar cipher has only 25 useful keys, so anyone can try them all in seconds, as the table shows. Do not use it to protect a password, a note or anything private. It suits puzzles, escape rooms, geocaching clues and lessons about how ciphers work. Up to 200,000 characters are accepted. The work runs in your browser, the message is not uploaded and only your settings are saved on this device.

Frequently asked questions

Why does ROT13 decode itself?

There are 26 letters and the shift is 13, so two shifts of 13 add up to 26, which is a full turn. Applying ROT13 twice returns every letter to where it started. Hello becomes Uryyb and Uryyb becomes Hello.

Does ROT13 change numbers?

Not by default. Digits stay as they are. If you turn on the digit option here, each digit moves by 13 modulo 10, which is 3, so 5 becomes 8. A strict ROT13 leaves digits alone.

Is ROT13 encryption?

No. It has one fixed key that everyone knows, so it hides text from a casual glance only. Use it for spoilers and puzzles, not for anything private.

How do I decode a Caesar cipher if I do not know the shift?

Turn on Show all 25 shifts and look for the row that reads as normal words. The shift number in that row is the key. A longer message, such as a full sentence, makes the right row obvious.

What is the difference between Caesar cipher and ROT13?

ROT13 is a Caesar cipher with a fixed shift of 13. Because the alphabet has 26 letters, applying it twice gives back the original, so the same step encodes and decodes. This page can do any shift, and the ROT13 page opens with 13 set.

Does it shift numbers and accented letters?

Digits only move if you turn on the digit option, by the shift modulo 10. Accented letters such as é and letters from other alphabets are never changed. Only A to Z and a to z move.

Is a Caesar cipher secure?

No. It has 25 possible keys and can be broken by hand in minutes. Use it for games and teaching, never for anything that has to stay private.

Why does a shift of -3 equal 23?

The alphabet wraps after 26 letters, so moving 3 back lands on the same letter as moving 23 forward. For example, D with shift -3 gives A, and D with shift 23 also gives A.