← All animations

📊 Zipf's Law

Count the words in almost any chunk of natural language and a strange regularity appears: the most common word turns up about twice as often as the second, three times as often as the third, and so on. Frequency falls off as roughly 1 / rank. Type your own text below, watch the counts plotted, and see the very same numbers snap into a straight line on a log–log plot — the fingerprint of a power law.

1. Your text, ranked — the slope of word frequencies

Paste or edit the text below. Every word is counted live, then sorted from most to least common. The bar for rank 1 ("the", usually) towers over the rest; rank 2 is roughly half as tall, rank 3 a third, and the tail trails off forever. That descending curve is Zipf's law.

— words · — unique
RankWordCountfreq × rank

If frequency really is proportional to 1/rank, then count × rank should stay roughly constant down the table. It won't be exact — real language is noisy — but watch how steady that last column is compared with the wild swing in raw counts.

2. The log–log straight line — where the law shows itself

A power law (frequency ∝ rank−s) looks like a curve on ordinary axes, but plot the log of frequency against the log of rank and it straightens into a line whose slope is −s. Zipf's law is the special case s ≈ 1. Your text's points are plotted as dots; the dashed line is an ideal slope of −1 for comparison.

fitted slope: — closer to −1 = more Zipf-like

Taking logs turns multiplication into addition: "rank 10 is 10× rarer than rank 1" becomes "one step right, one step down". That's why log–log straightens power laws — and why a straight line here is such a clean signature.

3. It's everywhere — not just words

The same 1/rank shape shows up far beyond language: the sizes of cities, the traffic to websites, the wealth of individuals, even the magnitudes of earthquakes. Toggle a built-in dataset and watch the very same descending curve and log–log line appear.

These are illustrative figures, not a precise census — but the pattern is robust. Possible reasons are debated: Zipf himself argued for a principle of least effort (speakers want a small, reusable vocabulary; listeners want precise distinctions, and 1/rank balances the two), while in growing systems preferential attachment ("the rich get richer") produces power laws too. No single cause is settled — treat it as a deep empirical regularity rather than a proven mechanism.

4. The short version