Skip to content
Redmoon Calculators
Text analysis All languages

Lexical Diversity (TTR) Calculator

Type‑Token Ratio plus MATTR moving average — see how much your vocabulary repeats.

When to use this

Use TTR and MATTR to evaluate vocabulary range — common in language-learning assessments, child-language research, and stylometry. MATTR is preferable for comparing documents of different lengths because raw TTR drops as text grows.

How it compares

TTR and MATTR are complementary: TTR is intuitive but length-sensitive; MATTR is length-invariant but harder to explain. For formal research, prefer MATTR or one of its cousins (MTLD, HD-D).

0 chars

How it works

Type-token ratio (TTR) is the simplest measure of vocabulary variety: unique words / total words.

Because TTR drops as text gets longer, this tool also computes the Moving Average Type-Token Ratio (MATTR) over a 50-word window, which is length-invariant.

You also get a list of "hapax legomena" — words that appear exactly once.

Formula

FAQs

What is type-token ratio (TTR)?

The ratio of unique words to total words. TTR drops as text gets longer, so it's sensitive to length.

What is MATTR?

Moving Average Type-Token Ratio. It computes TTR over a sliding window (we use 50 words) so the score is comparable across documents of different lengths.

Why does TTR drop as a text gets longer?

Common words like 'the' and 'and' repeat constantly, so the ratio of unique words to total words falls steadily as the text grows. This length sensitivity is the main reason MATTR is preferred for comparing texts of different sizes.

What is a good lexical diversity score?

There is no universal threshold because TTR depends heavily on text length, but within similar-length samples a higher ratio signals richer vocabulary. For fair comparisons use MATTR, which holds the window size constant.

Worked example

Input

The dog ran. The dog jumped. The dog barked. The dog slept.

Output

TTR: 0.45 (5 unique / 11 total) — Low diversity.

"The" and "dog" repeat heavily; only "ran", "jumped", "barked", and "slept" add new types. Low TTR is typical of beginner writing or restricted-vocabulary text.

Common pitfalls

  • Raw TTR is highly length-dependent; never compare a 100-word and a 1000-word text by raw TTR.
  • Case-sensitivity matters: "Dog" and "dog" may or may not be treated as the same type.
  • Lemmatisation matters: "run" and "running" are different types unless you stem first.
  • Random noise in short samples can dominate diversity scores.

Related tools

Send feedback

We read every message. Tell us what could be better or what you love.