Converters & translators

ROT13 Decoder & Encoder

Decode and encode ROT13 instantly (the same step does both), switch to ROT5, ROT18 or ROT47, or try every rotation when it is not ROT13.

Updated · Free, no sign-up

Result
Uryyb Jbeyq

Share this tool

Know someone who’d love it?

What is ROT13?

ROT13 (“rotate by 13 places”) replaces every letter with the letter 13 places further along the alphabet, wrapping around from Z to A. A becomes N, B becomes O, and N becomes A again. Because the alphabet has 26 letters and 13 is exactly half, doing ROT13 twice brings you back where you started. That makes it unusual among ciphers: encoding and decoding are the same operation, so this tool has no Encode or Decode switch. Paste ROT13 text to read it, or plain text to hide it.

ROT13 is a Caesar cipher with a shift of 13. It was never meant to keep secrets. It hides text from a casual glance, so that a reader has to choose to see a spoiler, a punchline or a puzzle answer.

How to use the ROT13 decoder and encoder

  1. Type or paste your text. The result appears below as you type.
  2. Choose a variant if you need one: ROT13 for letters (the standard), ROT5 for digits only, ROT18 for letters and digits together, or ROT47 for letters, digits and symbols.
  3. Press Copy, or Use as input to run the result through again (and see that it turns straight back into your original).

If a text does not decode with ROT13, it may use a different rotation. Open Crack it: I don’t know the key to see all 25 rotations ranked by how much they read like English; that makes it a general rotation cipher decoder. Step by step shows the ROT13 wheel and the letter pairs, and Which cipher is this? helps when you are not sure what kind of code you have.

Links can open the tool filled in, for example ?text=Uryyb&variant=rot13, and &open=crack opens the list of rotations.

ROT13 chart

ROT13 swaps every letter with the one 13 places away, so the same step encodes and decodes.

ROT13 table

Every letter has a partner 13 places away, and the two swap. That gives just 13 pairs to remember:

LetterABCDEFGHIJKLM
↕ swaps withNOPQRSTUVWXYZ

So A↔N, B↔O, C↔P and so on to M↔Z. Small letters work the same way and keep their case. Digits, spaces and punctuation are left alone in standard ROT13.

ROT13 examples

A joke with its punchline hidden: Why did the scarecrow win an award? The answer, in ROT13: Orpnhfr ur jnf bhgfgnaqvat va uvf svryq. Run it through the tool to read it.

A spoiler: Gur ohgyre qvq vg. decodes to “The butler did it.”

PlainROT13ROT13 again
HelloUryybHello
SecretFrpergSecret
PuzzleChmmyrPuzzle

How to do ROT13 by hand

Number the letters A = 0 to Z = 25, add 13, and if the total is 26 or more, subtract 26. H is 7; 7 + 13 = 20, which is U. U is 20; 20 + 13 = 33, and 33 − 26 = 7, which is H again. A quicker way: if the letter is in the first half of the alphabet (A to M), count 13 forward; if it is in the second half (N to Z), count 13 back. Or simply use the pairs in the table above.

ROT5, ROT18 and ROT47

Standard ROT13 leaves numbers readable, which is not always what you want. Three relatives handle more characters. Here is the same line, Room 237, door code 4519!, in each:

VariantWhat it rotatesResult
ROT13Letters A–Z by 13Ebbz 237, qbbe pbqr 4519!
ROT5Digits 0–9 by 5Room 782, door code 9064!
ROT18Letters by 13 and digits by 5Ebbz 782, qbbe pbqr 9064!
ROT47All 94 visible ASCII characters by 47#@@> abf[ 5@@C 4@56 cd`hP
  • ROT5 turns each digit five places around 0–9: 0↔5, 1↔6, 2↔7, 3↔8 and 4↔9. Five is half of ten, so it is also its own inverse.
  • ROT18 is simply ROT13 on the letters plus ROT5 on the digits.
  • ROT47 treats the 94 printable ASCII characters, from ! (code 33) to ~ (code 126), as one long circle and turns them by 47, half of 94. Letters, digits and punctuation all change, so the result looks like line noise, and running it again gives the original.

