ROT47 is a rotation cipher that extends the idea of ROT13 to the entire set of printable ASCII characters. Instead of only scrambling the 26 letters, it rotates digits, punctuation and symbols as well, so the output looks far more jumbled. It is popular in puzzle hunts, capture-the-flag challenges and as a stronger-looking spoiler hiding scheme.
How it works
ROT47 operates on the 94 printable ASCII characters from code 33 (!) through 126 (~). For each such character it computes a new code with the formula 33 + ((code - 33 + 47) mod 94). Adding 47 and wrapping inside the 94-character window shifts each character to the one roughly halfway across the printable range. Because 47 is exactly half of 94, applying the rotation a second time adds up to a full 94-step loop and restores the original character. That makes ROT47, like ROT13, its own inverse — one operation both encodes and decodes.
The space character (code 32) sits just below the rotated range and is deliberately left alone, which keeps word boundaries visible. Anything outside the printable ASCII block, including newlines and accented Unicode letters, is also passed through unchanged.
Example
Encoding Gera Tools 2026! produces a string where every visible character has moved. For instance the letter G (code 71) maps to (71 - 33 + 47) mod 94 + 33, which is code 118, the letter v. The space stays a space, so word spacing is preserved while the content is obscured. Running the result through ROT47 again returns Gera Tools 2026! exactly.
ROT47 vs ROT13: when each is appropriate
| Feature | ROT13 | ROT47 |
|---|---|---|
| Characters rotated | 26 letters only | 94 printable ASCII characters |
| Digits and punctuation | Unchanged | Also rotated |
| Self-inverse | Yes | Yes |
| Output readability | Letters scrambled, numbers/symbols visible | Entire content obscured |
| Typical use | Spoilers, simple CTF challenges | Stronger obfuscation, numbers need hiding |
Choose ROT47 over ROT13 when the content you want to hide includes numbers or symbols that would give away the answer if left visible. For example, a puzzle answer of 42 would pass through ROT13 unchanged, but ROT47 encodes 4 as S and 2 as Q, hiding it completely.
The 94-character printable ASCII range
The characters ROT47 operates on span from code 33 (exclamation mark !) through code 126 (tilde ~). This includes:
- All 26 uppercase letters (A–Z, codes 65–90)
- All 26 lowercase letters (a–z, codes 97–122)
- All 10 digits (0–9, codes 48–57)
- 32 punctuation and symbol characters:
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
The notable exclusion is the space (code 32), which stays as a space. This is intentional: preserving spaces keeps word boundaries recognisable in the encoded text, making it slightly more friendly to read while still thoroughly obscuring the content.
Security and appropriate use
Like all rotation ciphers, ROT47 provides no cryptographic security. It has no key, it has a fixed transform, and anyone can reverse it instantly by applying ROT47 again. It is also vulnerable to brute force (try all 93 other rotations) and frequency analysis (the most common character in the ciphertext is almost certainly the encoding of a space or e).
Use ROT47 for:
- Hiding text from casual eyes in chat or forum posts
- CTF beginner puzzles
- Obfuscating output in demonstrations where the point is that it looks obscured
Do not use ROT47 for anything that genuinely needs to stay private.
Notes
- ROT47 is a good demonstration of self-inverse ciphers over a larger alphabet than ROT13.
- It is unkeyed and offers no security — use it for puzzles and obfuscation only.
- If you want to scramble letters alone, or choose a custom shift, use ROT13 or ROT-N instead.
- All rotation happens in your browser; nothing is uploaded.