ToolNimba Browse

🔐 ROT47 Encoder and Decoder

By ToolNimba Text Tools Team · Updated 2026-06-19

ROT47 is its own inverse: run it again to decode.

ROT47 is a simple substitution cipher that rotates the 94 printable ASCII characters (codes 33 to 126) by 47 places. Because 47 is exactly half of 94, applying ROT47 twice returns the original text, so the same operation both encodes and decodes. Paste your text below, press Convert, and read the result. To decode something, paste the ROT47 text and convert again. Everything runs in your browser, so the text never leaves your device.

What is the ROT47 Encoder?

ROT47 is a member of the same family as the classic ROT13 cipher, but it scrambles far more than just letters. ROT13 only rotates the 26 letters A to Z (and a to z), leaving digits, punctuation and symbols untouched. ROT47 instead rotates the full block of 94 visible ASCII characters, from "!" (code 33) up to "~" (code 126). That means letters, digits, brackets, slashes and most punctuation all get shifted, producing output that looks much more thoroughly jumbled. Characters outside that range, such as spaces (code 32), tabs, newlines and any non-ASCII or accented letters, are left exactly as they are.

The mechanism is pure arithmetic on character codes. For each character you take its ASCII code, subtract 33 to get a position from 0 to 93, add 47, wrap around with a modulo of 94, then add 33 back to return to the printable range. Because the shift is half of the ring size, encoding and decoding are the identical operation: shift by 47, then shift by 47 again, and you have moved a full 94 positions, which is back to where you started. This self-inverse property is the cipher's defining feature and the reason a single Convert button handles both directions.

It is important to be clear about what ROT47 is for. Like ROT13, it offers no real security: there is no key, the method is public, and anyone can reverse it in seconds. Its genuine uses are about lightly obscuring text rather than protecting it. People reach for ROT47 to hide spoilers, puzzle answers or punchlines so a reader has to make a deliberate choice to reveal them, to mask text from naive automated keyword scanners, or to study how rotation ciphers work. If you need actual confidentiality, use real encryption, not a rotation cipher.

When to use it

  • Hiding spoilers, puzzle solutions or joke punchlines so readers reveal them only on purpose.
  • Lightly obscuring text, including symbols and digits, that a plain ROT13 would leave readable.
  • Decoding ROT47 strings you find in forums, capture-the-flag challenges or programming puzzles.
  • Teaching or learning how substitution and rotation ciphers work using a self-inverse example.

How to use the ROT47 Encoder

  1. Type or paste the text you want to encode or decode into the input box.
  2. Press Convert to apply ROT47 to every printable ASCII character.
  3. Read the result, then use Copy to put it on your clipboard.
  4. To decode, paste the ROT47 text and press Convert again: the same operation reverses it.

Formula & method

For each character with ASCII code c where 33 ≤ c ≤ 126: output = 33 + ((c − 33 + 47) mod 94). Characters outside that range are left unchanged. Applying the same rule twice restores the original.

Worked examples

Encode the single letter "A" with ROT47.

  1. The ASCII code of "A" is 65.
  2. Subtract 33 to get the position in the ring: 65 − 33 = 32.
  3. Add 47 and wrap: (32 + 47) mod 94 = 79.
  4. Add 33 back: 79 + 33 = 112, which is the code for "p".

Result: "A" becomes "p".

Encode the phrase "Hello, World! 42".

  1. Each printable character is rotated: H to w, e to 6, l to =, o to @.
  2. Punctuation rotates too: the comma becomes "[" and "!" becomes "P".
  3. The space (code 32) is below 33, so it stays a space.
  4. Digits rotate as well: "4" becomes "c" and "2" becomes "a".

Result: "Hello, World! 42" becomes "w6==@[ (@C=5P ca".

Decode "w6==@[ (@C=5P ca" back to plain text.

  1. ROT47 is its own inverse, so you apply exactly the same rotation again.
  2. w shifts to H, 6 shifts to e, = shifts to l, and so on.
  3. The space is left unchanged once more.
  4. After the full pass you recover the original characters.

Result: "w6==@[ (@C=5P ca" becomes "Hello, World! 42".

ROT47 compared with the related ROT13 cipher

FeatureROT13ROT47
Characters affected26 letters A to Z (both cases)94 printable ASCII, codes 33 to 126
Shift amount13 (half of 26)47 (half of 94)
Self-inverseYesYes
Digits and symbolsLeft unchangedRotated
Spaces and newlinesLeft unchangedLeft unchanged
SecurityNone (obfuscation only)None (obfuscation only)

Sample ROT47 conversions

InputROT47 output
Ap
a2
0_
Hellow6==@
ROT47#~%cf

Common mistakes to avoid

  • Treating ROT47 as encryption. ROT47 has no key and a publicly known method, so anyone can reverse it instantly. It only obscures text, it does not protect it. For real confidentiality use proper encryption such as AES, not a rotation cipher.
  • Expecting spaces to be scrambled. The space character has code 32, which is below the 33 to 126 range, so ROT47 leaves spaces (and tabs and newlines) untouched. Word boundaries stay visible, which can leak structure.
  • Confusing ROT47 output with ROT13 output. ROT13 only moves letters, so digits and punctuation stay readable. ROT47 also rotates those, so the two ciphers produce completely different results from the same input. Decode with the matching cipher.
  • Trying to decode non-ASCII text reliably. ROT47 only rotates characters in the printable ASCII block. Accented letters, emoji and other Unicode characters pass through unchanged, so text full of them is barely obscured.

Glossary

ROT47
A substitution cipher that rotates the 94 printable ASCII characters (codes 33 to 126) by 47 positions.
ROT13
A related cipher that rotates only the 26 letters of the alphabet by 13 places, leaving digits and symbols alone.
ASCII
A character encoding where each character has a numeric code; ROT47 works on the printable codes 33 to 126.
Self-inverse
A property where applying the same operation twice returns the original input, true of ROT47 because 47 is half of 94.
Substitution cipher
A method that replaces each character with another according to a fixed rule, here a rotation by a set amount.

Frequently asked questions

What is ROT47?

ROT47 is a simple substitution cipher that rotates the 94 printable ASCII characters (codes 33 to 126) by 47 places. It scrambles letters, digits and most punctuation, while leaving spaces, newlines and non-ASCII characters unchanged. It is used to lightly obscure text, not to secure it.

How do I decode ROT47?

You decode ROT47 by applying ROT47 again. Because the shift of 47 is exactly half of the 94-character ring, running the cipher a second time moves each character a full cycle and back to its original value. Just paste the encoded text and press Convert.

What is the difference between ROT47 and ROT13?

ROT13 rotates only the 26 alphabet letters by 13, leaving digits and symbols readable. ROT47 rotates the full block of 94 printable ASCII characters by 47, so letters, digits and punctuation all change. ROT47 output looks far more jumbled, and the two ciphers are not interchangeable.

Is ROT47 secure?

No. ROT47 has no secret key and uses a publicly known method, so anyone can reverse it in seconds. It is obfuscation, useful for hiding spoilers or puzzle answers, not encryption. For genuine privacy use a real encryption algorithm instead.

Which characters does ROT47 leave unchanged?

Anything outside the printable ASCII range 33 to 126 is left as is. That includes the space (code 32), tab and newline characters, and all non-ASCII characters such as accented letters and emoji. Only the 94 visible ASCII characters are rotated.

Does this ROT47 tool send my text anywhere?

No. The conversion runs entirely in your browser with plain JavaScript. Your text is never uploaded to a server, so you can safely use the tool offline once the page has loaded.