This type token ratio calculator measures vocabulary variety in a text. Enter the number of unique words (types) and the total number of words (tokens), and it returns the type-token ratio, or TTR, as a decimal and as a percentage.
Type Token Ratio Calculator
Type-token ratio (TTR) for a text — a measure of vocabulary variety — from unique word count and total word count.
Starting values: the calculator opens with 220 unique words out of 800 total words. The type-token ratio is 0.275, or 27.5%.
The type-token ratio formula
TTR = Types ÷ Tokens
Where:
- Types = the number of different words in the text, counting each word once
- Tokens = the total number of words, counting every occurrence
The result runs from near 0 to 1. A TTR of 1 means no word is ever repeated. A low TTR means the text leans heavily on a small set of words. The calculator also shows the value as a percentage by multiplying by 100.
Types and tokens: how to count
The calculator does not read your text. It needs the two counts from you, so decide how to count before you start.
- Tokens: count every word, including repeats. The sentence the cat saw the dog has 5 tokens.
- Types: count each distinct word once. The same sentence has 4 types, because the appears twice.
- Case: most analyses treat The and the as one type, so lower-case the text first.
- Word forms: decide whether walk, walks and walked count as one type or three. Counting the forms separately gives a higher TTR than counting by base word. Whichever you choose, use the same rule for every text you compare.
A word processor’s word count gives you tokens. For types, paste the text into a spreadsheet or a short script and count the unique entries.
Worked examples
Example 1: the default
220 types and 800 tokens: TTR = 220 ÷ 800 = 0.275, which is 27.5%.
Example 2: a short sentence
The cat saw the dog has 4 types and 5 tokens, so TTR = 4 ÷ 5 = 0.8. Short samples score high because there is little room for repetition.
Example 3: two texts of different length
Text A has 300 types in 500 tokens, TTR = 0.6. Text B has 900 types in 5,000 tokens, TTR = 0.18. Text B looks far less varied, but it is also ten times longer. That is not a fair comparison, as explained below.
Example 4: a repetitive text
A 1,000-word text with only 100 distinct words has TTR = 0.1. That would suggest very repetitive writing, such as a simple children’s text or a list built from a small vocabulary.
Why TTR depends on text length
The longer a text gets, the more often common words such as the and and come back, while new words appear more slowly. So TTR falls as length rises, even if the writer’s vocabulary is unchanged. Comparing a 500-word essay with a 5,000-word chapter by raw TTR will mislead.
Two simple fixes are to compare equal-length samples, for example the first 500 words of each text, or to use a length-adjusted measure. Two adjusted measures that you can calculate by hand are:
- Root TTR (Guiraud’s index) = Types ÷ √Tokens. For the default, 220 ÷ √800 = 220 ÷ 28.28 = 7.78.
- Corrected TTR = Types ÷ √(2 × Tokens). For the default, 220 ÷ √1,600 = 220 ÷ 40 = 5.5.
These two use the same type and token counts you already have, and you can compute them with the scientific calculator. The moving-average type-token ratio is another option, but it needs software to run.
What counts as a good TTR?
There is no single threshold. A good value depends on the text type, the language, the counting rules and above all the length. Use TTR to compare texts of similar length counted the same way, such as two drafts of one essay, not to judge a text against a fixed number.
Checks before you rely on the result
- Types cannot be larger than tokens. The calculator does not check this, so a TTR above 1 means one of the counts is wrong.
- Tokens must be above zero.
- Count both numbers the same way every time, with the same handling of case, punctuation and word forms.
Using TTR in practice
TTR is used in linguistics, language assessment and text analysis as a quick indicator of vocabulary diversity. In practice, it is most useful for before-and-after comparisons of similar material.
Example 5: comparing two drafts
Take the first 500 words of two drafts of the same essay. Draft one has 210 types, so TTR = 210 ÷ 500 = 0.42. Draft two has 240 types, so TTR = 240 ÷ 500 = 0.48. Because both samples are 500 tokens and counted the same way, the 0.06 gap says that the second draft repeats itself less. It does not say that the second draft is better written, only that it uses a wider range of words.
Example 6: the effect of one repeated word
A 100-word passage with 70 types has TTR = 0.7. If the writer rewrites it so that 5 repeated words become 5 new ones, types rise to 75 and TTR becomes 0.75. Small edits move the ratio visibly in short passages, and barely at all in long ones.
Frequently asked questions
What is type-token ratio?
It is the number of unique words divided by the total number of words in a text. It is a simple measure of vocabulary variety.
How do I get the number of unique words?
Lower-case the text, split it into words and count the distinct entries, using a spreadsheet or a short script. A normal word count only gives you tokens.
Why does TTR drop for longer texts?
Common words repeat more as a text grows, while new words arrive more slowly, so the ratio falls even when vocabulary stays the same.
Can I compare TTR across texts?
Only if they are about the same length and counted the same way. Otherwise compare equal-sized samples or use a length-adjusted measure such as root TTR.
What is a good type-token ratio?
There is no fixed answer. It depends on length, genre and counting rules, so compare like with like.
