The expected ROT47 result is a position-preserving substitution: every printable ASCII character from ! through ~ rotates 47 positions, while spaces, line breaks, and non-ASCII characters remain unchanged.
Because the printable range contains 94 characters and 47 is exactly half of that range, applying the same operation once more restores the original text. Expect a scrambled-looking string rather than a simple letter shift because uppercase letters, lowercase letters, digits, and punctuation can all change.

The output contract in one formula
For a supported code point c, the exact mapping is 33 + ((c - 33 + 47) mod 94). This formula applies only to code points 33 through 126, inclusive. Values outside that interval are copied unchanged, so the output retains the same length, order, whitespace, and unchanged Unicode segments.
For one concrete example, uppercase A has code point 65, so 33 + ((65 - 33 + 47) mod 94) = 33 + 79 = 112, which is lowercase p. Applying ROT47 to that result once more returns uppercase A.
The transformation is deterministic and position preserving. It does not reorder characters, alter the number of supported code points, detect the input language, or add headers, delimiters, or other framing. It also differs from letter-only ROT13 because every supported punctuation mark and digit participates in the substitution.
A character-by-character preservation table
Only the narrow printable ASCII interval changes. The following table shows the complete treatment of each input category.
| Input category | Expected treatment | Result for the reader |
|---|---|---|
| Printable ASCII from ! (33) through ~ (126) | Rotated forward by 47 positions, wrapping at the end of the range | Letters, digits, and punctuation become different printable ASCII characters |
| Space (32) | Copied unchanged | Word spacing and visible gaps remain in place |
| Tabs, line breaks, and other control characters | Copied unchanged | Basic text layout is retained rather than converted into printable symbols |
| Non-ASCII code points, including accented letters, CJK text, and emoji | Copied exactly without normalization | The original Unicode content remains intact outside the rotated ASCII portions |
The implementation works with Unicode code points rather than forcing the entire input into ASCII. Accented characters are not transliterated, CJK text is not converted into another script, and emoji are not split into UTF-16 halves. In mixed text, each non-ASCII segment stays in place between any rotated ASCII characters around it.
Whitespace also receives no automatic cleanup. Leading and trailing spaces remain visible, multiple spaces are not collapsed, and tabs and line breaks are not removed. The tool does not trim, normalize, collapse, or otherwise reformat the input.
Encoding and decoding in one field
The ROT47 Encoder Decoder performs the conversion locally in your browser and provides copy-ready plain text. Its single operation handles both directions.
- Paste the exact text you want to transform into the input field. Spaces and non-ASCII content will be preserved.
- Select Apply ROT47 to generate the printable-ASCII substitution.
- Copy the resulting text if you need to use the encoded value.
- To decode, paste the ROT47 output into the same field and select Apply ROT47 once more.
There is no separate Encode or Decode selector and no key to remember. The second application reverses the first because two 47-position rotations complete one full cycle through the 94-character printable ASCII range. This makes the tool convenient for reversible forum puzzles, classroom demonstrations, and other lightweight text transformations.
Checking for an exact round trip
To confirm that a result is intact, keep the original text, apply ROT47 once, and copy the output exactly. Paste that copied value back into the tool, apply the operation again, and compare the recovered text with the original. Pay particular attention to spaces at the beginning or end, repeated spaces, punctuation, and line breaks.
If the recovered value differs, the self-inverse transformation may not be the cause. Check whether an intermediary escaped punctuation, converted straight quotation marks into smart quotes, or changed line endings. For additional diagnosis, see fixing a result that looks wrong after using ROT47.
Avoid manually retyping an encoded result when exact punctuation matters. Copying the complete output reduces the chance that a character will be omitted, substituted, or changed before it is decoded.
Why destination syntax may reinterpret it
Because punctuation is transformed, the output can contain characters that have special meaning in URLs, HTML, shell commands, regular expressions, or other markup. A result that looks harmless as plain text may be interpreted differently after it is inserted into one of those systems.
The page returns plain text and does not claim that its output is safe for any particular programming or transport context. If the encoded text will become part of a URL, HTML document, command, expression, or template, apply the escaping or quoting rules required by that destination. ROT47 encoding and destination-specific escaping solve different problems and should not be treated as substitutes for one another.
Practical boundaries for long or sensitive input
Empty input is rejected because it produces no useful transformation. The supported maximum is 200,000 Unicode code points, counted as code points rather than bytes or visible characters. Apart from that size boundary, the tool retains leading and trailing whitespace and does not normalize or collapse the input.
ROT47 is a puzzle encoding, not encryption. It has no secret key, and anyone who recognizes the pattern can reverse it immediately by applying ROT47 again. It provides no confidentiality, integrity, authentication, or resistance to frequency analysis. Do not use it to protect credentials, personal information, or sensitive messages.
It is useful when the goal is light spoiler masking, a classroom demonstration, a reversible forum puzzle, or testing how a pipeline handles transformed characters. Its output is intentionally obvious to informed readers. If a phrase only needs to be less immediately readable, ROT47 can serve that purpose; if it needs to remain secret, use a dedicated encryption system instead.
Related reading: Vigenere Cipher Decoder Safe? Privacy and Security.