Unique words count calculator
In “The quick brown fox jumps over the lazy dog. The fox is quick!” 9 of the 13 words are distinct and 4 are repeats. You get total, unique and repeated words plus the type-token ratio, so you can tell variety from padding. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Writers, teachers, and language learners often ask a sharper question than raw word count: how much of this passage is new vocabulary versus recycled phrasing. A paragraph can look long while repeating the same handful of terms, or stay short while packing many distinct words. This unique words count calculator tokenizes your text with Unicode-aware rules, counts every word occurrence, counts how many of those tokens are distinct under an optional case-insensitive policy, and reports the gap as repeated occurrences plus clear ratios. You see total words, unique words, repeated words, the classic unique ratio (type-token ratio), the complementary repeated ratio, and when repeats exist the ratio of unique words to repeated occurrences.
What unique versus total word counts measure
Total word count answers how long a passage is in tokens. Unique word count answers how large its vocabulary is after duplicates are collapsed. A ratio near one means almost every token introduces a new type; a ratio near zero means heavy reuse of a small lexicon.
The complementary repeated ratio is one minus that fraction and shows what share of the stream is recycling. None of these metrics judge quality by themselves: technical writing may legitimately repeat defined terms, and poetry may thriftily reuse a refrain. They do give a reproducible numeric baseline so classrooms, editorial checklists, and automated dashboards can compare drafts without arguing about how words were counted by hand.
Where a unique words count calculator earns its keep
Language arts classrooms use a unique words count calculator so students can compare first drafts with revised ones and see whether feedback about variety shows up as a higher unique ratio rather than only a longer essay. English as a second language programs set simple targets such as at least a given unique ratio for a free-writing sample before advancing to the next unit.
Content teams and SEO editors check product pages and blog posts that risk keyword stuffing: a collapsing unique ratio with a rising total can signal hollow repetition even when spellcheck is clean. Keep requests to the passage you care about, pin the rounded ratios in tests, and you get reproducible vocabulary diversity numbers for homework, editorial gates, and edge workers without standing up a linguistics pipeline of your own.
What you can do with it
Essay vocabulary self-checks
Students paste a draft to see total words, distinct words, and unique ratio before submitting a writing assignment.
FAQ
What is the type-token ratio?
It is the number of unique words divided by the total number of words. A ratio near one means almost every word is new; a ratio near zero means a small vocabulary used again and again. In the fox sentence it is 9/13.
Are “Hello” and “hello” counted as the same word?
Yes. By default capital and lower-case forms count as one word, so both spellings add a single entry to the vocabulary. Switch that option off and they are counted as two different words.
How are contractions and hyphenated words counted?
Each one counts as a single word, because an apostrophe or hyphen inside a word keeps it together. Letters and digits form words, while punctuation and spaces on their own are ignored.
Does a low unique ratio mean my writing is poor?
Not on its own. Technical writing may repeat defined terms on purpose and a poem may return to a refrain. The numbers are most useful for comparing two drafts counted the same way, or for spotting a page stuffed with one keyword.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/edu/unique-words-count \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"The quick brown fox jumps over the lazy dog. The fox is quick!"}'const res = await fetch("https://api.kit.forhosting.com/edu/unique-words-count", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "The quick brown fox jumps over the lazy dog. The fox is quick!"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/edu/unique-words-count",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "The quick brown fox jumps over the lazy dog. The fox is quick!"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/edu/unique-words-count", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"The quick brown fox jumps over the lazy dog. The fox is quick!"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"The quick brown fox jumps over the lazy dog. The fox is quick!"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/edu/unique-words-count", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "The quick brown fox jumps over the lazy dog. The fox is quick!"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "edu.unique_words_count",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Students use it to gauge lexical variety in essays; editors use it to flag thin vocabulary before publication; tutors and LMS tools call the same deterministic contract so a free browser check matches the paid API path byte for byte.
What unique versus total word counts measure
The difference between those two numbers is the number of repeated occurrences: every time a word appears again after its first sighting, that extra token adds to repeated_words while unique_words stays flat. Dividing unique_words by total_words yields the unique ratio, also known in corpus linguistics as a type-token ratio for the sample you provided. When at least one repeat exists, unique_to_repeated_ratio compares the size of the vocabulary to the volume of extra occurrences, which is useful when you want a single number that grows when you add new words and shrinks when you pad with the same ones again.
Input contract, tokenization, and response shape
Tokenization keeps Unicode letters and digits, including optional internal apostrophes or hyphens so contractions and hyphenated compounds stay one token, and ignores pure punctuation and whitespace. Example: the sentence The quick brown fox jumps over the lazy dog. The fox is quick! yields thirteen tokens and nine unique types under case-insensitive mode, so four occurrences are repeats and the unique ratio is nine thirteenths. POST a JSON body with required field text: a non-empty string. Aliases input, value, s, content, and body are accepted so form builders and SDKs can keep familiar labels. Optional case_insensitive defaults to true so Hello and hello count as one vocabulary item; set it false when case distinctions must remain separate. Aliases ignore_case, ci, and casefold map to the same flag and accept booleans or common string forms such as true, false, 1, and 0. Empty strings, missing text, non-string text, and strings that contain no letter or digit tokens fail with invalid_input and are not billed. On success the body includes total_words, unique_words, repeated_words, unique_ratio and repeated_ratio rounded to six decimals for stable goldens, case_insensitive as resolved, the original string echoed for audit, a method label unique_words_count, and a short formula string. When repeated_words is greater than zero the payload also includes unique_to_repeated_ratio; when every token is unique that field is omitted rather than returned as null. Pair these counts with your own readability or grade-level tools if you need richer prose analytics; this endpoint focuses on distinct versus total word arithmetic only.
Where a unique words count calculator earns its keep
Every successful call costs the published $0.002 base price; validation failures do not consume balance.
Integration use cases
Editorial repetition review
Editors compare unique_to_repeated_ratio across revisions to catch thin phrasing that only grows by recycling the same terms.
LMS and tutoring batch scoring
Platforms call the API on many short responses to report lexical variety with the same numbers the free widget shows learners.
Technical questions
How does the unique words count calculator work?
It tokenizes your non-empty text into Unicode word tokens, counts total tokens and distinct types (case-insensitive by default), then returns repeated_words as total minus unique plus unique_ratio, repeated_ratio, and when applicable unique_to_repeated_ratio.
What is unique_ratio?
unique_ratio is unique_words divided by total_words, rounded to six decimals. It is a sample type-token ratio: closer to 1 means more variety; closer to 0 means more repetition.
Are Hello and hello counted as one word?
Yes by default (case_insensitive true). Set case_insensitive to false if you need case-sensitive distinct counts.
What happens with empty text or only punctuation?
Empty strings and text with no letter or digit tokens fail with invalid_input and are not billed. Provide at least one word token.
What does the unique words count calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.