Language: English

tools / rot13

rot13/

ROT13, ROT47 and the Caesar cipher. ROT13 / ROT47 undo themselves when applied again; the Caesar cipher lets you pick the shift and direction.

Input

Result

What is ROT13

ROT13 replaces each English letter with the letter 13 places further on in the alphabet; with 26 letters, applying it twice brings you back to the start, so encrypting and decrypting are the same operation. This page does ROT13, ROT47 and a Caesar cipher with a shift from 1 to 25.

How it works: count forward around the alphabet

  1. Put A to Z in a circle and move each letter N places forward, continuing from A after Z; uppercase and lowercase are shifted separately and keep their case.
  2. For ROT13, N is 13, exactly half of 26: A becomes N, and N turns back into A.
  3. ROT47 does the same with the 94 visible ASCII characters from 33 to 126, with N = 47, again half, so digits and punctuation change too.
  4. For the Caesar cipher you choose N from 1 to 25; encrypting counts forward and decrypting counts back.
  5. Characters outside the range, such as spaces, Chinese characters and accented letters, stay as they are.

Example

ROT13: every letter changes, while the comma, the space and the exclamation mark stay:

Input
Hello, World!
Output
Uryyb, Jbeyq!

Caesar cipher, shift 3, decrypt: each letter moves 3 places back:

Input
Khoor, Zruog!
Output
Hello, World!

Sources

FAQ

Is ROT13 encryption, and can I use it to keep something secret?

No. ROT13 just replaces each letter with the one 13 places away in the alphabet. There is no key, so anyone can undo it. It is meant for hiding spoilers, answers and puzzle solutions so readers don't see them by accident. The Caesar cipher is the same: there are only 25 possible shifts, and trying them all breaks it. For real secrecy, use proper encryption such as AES.

Does ROT13 here give the same result as Python or the Linux command line?

Yes. Python's codecs.encode(s, 'rot13') and Linux's tr 'A-Za-z' 'N-ZA-Mn-za-m' also change only A to Z and a to z and leave every other character alone, so they match ROT13 on this page. The Python standard library has no ready-made ROT47 function.

Why can I still see word lengths and punctuation after ROT13?

Because it changes only letters: spaces, punctuation, digits and case are left alone, so word lengths and the shape of sentences remain, and it only stops people from reading the text by accident. To hide a little more, use ROT47, which also changes digits and punctuation, though spaces still stay and anyone can reverse it just as easily.

How do I decrypt a Caesar cipher, and what if I don't know the shift?

Choose “Caesar shift” and “Decrypt”, then enter the shift used to encrypt: text encrypted with shift 3 is decrypted with shift 3. If you don't know the shift, look at “All shifts” below the result: it lists the results for shifts 1 to 25 at once. Find the line that reads as normal text and click “Use”; the shift box and the result switch to that shift. For long input each line shows only the first 80 characters; once you pick a shift, the result box holds the full text.

What happens to digits, spaces, Chinese characters and punctuation?

ROT13 and the Caesar shift only change A to Z and a to z. Case is kept, and digits, spaces, punctuation, Chinese characters and accented letters (such as é) are left as they are. ROT47 changes every visible character from ASCII 33 to 126, including digits and punctuation, while spaces, line breaks, Chinese characters and non-ASCII letters stay as they are.

How do I shift a Caesar cipher backward (left)?

Choose “Decrypt” and enter the number of places to move back. Here “Encrypt” moves letters forward (right shift: A with shift 3 becomes D) and “Decrypt” moves them back (left shift: D with shift 3 becomes A). You can also choose “Encrypt” with 26 minus that number: the alphabet wraps around after 26 letters, so encrypting with 23 gives the same result as decrypting with 3.

Is my input uploaded?

No. The conversion happens in your browser and nothing is sent to a server.