All four are self-inverse: whatever you encode, you decode by applying the same variant again.

Rotation cipher decoder: when it is not ROT13

“ROT” followed by any number is a rotation by that many places: ROT1 shifts by one, ROT3 is the classic Caesar shift. Only ROT13 decodes itself; for any other rotation N, you decode with 26 − N. If you do not know N, try them all. Here is Tlla tl ha aol ibz zavw ha mvby run through the tool’s cracker, best readings first:

Encoded withReading
ROT7Meet me at the bus stop at four
ROT19Assh as oh hvs pig ghcd oh tcif
ROT18Btti bt pi iwt qjh hide pi udjg
ROT23Wood wo kd dro lec cdyz kd pyeb

The message was encoded with ROT7, and that is the reading at the top. With Crack it open, every rotation is listed for whatever you paste, with a link to open it in the Caesar cipher tool.

Why 13? Rotations and their opposites

Rotating by N and then by 26 − N moves every letter a full circle, back to where it began. So each rotation has a partner that undoes it, and ROT13 is the one rotation that is its own partner:

Encode withDecode with
ROT1ROT25
ROT3ROT23
ROT5ROT21
ROT7ROT19
ROT10ROT16
ROT13ROT13 (the same)
ROT20ROT6
ROT25ROT1

That symmetry is exactly why ROT13 caught on: nobody has to remember which direction to turn, and one button both hides and reveals. The same logic gives ROT5 for the ten digits and ROT47 for the 94 printable characters, each rotating by half of its circle.

Words that ROT13 turns into other words

Usually ROT13 produces gibberish, but now and then a word rotates into another real word. Among the common words in our dictionary with four or more letters, there are only 4 such pairs:

  • ebbs ↔ roof
  • envy ↔ rail
  • errs ↔ reef
  • gnat ↔ tang

Pairs like these are a nice trick for puzzle makers: a clue that reads as a real word can hide a second word in plain sight. Try other words in the tool and you will see how rare it is.

ROT13 compared with other simple codes

  • ROT13 vs. Caesar: ROT13 is one particular Caesar shift. The Caesar cipher lets you choose any shift from 1 to 25, but then you have to tell your reader which one.
  • ROT13 vs. Atbash: both are their own inverse. Atbash mirrors the alphabet (A↔Z, B↔Y) instead of turning it halfway round, so it pairs different letters.
  • ROT13 vs. Base64: Base64 is not a cipher but a way of writing any data with 64 safe characters; it changes the length of the text and works on bytes, not letters. ROT13 keeps the text the same length and the spaces in place.
  • ROT13 vs. a real cipher: a real cipher has a secret key. ROT13 has none, which is why it is used for courtesy, not secrecy.

ROT13 in code and on the command line

ROT13 is a classic first programming exercise, and many systems have it built in. On Linux and macOS, the tr command translates one set of letters into another:

echo "Hello World" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
# Uryyb Jbeyq

In Python, the standard codecs module includes a ROT13 codec:

import codecs
print(codecs.encode("Hello World", "rot13"))   # Uryyb Jbeyq

And in JavaScript, a single replace does it:

const rot13 = (s) =>
  s.replace(/[a-z]/gi, (c) => {
    const base = c <= "Z" ? 65 : 97;
    return String.fromCharCode(((c.charCodeAt(0) - base + 13) % 26) + base);
  });

What ROT13 is used for

  • Spoilers and punchlines. Forums and puzzle sites use it to hide the ending of a story or the answer to a riddle, so readers decide for themselves when to look.
  • Puzzle answers and hints. Geocache hints, quiz answers and escape-room clues are often written in ROT13 so that nobody reads them by accident.
  • Teaching. It is the simplest way to show what a cipher is, and why a cipher with one key is no protection at all.
  • Keeping text away from simple filters. Rotated text is not matched by naive keyword searches, which is also why it should never be mistaken for real security.

How to recognize ROT13 text

