---
title: "ROT-47"
description: "Shift 47 over the 94 printable ASCII characters, digits and punctuation included. Self-inverse."
canonical_url: "https://ciphers.agntn.dev/ciphers/rot47"
---
# ROT-47

> Shift 47 over the 94 printable ASCII characters, digits and punctuation included. Self-inverse.

<cipher-facts name="rot47">



</cipher-facts>

ROT-47 works on printable ASCII 33 to 126, so digits and punctuation change too. 47 is half of 94, so it's its own inverse. Space, tab and newline sit outside the range and pass through.

```ts
const rot47 = create("rot47");
rot47.encode("Test 123!").text; // "%6DE `abP"
rot47.decode("%6DE `abP").text; // "Test 123!"
rot47.encode("A\tB\nC").text; // "p\tq\nr"
```

`preserveCase` means nothing here, upper and lower case are just different characters in the range. And `stripNonAlpha` would defeat the point.


## Sitemap

See the full [sitemap](https://ciphers.agntn.dev/sitemap.md) for all pages.
