# ROT13 / ROT47 Decoder

> Apply ROT13 (letters) or ROT47 (all printable ASCII). The same operation encodes and decodes.

- Page: https://decoder.tools/rot13-decoder
- Category: Classical & Obfuscated Ciphers
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

ROT13 replaces each letter with the letter 13 positions later in the alphabet, wrapping around from Z to A. Because the alphabet has 26 letters, running ROT13 twice returns the original text, so one tool both encodes and decodes.

## Example

```text Input
Gur dhvpx oebja sbk whzcf bire gur ynml qbt.
```

```text Output
The quick brown fox jumps over the lazy dog.
```

With **Mode: ROT47**, `w6==@ (@C=5P` decodes to `Hello World!`.

## ROT13 and ROT47

**ROT13** is a Caesar cipher with a fixed shift of 13. It only changes `A–Z` and `a–z` and keeps their case. Digits, spaces and punctuation are untouched, so word lengths stay visible. It was popular on Usenet for hiding spoilers and punchlines, and it still appears in puzzle hints, geocaching, forum spoilers and the occasional "obfuscated" config value.

| Plain | A B C D E F G H I J K L M |
|---|---|
| ROT13 | N O P Q R S T U V W X Y Z |

**ROT47** rotates every printable ASCII character from `!` (33) to `~` (126) by 47 positions, so digits and punctuation change too. That makes the result look less like words. It is also self-inverse, because there are 94 printable characters and 47 is half of 94.

Neither is encryption. There's no key, and anyone can reverse them instantly.

## How to use the ROT13 decoder

1. Paste the text.
2. Choose **ROT13** for letters only, or **ROT47** if digits and symbols are scrambled too.
3. Read the result. To encode, paste plain text; the operation is the same.

## ROT13 in code

```python Python
import codecs

print(codecs.encode("Gur dhvpx oebja sbk", "rot13"))  # The quick brown fox
```

```js JavaScript
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);
  });
console.log(rot13("Gur dhvpx oebja sbk")); // The quick brown fox
```

```sh Command line
echo 'Gur dhvpx oebja sbk' | tr 'A-Za-z' 'N-ZA-Mn-za-m'
```

## At a glance

| | |
|---|---|
| ROT13 | Letters shifted by 13. Self-inverse |
| ROT47 | ASCII 33–126 shifted by 47. Self-inverse |
| Key | None |
| Security | None. It hides text from a casual glance only |

## FAQ

### How do I know if text is ROT13?

Word lengths and punctuation look normal, but the words are nonsense with familiar shapes: `gur` (the), `naq` (and), `vf` (is). If ROT13 doesn't work, try every shift with the [Caesar cipher decoder](/caesar-cipher-decoder).

### What is ROT18?

An informal name for ROT13 on letters combined with ROT5 on digits. This tool doesn't have a ROT18 mode. Use ROT47 if digits are scrambled too, or decode the letters here and shift digits by 5 by hand.

### Is ROT13 the same as a Caesar cipher?

Yes, it's the Caesar cipher with a shift of 13. It's the only shift that is its own inverse for the 26-letter alphabet.
