Unique Word Counter
Count unique words and calculate vocabulary richness (type-token ratio) in any text. Analyze word frequency, hapax legomena, and writing complexity.
Unique Word Counter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: TTR = Unique Words (Types) / Total Words (Tokens)
Worked example โ 10 unique words out of 15 total, TTR = 0.667 (High richness)
Formula
TTR = Unique Words (Types) / Total Words (Tokens)
The Type-Token Ratio divides the count of distinct words by the total word count. A ratio closer to 1.0 indicates higher vocabulary diversity. Hapax legomena count measures words appearing exactly once.
Worked Examples
Example 1: Analyzing a Short Paragraph
Problem:Analyze: 'The quick brown fox jumps over the lazy dog. The dog barked at the fox.'
Solution:Total words: 15 Unique words: 10 (the, quick, brown, fox, jumps, over, lazy, dog, barked, at) Repeated: 'the' (3x), 'fox' (2x), 'dog' (2x) Type-Token Ratio = 10/15 = 0.667 Hapax Legomena = 7 (quick, brown, jumps, over, lazy, barked, at) Vocabulary richness: High
Result:10 unique words out of 15 total, TTR = 0.667 (High richness)
Example 2: Comparing Two Writing Samples
Problem:Sample A: 'I like cats. I like dogs. I like birds.' vs Sample B: 'Felines prowl gracefully while canines frolic and songbirds chirp melodiously.'
Solution:Sample A: 7 total, 5 unique (I, like, cats, dogs, birds), TTR = 0.714 Sample B: 8 total, 8 unique, TTR = 1.000 Despite Sample A having high TTR, Sample B demonstrates superior vocabulary diversity with zero repetition and more sophisticated word choices.
Result:Sample B has perfect TTR of 1.0 vs Sample A at 0.714
Frequently Asked Questions
What is a unique word count and why does it matter?
A unique word count measures the number of distinct words in a text, regardless of how many times each word appears. For example, the sentence 'the cat sat on the mat' has 6 total words but only 5 unique words because 'the' appears twice. This metric is essential for writers, linguists, and content creators because it reveals vocabulary diversity and writing complexity. A higher unique word count relative to total words indicates richer vocabulary usage. Academic papers typically have higher vocabulary richness than casual blog posts. Content marketers use this metric to ensure their copy is varied and engaging rather than repetitive and monotonous.
What is the type-token ratio and how is it interpreted?
The type-token ratio (TTR) is a fundamental measure in computational linguistics calculated by dividing the number of unique words (types) by the total number of words (tokens). A TTR of 1.0 means every word is unique, while a lower ratio indicates more repetition. For typical English prose, a TTR between 0.4 and 0.6 is normal. Academic writing tends to score 0.5 to 0.7, while conversational speech may score 0.3 to 0.5. However, TTR is sensitive to text length because longer texts naturally have more repetition, which lowers the ratio. For comparing texts of different lengths, standardized TTR or moving-average TTR are more reliable alternatives.
What is a hapax legomenon and why is it significant?
A hapax legomenon (plural: hapax legomena) is a word that occurs only once within a given text or corpus. The term comes from Greek meaning 'something said only once.' In any natural language text, a large proportion of unique words will be hapax legomena, typically 40-60% of all unique words. This phenomenon follows Zipf's law, which states that word frequency is inversely proportional to its rank. Hapax legomena are significant in authorship attribution, language modeling, and vocabulary analysis. A high hapax ratio suggests the author uses many specialized or uncommon words, while a low ratio indicates reliance on a smaller, more frequently repeated vocabulary.
How does vocabulary richness differ across writing styles?
Vocabulary richness varies dramatically across different writing genres and purposes. Legal documents and scientific papers typically exhibit high vocabulary richness with TTR values of 0.55 to 0.70 due to specialized terminology and precise language requirements. Literary fiction ranges from 0.45 to 0.65, with authors like Shakespeare and James Joyce pushing the higher end. News articles tend toward 0.40 to 0.55 because journalistic style emphasizes clarity and repetition for readability. Social media posts and casual writing usually fall between 0.30 and 0.45. Children's literature deliberately uses lower vocabulary richness to match reading levels, typically scoring 0.25 to 0.40 depending on target age.
How can I improve the vocabulary richness of my writing?
Improving vocabulary richness requires deliberate practice and awareness of word choice patterns. Start by analyzing your current writing with a tool like this unique word counter to establish your baseline TTR. Read widely across genres to expose yourself to new words and phrases naturally. When editing, identify overused words and replace them with precise synonyms, but avoid using obscure words that sacrifice clarity for novelty. Use a thesaurus strategically to find alternatives for commonly repeated words like 'very,' 'good,' 'said,' and 'important.' Practice writing in different styles and genres to expand your active vocabulary. Remember that vocabulary richness should serve communication, not obscure meaning through unnecessarily complex language.
What is the difference between a token, a type and a lemma?
A token is every word occurrence in the running text, a type is each distinct word form, and a lemma is the dictionary headword that groups inflected forms together. In run, runs and running there are three tokens and three types but only one lemma. The type-token ratio here works on surface forms, so a text that inflects heavily shows more types than a lemma-based count would, which matters when comparing English against a more inflected language.
How should stop words be handled in a vocabulary analysis?
Function words such as the, of, and and to make up a large share of every token count while carrying little topical information. Leaving them in dominates the top of any frequency list and drags the type-token ratio down, since they repeat constantly. Removing them with a stop-word list exposes the content vocabulary and makes frequency lists useful for editing. Keep them in for stylometry or authorship work, where function-word habits are the strongest signal.
How does Zipf's law show up in a word frequency list?
Zipf's law describes an inverse relationship between a word's frequency and its rank: the most common word appears roughly twice as often as the second, three times as often as the third, and so on down a long tail. The practical consequence is that a handful of types account for most tokens while most types appear only once or twice, which is why hapax legomena stay numerous however long the text becomes.
Does case folding, punctuation or stemming change the unique word count?
Substantially. Without case folding, The and the are two types. Without punctuation stripping, word and word. differ. Without stemming or lemmatisation, walk, walked and walking are three types. Each normalisation step lowers the type count and therefore the type-token ratio, so two tools can report different unique counts for identical text. Compare figures only when you know the same preprocessing was applied to both.
How does unique word count relate to keyword density in SEO writing?
Keyword density measures how often one term repeats as a share of total tokens, while vocabulary richness measures how varied the whole text is. Pushing a single keyword's frequency up lowers the type-token ratio and produces the repetitive tone readers notice immediately. A stronger approach is to widen the type inventory with related terms, synonyms and question phrasings, which keeps the topic explicit for search engines while keeping the prose readable.
References
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐ขWord Counter
Count words, characters, sentences
๐คText Case Converter
Convert text between cases
๐Text Difference Checker
Compare two texts and find differences
๐งฎSyllable Counter
Count the number of syllables in a word or passage of text.
๐งฎWord Count Calculator
Calculate word count with inputs, formulas, and instant results.
๐งฎCharacter Counter
Count characters, words, sentences, and paragraphs in any text with and without spaces.
๐งฎSentence Counter
Count sentences and calculate average sentence length in any text.
๐งฎParagraph Counter
Count paragraphs and calculate average paragraph length in words.