Skip to content
Omnikalc

Zipf's law calculator: how often does the word of rank r appear?

Enter the vocabulary size, the text length, the exponent and a rank to get the expected share, the count and the cumulative coverage of the top words.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Results

Share of the text taken by the word

0.088 %

Expected number of occurrences
878
Share of the text covered by the top words
45.5 %
How many times more often the top word appears
100.0 ×

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.

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.

Frequently asked questions

What is Zipf's law?

It is an empirical rule, named after the linguist George Kingsley Zipf, that the frequency of a word is inversely proportional to its rank in the frequency table. The most frequent word appears about twice as often as the second, three times as often as the third, and so on. It holds roughly for words in most languages.

What does the exponent s mean?

The exponent sets how fast the frequency falls with rank. For s = 1, the original law, a word of rank 10 is ten times rarer than the top word. Natural languages have exponents between about 0.9 and 1.2, and larger values mean a text where a few words dominate. You can fit s from a log-log plot of frequency against rank.

Why do a few words cover so much of the text?

Because the frequencies drop so fast, the top few hundred words, such as articles, prepositions and pronouns, account for about half of any text. This is why a learner who knows the 1,000 most frequent words can follow a large share of an ordinary text, even with a vocabulary far smaller than that of a native speaker.

Is the calculator exact?

It uses the Euler–Maclaurin approximation for the sum of 1 / k^s, which is accurate to about 0.02 % for typical vocabularies. Real texts deviate from the ideal law, with a flatter head and a steeper tail, and small samples are noisy. Use the result as an expectation for a typical text of that size.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.