ROT-N Cipher (Custom Rotation)

Choose any rotation N from 1 to 25 to shift letters

Ad placeholder (leaderboard)

The ROT-N cipher is the general form of the Caesar cipher: it shifts every letter a chosen number of places along the alphabet. By letting you pick the rotation N from 1 to 25, it covers the whole family of simple shift ciphers, including the historic Caesar cipher (N=3) and the self-inverse ROT13 (N=13). It is a favourite for puzzles, escape rooms and introductory cryptography lessons.

How it works

Each letter has a position in the alphabet from 0 (A) to 25 (Z). Encoding adds N to that position and wraps with modulo 26, so a letter at position p becomes (p + N) mod 26. Uppercase and lowercase are handled separately and case is preserved. Decoding subtracts N, which is mathematically identical to encoding with 26 - N — that is exactly what this tool does in decode mode, so the same N always reverses cleanly.

Only the 26 Latin letters are affected. Digits, whitespace and punctuation are copied straight through, keeping the shape of the message readable while the letters are scrambled.

Example

With N=3 (the Caesar cipher), encoding shifts each letter three places forward:

GERA -> JHUD

G (6) becomes J (9), E (4) becomes H (7), and so on. Decoding JHUD with N=3 shifts back three places and returns GERA. With N=13 the cipher equals ROT13, where GERA becomes TREN.

Notes

  • Because there are only 25 useful shifts, a ROT-N message can be cracked by brute force or by spotting the most common letter — it offers no real security.
  • N=13 is the only shift that is its own inverse; for all other N the encode and decode directions differ.
  • To rotate digits and symbols as well as letters, use the ROT47 tool.
Ad placeholder (rectangle)