ROT13 has a few giveaways once you have seen it a couple of times:

  • gur is “the”, the most common word in English, so a text full of “gur” is almost certainly ROT13. Likewise naq is “and”, vf is “is” and bs is “of”.
  • Spaces, digits and punctuation look normal. The word lengths and sentence shapes of the original are still there, so it looks like a foreign language rather than random noise.
  • The vowels move. A, E, I, O and U turn into N, R, V, B, H, so words take on odd shapes such as “rkcrafvir” (expensive).

If the text looks like this but ROT13 does not fix it, it is probably another Caesar rotation: open Crack it. If the punctuation is scrambled too, try the ROT47 variant.

Tips for using ROT13

  • Say that it is ROT13. Write “(ROT13)” before hidden text so readers know how to reveal it; the point is courtesy, not mystery.
  • Hide only the part that matters. Encode the answer or the spoiler, not the whole post, so readers can still follow the discussion.
  • Use ROT18 for codes with numbers, such as a padlock combination in a puzzle hunt, and ROT47 if punctuation would give the answer away.
  • Never use it for passwords or private data. Anyone can undo it in a second.

Is ROT13 encryption?

Not in any useful sense. ROT13 has no key: everyone who knows the rule can read the message, and the rule is famous. It is better described as a way of obscuring text. Applying ROT13 twice does nothing at all, which is the source of an old programmers’ joke about “double ROT13” as an upgrade. For real privacy, use proper encryption software, never a letter cipher.

History of ROT13

Letter-shift ciphers are ancient, but ROT13 as a name and a habit comes from Usenet, the online discussion groups of the early internet. In the early 1980s users began rotating jokes, spoilers and puzzle answers by 13 places so that readers had to choose to decode them, and many newsreader programs of the time had a built-in ROT13 command. The custom spread from there to forums, puzzle sites and programming textbooks.

More letter codes to try

If you like ROT13, try Atbash, which is also its own inverse but mirrors the alphabet instead of turning it, the keyword-based Vigenère cipher, or Morse code.

Free and private

This ROT13 tool runs entirely in your browser: free, with no sign-up, and nothing you type is uploaded or stored.

For teachers, bloggers & clubs

Put the ROT13 on your website

Give your readers this tool right on your page. Copy the code, paste it into your site, done: no sign-up, no account.

  • Free for any website
  • No ads, no cookies
  • Fits phones and sidebars
  • Always up to date
See it live ↗

Please keep the small credit line under the tool; you may add rel="nofollow" to its link. How it works & the rules

› Show the code

Frequently asked questions

What is ROT13?
ROT13 replaces every letter with the letter 13 places further along the alphabet, so A becomes N and N becomes A. It is a Caesar cipher with a shift of 13.
How do I decode ROT13?
Apply ROT13 again. Because 13 is half of 26, rotating twice brings every letter back, so paste the text into the tool and the result is the decoded message.
Why are ROT13 encoding and decoding the same?
The alphabet has 26 letters. Moving 13 places and then 13 more is a full circle of 26, which returns each letter to where it started.
What is ROT13 used for?
Hiding spoilers, punchlines, puzzle answers and hints so that readers only see them if they choose to. It is a courtesy, not a way to keep secrets.
Does ROT13 change numbers?
No. Standard ROT13 only rotates letters. ROT5 rotates digits by five places, ROT18 does both, and ROT47 also changes punctuation; all are available in the tool.
What is ROT47?
A rotation of the 94 printable ASCII characters, from ! to ~, by 47 places. Letters, digits and symbols all change, and applying it twice gives the original.
What if my text is not ROT13?
It may be another rotation, such as ROT1 or ROT3. Open Crack it in the tool to see all 25 rotations ranked by how much they read like English.
Is ROT13 secure?
No. It has no key, and anyone can reverse it in a second. Never use it for passwords or private information.
How do I do ROT13 on the command line?
On Linux or macOS, pipe the text through tr 'A-Za-z' 'N-ZA-Mn-za-m'. In Python, codecs.encode(text, 'rot13') does the same.

About this page

The ROT13 is a free tool from Linguaholic, made by Marcel Iseli. It runs in your browser, with no sign-up. Last updated .

The code breaker's English letter frequencies and word checks come from Linguaholic’s English dictionary, built from the open ENABLE and SCOWL word lists. Licenses and notices.

Keep exploring

Browse all 99 tools