How ROT47 Works
ROT47 operates on the 94 printable ASCII characters, from ! (code 33) to ~ (code 126). Each character is shifted forward by 47 positions within this range, wrapping around when it reaches the end. The formula is: new_char = ((char_code - 33 + 47) % 94) + 33. Because 47 is exactly half of 94, applying the transformation twice returns the original character — making ROT47 self-inverse, just like ROT13 is self-inverse for the 26 letters of the alphabet. For example, 'A' (code 65) becomes 'p' (code 112), and 'p' becomes 'A' again.
ROT47 vs ROT13: What Is the Difference?
ROT13 only shifts the 26 English letters, leaving numbers, spaces, and symbols unchanged. This means a ROT13-encoded message still reveals its numeric content and structure. ROT47 solves this limitation by encrypting all printable characters — letters, digits, and punctuation alike. The trade-off is that ROT47-encoded text looks more like random noise, making it obvious that the text has been encoded. ROT13, by contrast, produces output that still looks like (meaningless) English words. Choose ROT13 when you want light obfuscation that preserves readability; choose ROT47 when you need to hide all character information.
Use Cases for ROT47
ROT47 is commonly used in CTF (Capture the Flag) cybersecurity challenges as a simple encoding layer. Developers use it to obfuscate configuration strings, API keys in source code, or test data that should not be immediately human-readable. It also appears in email obfuscation to hide addresses from simple scrapers. Like ROT13, ROT47 provides zero cryptographic security — it is trivially reversible. Its value is purely in casual obfuscation: preventing accidental reading while making intentional decoding effortless.
Complete ROT47 Character Mapping
The ROT47 mapping covers all printable ASCII: letters (A-Z, a-z), digits (0-9), and 32 punctuation/symbol characters. Uppercase letters A-Z map to p-z and then to symbols like {, |, }, ~, !, ", #, $, %, &, ', (, ), *, +. Lowercase letters a-z map to digits 2-9 and then to :, ;, <, =, >, ?, @, and uppercase A-K. Digits 0-9 map to _, `, a, b, c, d, e, f, g, h. The full mapping table is shown in the interactive tool above.