Frequency Analysis Tool

Break Ciphers with Statistical Analysis

๐Ÿ“Š CRYPTANALYSIS โ€ข ๐Ÿ” PATTERN DETECTION

About Frequency Analysis

Frequency analysis is one of the most powerful techniques in cryptanalysis. By examining how often letters, pairs (bigrams), and triplets (trigrams) appear in encrypted text, you can break substitution ciphers and understand text patterns.

In English, the letter E appears most frequently (~12.7%), followed by T (~9.1%), A (~8.2%), and so on. Common bigrams include TH, HE, IN, ER, while common trigrams include THE, AND, ING, HER.

Use Cases:

  • Breaking Substitution Ciphers: Match encrypted letter frequencies to English patterns
  • Language Detection: Different languages have different frequency distributions
  • Text Authenticity: Natural text follows expected patterns
  • Cipher Identification: Unusual frequencies suggest different cipher types
  • Learning Cryptanalysis: Understand fundamental cipher-breaking techniques
โ„น๏ธ Enter any text to analyze letter, bigram, and trigram frequencies. Case-insensitive analysis, non-alphabetic characters are ignored.
Characters: 0 / 50,000

๐Ÿ“š How Frequency Analysis Works

The Basics

Every language has predictable patterns in how often letters appear. In English, some letters are far more common than others. By counting letter frequencies in encrypted text, we can make educated guesses about substitutions.

Expected English Frequencies

Most Common: E (12.7%), T (9.1%), A (8.2%), O (7.5%), I (7.0%)
Common: N (6.7%), S (6.3%), H (6.1%), R (6.0%)
Least Common: Z (0.07%), Q (0.10%), X (0.15%), J (0.15%)

Bigrams & Trigrams

Looking at pairs and triplets of letters provides even more powerful analysis:

Common Bigrams: TH, HE, IN, ER, AN, RE, ON, AT, EN, ND
Common Trigrams: THE, AND, ING, HER, HAT, HIS, THA, ERE, FOR, ENT

Breaking a Cipher

To break a substitution cipher with frequency analysis:

  1. Count frequencies: Analyze the ciphertext
  2. Match patterns: Compare with expected English frequencies
  3. Make substitutions: Replace most common cipher letters with E, T, A, etc.
  4. Look for patterns: Watch for common words like THE, AND, OF
  5. Refine: Adjust based on context and word patterns
โš ๏ธ Limitations:

Frequency analysis works best on longer texts (100+ characters). Short messages may not have representative frequencies. It's also ineffective against polyalphabetic ciphers (like Vigenรจre) that use multiple substitution alphabets.

๐Ÿ’ก Example Analyses

Example 1: Normal English Text

"The quick brown fox jumps over the lazy dog. This pangram contains every letter of the alphabet."
Expected: High frequency of E, T, O, A. Common bigrams: TH, HE, ER

Example 2: Caesar Cipher (Shift 3)

"WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ"
Analysis: K appears most (replaces H), shows shifted pattern

Example 3: Random Substitution

"MDS NFOER ZKCVB PCW XFGHY KCST MDS QDUA JCL"
Analysis: Frequency patterns help identify Eโ†’S, Tโ†’M, etc.

โ“ Frequently Asked Questions

How much text do I need for accurate analysis?

Generally, at least 100 characters are needed for basic patterns, but 500+ characters provide much more reliable results. The longer the text, the more closely it will match expected frequency distributions.

Why doesn't frequency analysis work on all ciphers?

Frequency analysis is effective against monoalphabetic substitution ciphers (where each letter always maps to the same letter). It doesn't work well on:

  • Polyalphabetic ciphers (Vigenรจre, etc.) - use multiple alphabets
  • Transposition ciphers - rearrange letters without substitution
  • Modern ciphers - use complex mathematical operations

What are bigrams and trigrams?

Bigrams are two-letter combinations (TH, HE, IN), and trigrams are three-letter combinations (THE, AND, ING). These patterns are even more distinctive than single letters and can help confirm substitution guesses.

Can I analyze non-English text?

Yes! Every language has its own frequency distribution. However, this tool compares results to English frequencies. For other languages, you'd need to compare against that language's expected patterns.

Is my text stored or sent anywhere?

No. All analysis happens in your browser. Your text never leaves your computer, ensuring complete privacy. This tool works entirely client-side using JavaScript.