applets.

Letter Count

← All apps

About Letter Count

Paste or type any text, pick a sample, or open a file (text, Markdown, a web page, Word .docx, OpenDocument .odt or .rtf; you can also drop a file onto the page). It is counted straight away.

Keys: 1 to 4 pick a view, S switches the letter order, O opens a file.

YOUR TEXT STAYS WITH YOU

Everything happens inside this browser tab. A file you open is read by the page itself and is never uploaded or sent anywhere, and your text isn't saved: not in cookies or any browser storage. Close the tab (or press CLEAR) and it's gone.

THE STORY

Counting letters is an old code-breaker's trick. In the 800s the Arab scholar al-Kindi described how to break a cipher that swaps each letter for another: count the letters in the secret message, and the commonest one probably stands for the commonest letter of the language. In English that is E.

Printers knew the counts by heart, because they had to keep more of some letters than others in their type cases. When the Linotype machine (Ottmar Mergenthaler, first used at the New York Tribune in 1886) set newspaper lines in hot metal, its keyboard had the lower-case letters in rough order of use: the first two columns read ETAOIN SHRDLU. Operators ran a finger down them to fill up a line they had botched, and now and then that line slipped into the paper by mistake.

In the 1930s and 40s the American linguist George Kingsley Zipf noticed that, in almost any long text, the second commonest word turns up about half as often as the commonest, the third about a third as often, and so on. The French stenographer Jean-Baptiste Estoup had spotted the same pattern in 1916, but it is called Zipf's law.

A pangram uses every letter of the alphabet ("The quick brown fox jumps over the lazy dog" was being used for typing practice by the 1880s). A lipogram leaves one out on purpose: Ernest Vincent Wright's novel Gadsby (1939) has no letter E in its 50,000 words, and so has Georges Perec's French novel La Disparition (1969).

HOW IT WORKS

The text is read once, character by character, keeping tallies as it goes, so even a whole novel takes a fraction of a second. For the A to Z counts accented letters count as their plain letter (é as e, ß as ss, æ as ae). Words are runs of letters and digits; an apostrophe or hyphen inside a word keeps it as one word (don't, door-nail). Sentences end at a full stop, question mark or exclamation mark followed by a space, except after Mr., Mrs., Dr. and the like, so the count is close but not perfect. Reading time uses 238 words a minute, the average silent reading speed found by Marc Brysbaert's 2019 review of 190 studies.

The English shares are Robert Lewand's standard table; the other languages use the originally published figures from the table in Wikipedia's "Letter frequency" article, which keeps the accented letters (é, ä, ñ, ß…) separate. The article's current table has a few figures changed by a single digit (Spanish e 13.702, French y 0.708…), which push its French and Spanish columns to about 101% and 104%; the original figures each add up to 100%, so those are the ones used here. The language guess compares the text's share of every letter, accented ones included, with each table and adds up how much they overlap: 100% would mean exactly the same share of every letter. Different languages share most letters, so even a wrong language scores 70 to 85%; the gap between the top two matters more than the number. A few hundred letters are needed for a fair guess.

Zipf's expected line is the count C ÷ rank, with C chosen so the line's counts add up to the real number of words.

The samples are short openings of works long out of copyright.

FURTHER WATCHING AND READING

THE TEXT

Your text and files are read in this tab and never leave your computer. Nothing is saved: close the tab and it's gone.

This text Expected (English)

THIS TEXT ETAOIN SHRDLU