Work out lexical diversity instantly with clear inputs, formula shown and shareable results.
Type-token ratio is unique words over total words: 310 types in 1000 tokens gives 0.31. Its weakness is length dependence - longer texts inevitably repeat words, so TTR falls even when vocabulary is rich. Root TTR and log TTR correct for that, which is why they are preferred when comparing texts of different lengths.
Type-token ratio
TTR = unique types / total tokens
Length-corrected forms
root TTR = types / sqrt(tokens); log TTR = log(types) / log(tokens)
Because function words repeat constantly. Once the common vocabulary is used, each additional token is more likely to be a repeat.
For comparing different lengths, use a corrected measure such as MTLD or root TTR. Plain TTR is only valid at a fixed sample size.