Why "Uryyb" reads as Hello: the cipher that undoes itself
Julius Caesar is said to have written military notes with each letter moved three places along the alphabet, so A became D. Any shift works the same way, and the shift of 13 has a property no other shift has on a 26-letter alphabet: it is its own reverse. Move a letter 13 places, then 13 more, and you have moved 26, which is a full turn. That is ROT13, short for "rotate by 13", and it is why one button both scrambles and unscrambles.
Take the word Hello. H is the 8th letter; 13 places on is the 21st, U. E is the 5th letter and becomes the 18th, R. L is the 12th and becomes the 25th, Y, and so does the second L. O is the 15th letter, and 15 plus 13 is 28, which wraps past Z to the 2nd letter, B. So Hello becomes Uryyb. Now run Uryyb through the same rule. U, the 21st letter, moves to the 34th, which wraps to the 8th: H. Every letter comes back the same way. Type both words into the box above and watch it happen.
ROT13 became a habit on Usenet, the discussion network of the 1980s and 1990s. People posted film spoilers, puzzle answers and jokes some readers might not want to see in ROT13, so that nobody read them by accident. Newsreaders had a key to flip a message, and the convention stuck. You still see it in forums, in geocaching hints and in the source code of programs that want to keep a string from being found by a simple search.
ROT47 is the same idea stretched to cover more characters. It works on the 94 printable ASCII characters, from the exclamation mark to the tilde, and moves each one 47 places, which is again half of the set and so again its own reverse. Digits and punctuation change as well as letters, so "Meet at 10:30" becomes "|66E 2E `_ib_" and the time is hidden too. The price is that the output is full of symbols, which some chat apps and forums turn into formatting.
Neither cipher keeps a secret. There is no key, the rule is famous, and a person can decode ROT13 by eye with a little practice. Use it to hide a spoiler from a glance, never to protect a password, an address or anything private. Two more limits are worth knowing. ROT13 only moves the plain Latin letters A to Z, so accented letters such as é, and letters from other alphabets, pass through unchanged and can give away part of the text. And ROT47 skips anything outside ASCII for the same reason, including emoji and curly quotes.