Encode a greeting
Hello, World!
w6==@[ (@C=5P
Unlike ROT13, the comma and exclamation mark change too. Only the space stays the same.
Encode or decode ROT47 as you type. ROT47 rotates every printable ASCII character, so letters, digits and symbols are all scrambled, and the same operation decodes it.
Every ROT variant
Hello, World!
w6==@[ (@C=5P
Unlike ROT13, the comma and exclamation mark change too. Only the space stays the same.
Dev 247
s6G acf
Digits are rotated as well: 2 becomes a, 4 becomes c, 7 becomes f.
s6G acf
Dev 247
Running ROT47 again returns the original text.
ROT47 replaces every printable ASCII character with the character 47 positions further along, wrapping around within the 94 characters from ! (code 33) to ~ (code 126). Letters, digits and punctuation are all rotated. Spaces, line breaks and any character outside that range, such as accented letters or emoji, are left unchanged.
Because 47 is exactly half of 94, applying ROT47 twice returns the original text. Like ROT13, it is its own inverse: the same operation encodes and decodes.
For each character with ASCII code c between 33 and 126:
new = 33 + ((c - 33 + 47) mod 94)For example, H has code 72. 72 − 33 = 39, plus 47 is 86, and 33 + 86 = 119, which is w.
| Range | Maps to |
|---|---|
! to O (codes 33–79) | P to ~ (codes 80–126) |
P to ~ (codes 80–126) | ! to O (codes 33–79) |
In other words, the two halves of the printable ASCII range swap places.
| ROT13 | ROT47 | |
|---|---|---|
| Characters rotated | 26 letters (both cases) | 94 printable ASCII characters |
| Digits and symbols | Unchanged | Rotated |
| Keeps letter case | Yes | No (letters can become digits or symbols) |
Hello, World! | Uryyb, Jbeyq! | w6==@[ (@C=5P |
| Self-inverse | Yes | Yes |
ROT47 hides more of the text, because numbers, URLs and email addresses are scrambled too. It is still not encryption: there is no key and anyone can reverse it.
const rot47 = (s) => s.replace(/[!-~]/g, (c) => String.fromCharCode(33 + ((c.charCodeAt(0) - 33 + 47) % 94))); rot47('Hello, World!'); // "w6==@[ (@C=5P"def rot47(s: str) -> str: return ''.join( chr(33 + (ord(c) - 33 + 47) % 94) if 33 <= ord(c) <= 126 else c for c in s )echo 'Hello, World!' | tr '!-~' 'P-~!-O' # w6==@[ (@C=5PThe decoded text is still scrambled
The text was probably encoded with ROT13 or another rotation, not ROT47. Compare the variants under the tool, or try the Caesar cipher solver with the Printable ASCII alphabet.
Spaces and accented letters were not rotated
That is correct. ROT47 only rotates characters from ! (33) to ~ (126). Spaces, line breaks and non-ASCII characters always stay the same.
Pasting ROT47 into a shell or JSON breaks it
ROT47 output often contains ", ', \ and $, which those formats treat specially. Quote or escape the value, or pick ROT13 if you only need to hide letters.
Apply ROT47 again. The 94 printable ASCII characters are rotated by exactly half (47), so doing it twice brings every character back.
Each character is rotated 47 places within the 94 printable ASCII characters. 47 is half of 94, which is what makes it self-inverse.
It hides more characters, but neither is secure. Both have no key and can be reversed instantly by anyone.
No. The space is ASCII code 32, just outside the rotated range (33–126), so spaces and line breaks stay where they are.
No. ROT47 runs entirely in your browser.
Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.
Tip: press Ctrl D to bookmark dev247.