A few words, such as the, of and and, fill most of any text, while most words appear only once or twice. The Zipf’s law calculator takes the vocabulary size, the text length, the Zipf exponent and a rank, and gives the share of the text for the word of that rank, its expected number of occurrences, the share covered by the top words and the ratio to the most frequent word.
How the calculation works
- Enter the size of the vocabulary, meaning the number of different words, the total number of words in the text and the Zipf exponent, which is close to 1 for most languages.
- Enter the rank of the word, where 1 is the most frequent word, 2 the next one, and so on.
- Zipf’s law says the frequency of the word of rank r is proportional to 1 / r^s. The calculator divides by the sum of 1 / k^s over the whole vocabulary to get a share.
- Read the share of the text for that word, its expected count, the cumulative share of the words up to that rank and the ratio to the top word.
Example
A text of 1,000,000 words has a vocabulary of 50,000 words and a Zipf exponent of 1.0. The normalising sum is about 11.39. The word of rank 100 makes up 1 / (100 × 11.39) = 0.0878 % of the text, or about 878 occurrences. The top 100 words together cover about 45.5 % of the text, and the top word is 100 times more frequent than the word of rank 100.
Why it matters
Zipf’s law explains why word lists work. It helps language learners decide how many words give a given coverage, helps with sizing search indexes, keyboard dictionaries and compression models, and appears in the sizes of cities, web traffic and many other ranked data sets. The calculator gives an expectation to compare with real counts.
Good to know
The ideal law is a first approximation. Real frequency tables bend at both ends, the exponent depends on the language and the genre of the text, and rare words follow other laws. The approximate sum is least accurate for very small vocabularies or large exponents. Treat the figures as typical values and not as exact counts.
Related tools
The vocabulary goal calculator plans how many words to learn, the reading time calculator estimates time for a text, the readability score calculator rates how hard a text is, and the Pareto distribution calculator covers a related heavy-tailed law.