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.
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.