1001Ferramentas
🎨Text

Vocabulary Diversity (TTR)

Measure the vocabulary diversity of a text with the Type-Token Ratio (unique words divided by total). Useful for style analysis, writing and linguistics.

TTR

Measuring how much a text repeats itself

You read an essay and feel the same words coming back, but feeling is not measuring. The Type-Token Ratio puts a number on it: how many distinct words there are for every word written. It helps when comparing two of your own drafts, when glancing at text that reads like machine output, and when showing a student the repetition instead of describing it.

Types are the distinct words, tokens are every occurrence. The text is lowercased and the result is one divided by the other, with no lemmatisation: casa and casas count as two different words, and proper nouns and numbers are included. The labels break at 0.7 for very high, 0.5 for high and 0.3 for medium. The sample in the box gives 9 types in 12 tokens, which is 0.750.

Here is the detail that ruins comparisons: TTR falls as a text grows, because function words keep repeating. Comparing a 200-word essay with a 2000-word article tells you nothing. Trim both to the same length first. Words that start or end with an accented letter are counted truncated (café becomes caf, água becomes gua), which leaves the token total alone. It runs in your browser.

Frequently asked questions

What is a good TTR?
There is no good value out of context, because the number depends on text length. Only compare samples of the same length and genre.
Does it ignore words like the and of?
No. Every word counts, function words included. For content-word diversity, strip the stopwords before pasting the text.
Can it detect AI writing?
Only as a weak hint alongside other signals. Low TTR shows up in machine output and in repetitive human writing alike.

Related Tools