Encrypt and decrypt text using the ancient Caesar cipher substitution technique. One of the oldest and simplest encryption methods in cryptography.
2026-03-28T00:00:00Z
The Caesar cipher, also known as Caesar's cipher, shift cipher, or Caesar shift, is one of the oldest and simplest encryption techniques in cryptography. It is a substitution cipher where each letter in the plaintext is replaced by a letter a fixed number of positions forward or backward in the alphabet. Named after Julius Caesar, who used it around 50 BCE to protect military messages, the cipher shifts each letter by a consistent amount. For example, with a shift of 3, the letter 'A' becomes 'D,' 'B' becomes 'E,' and so on. The cipher wraps around at the end of the alphabet, so 'X' becomes 'A,' 'Y' becomes 'B,' and 'Z' becomes 'C.' Non-alphabetic characters like spaces, numbers, and punctuation remain unchanged in the traditional implementation, preserving the structure of the original text.
While historically significant and educationally invaluable for introducing cryptographic concepts, the Caesar cipher is not secure by modern standards. With only 25 possible keys (shifts 1–25), it can be broken by brute force in seconds. It is also vulnerable to frequency analysis since the letter frequency distribution is preserved from the plaintext to the ciphertext. If an attacker knows the message language, they can identify common letters (like 'E' in English) and work backward to determine the shift. However, the cipher remains an excellent gateway to cryptography for students and continues to have cultural significance as a symbol of early encryption.
Select whether you want to encode plaintext (encrypt) or decode ciphertext (decrypt). Encryption shifts letters forward; decryption shifts backward. The shift amount is the same value for both directions—a shift of 3 encrypts A→D and decrypts D→A.
Type or paste the text you want to process. The Caesar cipher preserves spaces, numbers, punctuation, and case (uppercase stays uppercase, lowercase stays lowercase). Only alphabetic characters are shifted; everything else passes through unchanged.
Choose a shift value between 1 and 25. This is the number of positions each letter moves in the alphabet. For historical authenticity and common usage, shift 3 is the most famous. Use the slider or type a number directly for quick adjustments.
The encryption/decryption happens automatically as you enter text and adjust the shift value. Watch the result update in real time on the right side. The output shows the transformed text, character count, and number of letters affected.
Click the 'Copy Result' button to copy the encrypted or decrypted text to your clipboard. Use this to share encrypted messages with friends or store them for later. Load examples to see how the cipher works with different shift values.
Each character shifts exactly 3 positions forward in the alphabet. With shift 3, 'HELLO' becomes 'KHOOR,' the classic Caesar correspondence.
No, it is extremely insecure by modern standards. With only 25 possible keys, it can be broken in seconds by trying all shifts (brute force). It is also vulnerable to frequency analysis. Use it for learning, puzzle games, or fun—never for real security.
Yes. Roman historian Suetonius documented that Julius Caesar used a shift of 3 to protect military and personal communications around 50 BCE. At that time, literacy was rare, making even simple encryption effective. He also used other substitution methods for added security.
ROT13 is a Caesar cipher with shift 13. Since the English alphabet has 26 letters, applying ROT13 twice returns the original text (it's self-inverse). It is commonly used online to obscure spoilers, puzzle answers, and offensive content while remaining trivially reversible.
Try all 25 possible shifts (brute force) or use frequency analysis. In English, 'E' is the most common letter. Identify the most frequent letter in the ciphertext, assume it's 'E,' calculate the shift, and verify. Takes seconds manually or instantly with a computer.
The traditional Caesar cipher only shifts alphabetic letters, leaving numbers, spaces, and punctuation unchanged. You can extend the concept to encrypt other character sets (e.g., shift digits 0–9 by wrapping, or encode all ASCII characters), but the classic version preserves non-letters.
Preserving uppercase and lowercase letters maintains readability and structure. Uppercase letters shift separately from lowercase (A–Z, then a–z). This is a design choice; some implementations convert everything to one case before encryption for stronger obscurity.
A substitution cipher replaces each letter with another letter according to a fixed mapping. Caesar cipher is a specific type where the mapping is a simple shift. General substitution ciphers use arbitrary mappings (e.g., A→Q, B→X), which are harder to break but still vulnerable to frequency analysis.
Modern cryptography uses algorithms like AES, RSA, and ChaCha20, which employ mathematical operations, massive key spaces (2¹²&sup8; to 2²&sup5;&sup6; possible keys), and resistance to all known attacks. Caesar cipher is now purely educational and nostalgic.
Related Tools