Skip to main content
AllDevToolsHub
🔄

Caesar / ROT13 Cipher

100% Local

Encrypt and decrypt text with Caesar cipher or ROT13.

Caesar / ROT13 Cipher
13ROT13
Gur dhvpx oebja sbk whzcf bire gur ynml qbt
Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.

Enter text and adjust the shift. Use brute-force mode to show all 25 possible decryptions at once.

Overview

What is Caesar / ROT13 Cipher?

Apply a Caesar cipher with any shift 1–25, or use ROT13. Supports encrypt, decrypt, and brute-force modes showing all 25 possible decryptions at once.
FAQ

Frequently Asked Questions

Reference

Technical Deep Dive

ENCODERS & DECODERS

Caesar / ROT13 Cipher

Apply a Caesar cipher with any shift from 1–25, or use the classic ROT13 (shift 13). Supports encrypt, decrypt, and brute-force modes that show all 25 possible decryptions at once. Non-alphabetic characters are preserved unchanged.

🧬

Spec-Compliant

Follows the RFC or de-facto encoding rules, no custom dialects, no surprises.

🔄

Lossless Round-Trip

Encode then decode and you get back exactly what you put in, byte for byte.

📡

Handles Edge Cases

Unicode, padding, invalid input, surfaced clearly instead of silently mangling output.

01 Shift Alphabet Matrix (k=3)

Type A B C D ... X Y Z
PlaintextABCD...XYZ
CiphertextDEFG...ABC

02 Transformation Logic Pipeline

1
Alphabet Normalization The input is scanned to separate alphabetic characters from punctuation, numbers, and whitespace.
2
Modular Shift Each character's ASCII code is transformed using the (code + shift) % 26 algorithm.
3
Case Preservation The original casing (Upper/Lower) is mapped back to the shifted character to maintain visual fidelity.

03 When You Reach for Caesar / ROT13

Caesar is a teaching cipher, a puzzle primitive, and a social convention, never a security tool. Use it where the goal is light obfuscation or pedagogy, and stay far away from it for anything that protects real data.

  • 🚩
    CTF and crypto challenges PicoCTF, HackTheBox intro tracks, and Cryptopals Set 1 all feature Caesar/ROT13 as the warm-up. Recognising a constant shift by frequency analysis is the entry-level skill before stepping up to Vigenère or substitution ciphers.
  • 📰
    Spoiler tags on Usenet, Reddit, and forums ROT13 has been the convention for hiding spoilers, joke punchlines and offensive content since the 1980s. The point is not secrecy, it is a one-click round-trip that requires deliberate effort to read.
  • 🧩
    Escape rooms and kids' puzzles Cracking a Caesar with paper and pencil is satisfying for a child; the alphabet wheel is a classic prop. It is a great introduction to the very idea of a "key" without any of the math of modern crypto.
  • ⚠️
    "Obscuring" config values in source code Some teams ROT13 a string to make it less greppable in a repo. Anyone with two minutes and a search engine can reverse it. If something must not be in the repo, use a secret manager, not a shift.
  • 🚫
    Protecting passwords, tokens, or PII 25 possible keys is a brute-force size of "try them all in microseconds." Frequency analysis breaks even a long Caesar instantly. For real confidentiality use AES-GCM, ChaCha20-Poly1305, or libsodium, never a shift cipher.

04 Worked Examples

EXAMPLE 1 · ROT13 IS ITS OWN INVERSE
Plaintext:
The treasure is behind the painting
After ROT13:
Gur gernfher vf oruvaq gur cnvagvat
After ROT13 again:
The treasure is behind the painting

Because 13 + 13 = 26 and the English alphabet has 26 letters, ROT13 is an involution: encrypt = decrypt. This is why Usenet adopted it, one button toggles the spoiler in either direction.

EXAMPLE 2 · BREAKING IT BY FREQUENCY
Ciphertext (shift unknown):
Khoor Zruog, wklv lv d Fdhvdu flskhu
Letter frequency in this ciphertext:
h ─ 5 times (most common)

l ─ 4 times
v ─ 3 times


English's most common letter is E. h - e = 3, so shift back 3:

Hello World, this is a Caesar cipher

In English: E, T, A, O, I, N, the ETAOIN heuristic. Even a 30-character Caesar leaks enough frequency information that the shift is obvious without trying all 25 keys.




EXAMPLE 3 · WHY 25 KEYS IS NOT SECURITY

A modern key search space (for reference):

Caesar    →  25 keys      (microseconds)
DES → 2^56 keys (broken, ~hours)
AES-128 → 2^128 keys (heat-death-of-universe)

Brute-forcing all 25 Caesar shifts on a laptop:

for k in 1..25:
candidate = decrypt(ct, k)
print(k, candidate)

total time: a few microseconds, then a human eye picks the English one

Even without frequency analysis the entire keyspace is enumerable faster than you can read this paragraph. Caesar's security model is literally "the attacker doesn't realise it's a Caesar."

05 Related Tools

Caesar lives in a corner of "classical ciphers and puzzle primitives." For real cryptography or richer transformations, step over to these.

You Might Also Need