Logo

MonoCalc

/

Letter Frequency Counter

Text
Counting runs as you type — nothing is uploaded. Limit 1,000,000 characters.

Samples:

Counts any Unicode letter. Spaces, digits and punctuation are ignored, so percentages are shares of the letters alone.
Table headers are clickable and change this too.
Overlays published letter frequencies and scores the fit.
Nothing to count yet
Enter some text to analyse.

About This Tool

Letter Frequency Counter – Counting Characters and Reading the Distribution

Written language is not random. In ordinary English prose the letter E accounts for around 12.7% of all letters, while Z manages about 0.07% — a gap of nearly two hundred times. Take the top six letters, E, T, A, O, I and N, and you already have roughly half of every letter on the page. That lopsidedness is what makes a letter frequency counteruseful: once you can see the shape of a text's distribution, you can compare it against what the language normally does and notice when something is off.

What the counter actually measures

The tool walks your text once, code point by code point, and tallies each character into a bucket. Before a character is counted it passes through the filters you set: it may be lowercased so A and a share a bucket, it may have its accent folded away so café contributes to E, and it is checked against the chosen character set — letters only, letters plus digits, strict ASCII alphanumerics, or every character including punctuation and whitespace.

The percentage beside each count is always a share of what was counted, never of the raw text. That distinction matters more than it sounds. A 44-character sentence containing 8 spaces has a denominator of 36 in letters-only mode and 44 once whitespace joins in, so the same three occurrences of E read as 8.33% in one mode and 6.82% in the other. Both are correct answers to different questions, which is why the summary always shows counted total and raw length side by side.

Frequency analysis and classical ciphers

A substitution cipher replaces each letter with another one consistently. That relabels the distribution without reshaping it — the tallest bar is still the tallest bar, it just wears a different name. Frequency analysis exploits exactly this: in a long enough ciphertext the most common symbol is overwhelmingly likely to stand for E, and the rest of ETAOIN SHRDLU follows.

For the Caesar cipher, where every letter moves by the same fixed offset, the tool finishes the job for you. It scores all 26 rotations with a chi-squared goodness-of-fit test against the selected reference language and reports the offset with the lowest score. The formula is χ² = Σ (observed − expected)² / expected, where the expected count for each letter is that language's published frequency scaled to your letter total. A slider lets you rotate the text yourself and watch the score fall as the alignment snaps into place.

Chi-squared needs volume
The score is suppressed below 20 letters and stays noisy well past 100. Short texts, technical jargon, names and deliberate constraints all push it up without anything being wrong. Read a low score as evidence of a match, and a high one as a reason to look closer — not as a verdict.

Beyond the raw counts

The same single pass produces the figures that usually get wanted alongside a frequency table. The A–Z coverage grid fills a cell for every letter that appears, making a pangram obvious at a glance and a lipogram — text deliberately written without some letter — just as obvious in the other direction. The vowel and consonant split reports both counts and their ratio, with an option to file Y on either side.

Shannon entropy, computed as H = −Σ p·log₂(p), says how many bits are needed on average to encode one character of the observed distribution. A text using every character about equally reaches the maximum of log₂(n) for its n distinct characters; a repetitive one falls well short. Alongside it, a character-class breakdown counts letters, digits, punctuation and whitespace separately, which is often the fastest way to find unexpected characters — smart quotes, non-breaking spaces, stray control codes — hiding in a payload that was supposed to be plain.

Precision, Unicode and privacy

Counting iterates over code points rather than UTF-16 units, so an emoji or a supplementary-plane character counts as one character instead of being split into surrogate halves. Whitespace is rendered with visible glyphs — , , — so an invisible character can never be mistaken for an empty cell. Percentages are reconciled with the largest-remainder method, so the column sums to exactly 100% instead of drifting to 99.99%.

Everything runs in your browser. Counting, the entropy figure, the chi-squared fit and both exports happen locally, and nothing is transmitted — which matters when the text is a puzzle you are mid-way through, an unpublished draft, or a confidential document. Your last input and settings are kept in your own browser's storage so the page is where you left it, and clearing the box clears the stored copy.

Frequently Asked Questions

Is the Letter Frequency Counter free?

Yes, Letter Frequency Counter is totally free :)

Can I use the Letter Frequency Counter offline?

Yes, you can install the webapp as PWA.

Is it safe to use Letter Frequency Counter?

Yes, any data related to Letter Frequency Counter only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Letter Frequency Counter work?

Your text is walked once, code point by code point, using Array.from so that emoji and other astral-plane characters are counted as one character instead of being split into surrogate halves. Each character is optionally lowercased and stripped of its accent, checked against the character set you chose and against your ignore list, and then tallied in a map. The percentage for a character is its count divided by the total of everything counted, which is why switching from Letters only to All characters changes every percentage — the denominator changed, not the counts.

Why do the percentages change when I include spaces or punctuation?

Because the percentage is always a share of what was counted, not of the raw text. In Letters only mode a 44-character sentence with 8 spaces has a denominator of 36, so E appearing 3 times reads as 8.33%. Turn on All characters with spaces included and the denominator becomes 44, so the same 3 occurrences read as 6.82%. Neither figure is wrong; they answer different questions. The summary strip always shows the raw text length alongside the counted total so the two are never confused.

How does frequency analysis break a substitution cipher?

A simple substitution replaces each letter consistently, so it moves the labels on the distribution without changing its shape. English is heavily skewed — E alone is about 12.7% of letters, and E, T, A, O, I and N together are roughly half of all text — so the most common symbol in a long enough ciphertext is very probably E. The tool automates the Caesar case completely: it scores all 26 rotations with chi-squared against the reference distribution and reports the best-fitting shift. General substitution ciphers still need human work, but the frequency table is where that work starts.

What does the chi-squared score mean, and when is it unreliable?

Chi-squared sums (observed − expected)² ÷ expected across A–Z, where the expected counts come from the reference language's published frequencies scaled to your letter total. A low score means the distribution matches the language; a high one means it does not. It is only meaningful with enough text — the tool suppresses the number below 20 letters and says so rather than printing a misleading figure, and even at 100 letters the score is noisy. Short texts, technical jargon and deliberate constraints like lipograms all produce high scores without anything being wrong.

How accurate are the reference frequency tables?

They are published averages over large general corpora for English, French, German, Spanish and Italian, and they are approximations by nature. Real letter frequencies drift with genre, era and subject matter: a chemistry paper, a legal contract and a novel all differ measurably from the average and from each other. Use the comparison to spot a broad match or mismatch, not as a precise measurement. Non-Latin alphabets are outside the comparison entirely, though counting itself works on any script.

Is my text uploaded anywhere?

No. Counting, entropy, the chi-squared fit and every export run in your browser, and nothing is transmitted — which matters when you are analysing a puzzle, a draft or a confidential document. Your last input and settings are kept in your own browser's local storage so the page is where you left it next time, and clearing the box clears the stored copy. Share links carry your settings plus up to 600 characters of text so a specific result can be sent to someone else.