🏛️ Caesar Cipher

🔧
🔢
{{ shift }}
📍 ROT13 - Popular choice (encoding = decoding) 🏛️ Caesar's preferred shift 🔄 {{ 26 - shift }} positions backward for decoding
⚙️
📝
📤
🔤
Original: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Shifted: {{ getShiftedAlphabet() }}
📊
Total Letters: {{ analysis.total_letters }}
Unique Letters: {{ analysis.unique_letters }}
Most Frequent: {{ analysis.most_frequent }}
Shift Strength: {{ getShiftStrength() }}
Top Letters:
{{ letter }}: {{ count }}
⚠️ {{ error }}

ℹ️ About Caesar Cipher

Caesar cipher, also called a shift cipher or rotation cipher, is a monoalphabetic substitution cipher: each plaintext letter is replaced by the letter a fixed number of positions away in the alphabet. Historical summaries such as Britannica's Caesar cipher overview describe the classic Julius Caesar version as a three-letter shift, while Britannica's substitution cipher entry places it in the broader family of one-to-one alphabet replacement systems.

Common uses: Caesar shifts are useful for puzzle hunts, escape-room clues, classroom cryptography lessons, CTF warm-ups, cipher-wheel demonstrations, and quick examples of modular arithmetic. They can also hide spoilers or non-sensitive hints from casual reading, but they should be treated as obfuscation, not protection.

Shift and rotation details:

  • A shift value from 1 to 25 selects how far each A-Z letter rotates through the alphabet.
  • With shift 3, A maps to D, B maps to E, and Z wraps around to C.
  • Decoding uses the inverse rotation: shift 3 forward is the same as shift 23 backward in a 26-letter alphabet.
  • ROT13 is the special Caesar shift of 13, where encoding and decoding are identical because 13 + 13 = 26.
  • This tool works on Latin letters and can preserve case, spaces, numbers, and punctuation depending on the selected options.

Examples: HELLO with shift 3 becomes KHOOR; Attack at dawn! becomes Dwwdfn dw gdzq! when case, spaces, and punctuation are preserved. To decode KHOOR, apply the same shift in reverse to recover HELLO.

Limitations and security: The Caesar cipher is not secure encryption. There are only 25 useful shifts for English A-Z text, identical plaintext letters always become identical ciphertext letters, and letter-frequency patterns remain visible. Use it for learning, games, historical demonstrations, and non-sensitive text only; use modern cryptography for passwords, secrets, API keys, private messages, or production data.

API Usage Example:

POST /api/tools/encoding-decoding/caesar
Content-Type: application/json

{
    "text": "Hello World",
    "operation": "encode",
    "shift": 3,
    "preserve_case": true,
    "preserve_non_alpha": true
}
Ready