Dev TooloraLocal dev tools

> Encoders

Caesar/ROT13 Cipher

Rotate ASCII letters by a whole-number shift, preserving case and other characters; defaults to ROT13.

Runs locallyWorks offline
Back to results
Input

Source data

Output

Result

Your result will appear here.

Tool guide

About this tool.

A Caesar cipher substitutes each letter with another a fixed number of positions along the alphabet, wrapping from Z back to A.

ROT13 uses a shift of 13 across the 26 ASCII letters, so applying it twice returns the original text; it is obfuscation, not secure encryption.

  • Decode or create ROT13 text for a puzzle, spoiler or teaching example.
  • Demonstrate alphabet rotation with a positive or negative shift.
  • Test a simple reversible letter substitution without changing digits, whitespace or punctuation.

Paste or type the text to rotate; digits, spaces, punctuation and accented letters are copied unchanged.

Enter a whole-number Shift; the default 13 applies ROT13, and a positive value moves letters forward through the alphabet.

To undo a shift, run the result with its negative, such as -3 after 3; for ROT13, run the output with 13 again to restore the original text.

Run and copy the result; use 0 to leave the text unchanged, and check the summary for the shift that was applied.

  • Shift 13: Hello → Uryyb → Hello on a second run
  • Shift 3: Abc xyz! → Def abc!
  • Shift -3: Def abc! → Abc xyz!
  • Shift 0 or 26: Hello → Hello
  • Shift 29: Abc → Def (29 wraps to 3)

  • Only A–Z and a–z rotate; case is preserved, while accents, emoji, punctuation, spaces and digits stay unchanged.
  • Shifts wrap modulo 26; an empty Shift, fractions, exponent notation and integers outside the JavaScript safe range are rejected.
  • There are only 26 distinct rotations, so this does not protect secrets or replace modern cryptography.

FAQ

Questions about Caesar/ROT13 Cipher

How do I decode a Caesar cipher?

Run the text with the opposite shift: a message made with shift 3 is restored with -3, or with 23, which is the same rotation. If the shift is unknown, try 1 to 25 until readable text appears.

Why does ROT13 use the same setting to encode and decode?

A shift of 13 is exactly half of the 26-letter alphabet, so two rotations add up to a full turn. Running Shift 13 on ROT13 text therefore restores it, while any other shift needs its negative to undo it.

Can I use a negative shift or one larger than 25?

Yes. Any whole number in the JavaScript safe-integer range works and is reduced modulo 26, so 29 behaves like 3 and -1 like 25. Decimal values such as 2.5 and an empty Shift are rejected.

Does it work with accented letters or other alphabets?

No. Only the ASCII letters A–Z and a–z rotate, so letters such as é, ß or Cyrillic characters stay as they are and words containing them are only partly shifted: café with shift 13 becomes pnsé.

Continue with

Morse Code TranslatorConvert supported letters, digits and punctuation to dot/dash Morse notation and decode it to uppercase text.ASCII/Text ConverterConvert 7-bit ASCII text to whitespace-separated decimal codes from 0 to 127 and back.