Rank / Frequency — log-log
Synthetic Zipf corpus Real text overlay Fitted power-law (dashed)
Cumulative token coverage (Lorenz curve)

Zipf's Law 2D: Rank-Frequency Plot Explorer

Every large body of natural-language text obeys a strikingly simple pattern: if you rank its words by how often they occur, frequency falls off as a power of rank, f(r) ≈ C / r^s, with s close to 1. This simulator makes that pattern tangible by generating a synthetic corpus from an explicit Zipfian probability table — draw N tokens from a vocabulary of V words weighted by 1/r^s — and plotting the resulting rank/frequency counts on a pannable, zoomable log-log chart, where a true power law shows up as a straight descending line. A second series tokenizes whatever text you paste into the box, counts real word frequencies, fits the same log-log line live, and overlays it in amber next to the synthetic teal series, while a companion cumulative-coverage chart shows how few distinct words are needed to account for half of all tokens.