Lexical Density Calculator
Lexical density describes how much of a passage is carried by content words rather than grammatical glue.
Run — free
This calculator tokenizes an English passage, separates common function words from likely nouns, verbs, adjectives, and adverbs, and divides the content-word count by the total word count. The result helps compare how compactly different passages communicate ideas, while the accompanying counts make the estimate transparent and easy to check.
What lexical density reveals
Lexical density is a compact indicator of how information-rich a passage reads. Content words usually carry the subject matter: they name people, objects, actions, qualities, and circumstances. Function words, including articles, pronouns, conjunctions, auxiliary verbs, and prepositions, mainly connect those ideas into grammatical sentences. A passage with a larger content-word share often feels compressed, technical, or formal, while one with a smaller share may feel conversational, explanatory, or easier to process in real time. Neither direction is automatically better. A research abstract and a classroom dialogue serve different purposes and should not be judged against one ideal score. Use the calculator to compare drafts aimed at the same audience, sections within the same document, or versions before and after editing. The returned total, content, and function-word counts show exactly how the proportion was formed, so the percentage is not an unexplained grade. Treat it as evidence about style and information packing, then read the passage itself before deciding whether revision is useful. Context, sentence structure, terminology, and reader knowledge still matter greatly.
How this calculator estimates content words
The calculator performs a deterministic English-language estimate rather than full grammatical parsing. It normalizes Unicode text, recognizes alphabetic word tokens with internal apostrophes, converts them to lowercase, and checks each token against a fixed list of common English function words. Tokens on that list are counted as function words; the remaining tokens are counted as likely content words. Lexical density is then calculated as content words divided by total words, with both a zero-to-one proportion and a percentage returned. This transparent method is fast, repeatable, and suitable for comparing ordinary prose, but it has known limits. Some English words change grammatical role according to context. For example, a word may act as an auxiliary in one sentence and a main verb in another. Names, specialist terms, unusual contractions, and spelling errors are generally treated as content words because they are not in the function-word list. Numbers and standalone punctuation are not counted as words. For reliable comparisons, analyze texts in the same language, apply the same preparation rules, and avoid comparing a short heading with a long essay.
Interpreting and using the result
Start with a practical question rather than a target percentage. If a paragraph feels heavy, compare it with a clearer paragraph written for the same readers. A noticeably higher density may point to stacked terminology, compressed explanations, or too few connecting phrases. If a summary feels vague, compare it with the source or a stronger revision; a lower density may reveal excessive framing and too little subject matter. Look at the counts as well as the percentage, especially for short samples, because changing one word can move a tiny passage dramatically. Keep quoted material, headings, captions, and references consistent across versions so they do not distort the comparison. Lexical density does not measure factual accuracy, coherence, readability, sentence complexity, or vocabulary diversity. In particular, repeating the same content word can raise or maintain density without adding new information. Pair this result with human review and, when appropriate, measures such as sentence length or type-token ratio. The API price is $0.002 per request, while the browser calculation can support quick drafting checks without sending the passage elsewhere.
What you can do with it
Compare academic draft sections
Find unusually compressed paragraphs by comparing content-word proportions across sections written for the same audience.
Review instructional material
Check whether an explanation became more information-dense after editing, then confirm that learners can still follow it.
Track revisions objectively
Record the counts and percentage for two versions of a passage to supplement a human style review.
FAQ
What is the lexical density formula?
It is the number of content words divided by the total number of words. The calculator also multiplies that proportion by 100 to report a percentage.
What counts as a content word?
Likely nouns, main verbs, adjectives, and adverbs count as content words. This calculator estimates them by excluding a fixed list of common English function words.
Is a higher lexical density always better?
No. Higher density can suit concise technical writing but may burden readers. Lower density can support conversation and explanation. Purpose and audience determine what works.
Does this perform full part-of-speech tagging?
No. It uses a transparent function-word-list heuristic, so context-dependent word roles may occasionally be classified imperfectly.
Are numbers included in the word count?
No. The tokenizer counts alphabetic word tokens, including words with internal apostrophes, but excludes standalone numbers and punctuation.
How much does the API calculation cost?
Each API request costs $0.002. The calculation is deterministic and does not use an external service or language model.
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/lexical-density \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"The curious students carefully examined the ancient map in the quiet library."}'const res = await fetch("https://api.kit.forhosting.com/edu/lexical-density", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "The curious students carefully examined the ancient map in the quiet library."
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/edu/lexical-density",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "The curious students carefully examined the ancient map in the quiet library."
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/edu/lexical-density", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"The curious students carefully examined the ancient map in the quiet library."}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"The curious students carefully examined the ancient map in the quiet library."}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/edu/lexical-density", 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 curious students carefully examined the ancient map in the quiet library."
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "edu.lexical_density",
"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.
Limits
max_chars | 100000 |
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. |