User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Category Security
Non-alphabetic characters pass through unchanged.
0–25
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

The Caesar cipher is one of the earliest known substitution ciphers, attributed to Julius Caesar for military correspondence. Each letter in the plaintext is shifted by a fixed number k positions along the alphabet. With only 25 possible keys, the cipher is trivially breakable by brute force or frequency analysis. It offers zero cryptographic security by modern standards. This tool performs real-time encryption and decryption, generates all 25 rotations for brute-force analysis, and computes letter frequency distributions against the standard English corpus. It handles mixed-case text, preserving capitalization while passing digits, punctuation, and whitespace through unmodified.

Note: this tool approximates classical Caesar behavior on the 26-letter Latin alphabet only. Characters outside A - Z are not shifted. For languages with extended alphabets (e.g., German ß, Scandinavian Γ₯Àâ), those characters pass through unchanged. ROT13 is the special case where k = 13, making encryption and decryption identical operations.

caesar cipher cipher tool encryption decryption ROT13 substitution cipher cryptography brute force cipher

Formulas

The Caesar cipher operates on modular arithmetic over the integer ring Z26. Each letter is mapped to its zero-indexed position (A = 0, B = 1, …, Z = 25).

Encryption function:

E(x) = (x + k) mod 26

Decryption function:

D(x) = (x βˆ’ k) mod 26

Where x is the zero-indexed position of the input character, k is the shift key (0 ≀ k ≀ 25), and mod denotes the modulo operation ensuring wrap-around. The frequency analysis chi-squared statistic is computed as:

Ο‡2 = 25βˆ‘i=0 (Oi βˆ’ Ei)2Ei

Where Oi is the observed count of the i-th letter and Ei is the expected count based on standard English letter frequencies (e.g., E 12.7%, T 9.1%). The shift yielding the lowest Ο‡2 is the most probable key.

Reference Data

Shift (k)Name / Alias"HELLO" EncryptedHistorical Use
0Identity (no cipher)HELLOPlaintext reference
1Caesar +1IFMMPBasic educational example
3Classical CaesarKHOORUsed by Julius Caesar (Suetonius, Vita Divi Julii Β§56)
4Caesar +4LIPPSVariant reported in some historical analyses
5Caesar +5MJQQTCommon puzzle shift
7Caesar +7OLSSVUsed in some geocaching puzzles
10Avocat cipherROVVYFrench legal document obfuscation (apocryphal)
13ROT13URYYBUsenet spoiler protection (RFC 4880 armor)
14Caesar +14VSZZCEquivalent to ROT13 + ROT1
19Caesar +19AXEEHCrossword cipher variant
21Augustus cipherCZGGJUsed by Emperor Augustus (shift of +1 was his variant, debated)
23Caesar βˆ’3EBIILEquivalent to decrypting with k = 3
25Atbash-adjacentGDKKNMaximum shift; reverse-neighbor substitution

Frequently Asked Questions

A shift of k = 0 maps every letter to itself, producing plaintext identical to the input. It is the identity transformation and provides no encryption. Therefore only shifts 1 through 25 produce distinct ciphertexts, giving 25 meaningful keys.
In English text of sufficient length (roughly 100+ characters), letter frequencies converge toward known distributions. The letter E appears approximately 12.7% of the time. If the most common letter in the ciphertext is H, the likely shift is 3 (since H βˆ’ E = 3). The chi-squared test automates this by comparing observed frequencies against the expected English distribution for every possible shift.
This tool passes all non-alphabetic characters through unchanged. Only ASCII letters A - Z and a - z are shifted. Digits (0 - 9), whitespace, and punctuation remain in place. This matches the classical definition of the Caesar cipher, which operates exclusively on the 26-letter Latin alphabet.
Yes. ROT13 is the specific case where k = 13. Because 13 + 13 = 26 ≑ 0 (mod 26), applying ROT13 twice returns the original text. This self-inverse property made it popular on Usenet for hiding spoilers without needing a separate decrypt step.
The modular arithmetic generalizes to any alphabet of size n: E(x) = (x + k) mod n. For the Russian Cyrillic alphabet, n = 33. For Hebrew, n = 22. This tool is scoped to the 26-letter Latin alphabet. Extended Latin characters (Γ©, Γ±, ΓΌ) pass through unmodified.
Brute force displays all 25 possible decryptions simultaneously. A human reader can visually scan for intelligible English text. For automated detection, the tool computes a chi-squared statistic for each shift against English letter frequencies and highlights the most probable key. This approach is effective for ciphertexts longer than approximately 25 - 50 characters.