ROT47 编码器和解码器

旋转所有可打印 ASCII 字符——字母、数字和符号——47 个位置。与 ROT13 一样,ROT47 是自逆运算:编码和解码是同一操作。

"Hello123!""w6==@`ab0"(ROT47)
ROT47
Shift 47
ascii
Includes numbers and symbols (ASCII 33-126)

ROT47 Conversion Reference

Complete Character Mappings (ASCII 33-126)

Uppercase Letters
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
p q r s t u v w x y z { | } ~ ! " # $ % & ' ( ) * +
Lowercase Letters
a b c d e f g h i j k l m n o p q r s t u v w x y z
2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K
Numbers
0 1 2 3 4 5 6 7 8 9
_ ` a b c d e f g h
Symbols
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
P Q R S T U V W X Y Z [ \ ] ^ i j k l m n o , - . / 0 1 L M N O

Examples

HELLO9:\\;?
12345`abcd
Hello!9\\\\;;P
Note: All printable characters are converted

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.

关于 ROT47 的常见问题

Is ROT47 secure?

No. ROT47 provides no cryptographic security. It is a simple substitution cipher with a fixed, publicly known shift. Anyone who recognizes the encoding can instantly reverse it. ROT47 is useful only for casual obfuscation — preventing accidental reading of text, not protecting it from determined readers.

Can ROT47 handle Unicode characters?

Standard ROT47 only operates on the 94 printable ASCII characters (codes 33-126). Characters outside this range — including Unicode, accented letters, emoji, and control characters — are passed through unchanged. If you need to encode Unicode text, consider Base64 or other encoding schemes designed for broader character sets.

How do I decode ROT47?

ROT47 is self-inverse, meaning encoding and decoding are the exact same operation. Simply apply ROT47 to the encoded text and you get the original back. There is no separate 'decode' step — run the same transformation again.