🔄 ROT-N Encoder – Custom Rotation Cipher
The ROT-N Encoder is a flexible rotation cipher tool that encodes and decodes text by shifting each alphabetic character forward (or backward) by a user-chosen number of positions N in the alphabet. Unlike the fixed ROT-13, this tool lets you choose any shift from 0 to 25, explore all 25 possible rotations at once, and even extend the cipher to digits 0–9 with alphanumeric mode.
What Is a Rotation Cipher?
A rotation cipher — also known as a shift cipher or Caesar cipher — replaces each letter with the letter that is N positions ahead of it in the alphabet. The alphabet wraps around, so with a shift of 3 the letter X becomes A, Y becomes B, and Z becomes C. The classical ROT-13 (shift of 13) is a special case: because 13 + 13 = 26, encoding and decoding are the same operation.
Core Encoding Formula
For any uppercase letter c with ASCII code between 65 (A) and 90 (Z), the encoded character is:
encoded = chr(((ord(c) − ord('A') + N) mod 26) + ord('A'))The same formula applies to lowercase letters using ord('a') as the base. Decoding simply replaces N with (26 − N) mod 26, which shifts each character backward by the same amount.
Alphanumeric Mode
When Alphanumeric Mode is enabled, the tool extends the rotation to digits 0–9. Because there are only 10 digits, the effective digit shift is N mod 10. For example, with N = 13 the digit shift is 13 mod 10 = 3, so digit 0 → 3, 7 → 0, and so on. This is useful when obfuscating alphanumeric codes, short IDs, or puzzle content that contains numbers.
Operation Modes
| Mode | Description | Best For |
|---|---|---|
| Encode | Shifts each letter forward by N positions. | Creating ROT-encoded text for puzzles, spoilers, or obfuscation. |
| Decode | Shifts each letter backward by N positions. | Recovering the original text when the shift N is known. |
| Brute-Force | Generates all 25 possible rotations at once. | Finding the correct decode when the shift is unknown. |
ROT-N Variants at a Glance
The table below shows well-known named variants of the rotation cipher. All are simple applications of the same formula with different values of N:
| Variant | Shift (N) | Notable Property |
|---|---|---|
ROT-1 | 1 | Minimal shift; barely obfuscates text. |
ROT-5 | 5 | Often paired with ROT-13 for digits in ROT-18. |
ROT-13 | 13 | Self-inverse; encoding = decoding. Most popular variant. |
ROT-18 | 13 for letters, 5 for digits | Combines ROT-13 and ROT-5 for full alphanumeric rotation. |
ROT-47 | 47 positions within ASCII 33–126 | Rotates all visible ASCII characters, not just letters. |
Cipher Alphabet Mapping
After encoding or decoding, the tool displays a cipher alphabet table showing the full A–Z mapping for the selected shift. This lets you quickly verify which plaintext letter maps to which ciphertext letter. When alphanumeric mode is enabled, a separate digit grid shows the 0–9 mapping for the effective digit shift.
Brute-Force Decoding
Because the ROT cipher has only 25 meaningful keys (ROT-1 through ROT-25), an attacker — or a curious puzzler — can try all of them instantly. The Brute-Force mode does exactly this: it decodes your ciphertext with every possible shift and presents all 25 results in a scrollable table. You can then click Use on any row to switch to that shift in Decode mode. For English text, the correct result is usually the only row that looks like natural language.
Common Use Cases
- Spoiler hiding — encode spoilers, puzzle answers, or punchlines with ROT-13 so they are hidden from casual readers but trivially reversible.
- Puzzle creation — generate ROT-encoded clues or messages for escape rooms, scavenger hunts, and word games.
- Educational cryptography — demonstrate how simple substitution ciphers work and why frequency analysis defeats them.
- Light obfuscation — obscure email addresses or short strings from naive bots (not a security measure for sensitive data).
⚠️ Security Note
ROT-N provides no meaningful cryptographic security. With only 25 possible keys and trivial frequency analysis, any ROT-encoded message can be broken in seconds. Use it for fun, puzzles, and education — never for protecting sensitive or personal information. For real encryption, see the AES Encryption/Decryption tool.