Heaps’ law describes how the vocabulary of a text grows as the text gets longer. The Heaps’ law calculator takes the constants K and β, the number of words and a target vocabulary, and gives the expected vocabulary size, the new words per 1,000 extra words, the text length needed for the target vocabulary and the share of the text that is a different word.
How the calculation works
- Heaps’ law says that the number of different words V grows as a power of the text length N: V = K × N^β.
- K and β are fitted to a corpus. For English text, K is often between 10 and 100 and β between 0.4 and 0.6.
- The rate of new words is the derivative, K × β × N^(β − 1) per word, so it falls as the text gets longer. The calculator multiplies it by 1,000.
- To find the text length needed for a target vocabulary, solve the law for N: N = (V ÷ K)^(1 ÷ β).
Example
With K = 44 and β = 0.5, a text of 100,000 words has about 44 × 316.2 = 13,914 different words, which is 13.9 % of the text. Each extra 1,000 words adds about 69.6 new words. To reach a vocabulary of 20,000 different words, the text must contain (20,000 ÷ 44)² = about 206,612 words.
Why it matters
Anyone who builds a search index, a language course or a text analysis needs to know how fast the vocabulary grows. The law gives a quick way to plan storage, estimate reading volume and compare texts.
Good to know
The law is empirical and fits large natural-language corpora well, but not tiny samples or very repetitive texts. The constants change with the language and the way words are counted. Use values fitted to a corpus like yours, and treat the results as approximate.
Related tools
The readability calculator scores how easy a text is, and the reading time calculator estimates how long a text takes to read.