📝 Input mode
HTML mode strips <script>, <style>, all tags, and
decodes the common entities before analyzing.
✏️ Content
Analysis runs automatically as you type (debounced 250 ms). Up to 5 MB.
🛑 Stopwords
English mode filters ~120 articles, pronouns, conjunctions, and auxiliaries before counting.
⚙️ Filters
📊 Document statistics
⚠️ Optimization warnings
- • {{ w.message }}
| # | Phrase | Count | Density | Frequency |
|---|---|---|---|---|
| {{ idx + 1 }} | {{ entry.word }} | {{ entry.count }} | {{ formatDensity(entry.density) }} |
|
ℹ️ About Keyword Density Checker
What keyword density tells you
Keyword density is the percentage of times a word or phrase appears in a body of text relative to the total word count. SEO practitioners use it to confirm that an article actually focuses on its target topic, and to catch over-optimization — repeating a keyword so often that the content looks unnatural to both human readers and search-engine quality signals.
This tool counts unigrams (single words), bigrams (two-word phrases), and trigrams (three-word phrases) in pasted text or HTML, then ranks them by frequency and density. It also reports document-level statistics (word count, sentence count, lexical diversity) and surfaces warnings when a single term crosses common over-optimization thresholds (~3–5% density for a single keyword in a long-form article).
How analysis works
- Tokenization — text is split on Unicode word boundaries (the matcher accepts
letters, digits, and embedded apostrophes), so contractions like
don'tstay one token. Comparison is case-insensitive. - HTML mode — when enabled,
<script>and<style>blocks (with their contents) are dropped, all remaining tags are stripped, and common HTML entities (&,<,>,",') are decoded before tokenization. - Stopwords — when set to English, a ~120-entry stopword list (articles, pronouns, common auxiliaries, prepositions, conjunctions) is removed before the density is computed. Disable this for raw frequency counts that include filler.
- Minimum word length — tokens shorter than the threshold (default 3) are discarded after stopword removal.
- Density —
count / total filtered tokens × 100. The denominator is the same across unigram, bigram, and trigram panels so percentages are comparable. - Top N — only the most-frequent N entries (default 20) are returned for each panel, sorted by count descending, then alphabetically.
SEO density guidance
- 1–2% — natural density for a focused keyword in long-form content.
- 3–5% — borderline; the keyword starts to dominate the prose. Vary phrasing, use synonyms, and shift to semantic variants of the topic.
- > 5% — flagged by this tool as possible over-optimization. Search engines now use embeddings and entity-based topic models rather than raw counts, so stuffing a term repeatedly rarely helps and often hurts.
- Repetitive bigrams / trigrams — a phrase that appears 8+ times in a short article (under 300 words) usually reads as boilerplate. The tool surfaces these as too repetitive.
- Short text caveat — under ~100 words, density percentages are statistically unreliable. Treat the table as raw counts, not ratios.
Practical use cases
- Audit an existing article before publishing — paste the body text and look for any single keyword above 3% density.
- Compare a draft against a competitor — paste each, sort by frequency, and check whether the same topic-defining terms appear at roughly similar densities.
- Extract topic phrases — the bigram and trigram panels surface the recurring multi-word phrases that define the article's actual subject (often more telling than single words).
- Detect AI-generated boilerplate — repetitive trigrams (e.g. "in this article", "it is important to") are a common artifact of low-effort LLM output.
- Lexical diversity — a unique-to-total ratio under ~0.4 in a long passage often signals repetitive writing or aggressive optimization.
Output fields
- Word count — total non-stopword tokens after minimum-length filter is applied? No — total tokens from raw text (sentence/paragraph stats use the same denominator).
- Unique words — distinct tokens (case-insensitive).
- Lexical diversity —
uniqueWords / wordCount. Higher = more varied vocabulary. - Average words per sentence — total words divided by sentence count. Long-form writing aims for ~15–20.
- Average characters per word — useful for spotting jargon-heavy passages.
- Density bar — each row's bar is sized relative to the most frequent entry in the current panel, not the global maximum, so visual ranking is preserved across tabs.
Related references
- Google Search Essentials — the modern replacement for the old Webmaster Guidelines; explicitly calls out keyword stuffing as a quality problem.
- Wikipedia: Keyword density — historical context and the formula used here.
- Wikipedia: n-gram — what unigrams, bigrams, and trigrams actually are in NLP / IR terms.
Limits and privacy
- Input is capped at 5 MB. Above that, the analyzer refuses to start — density on book-length text is rarely useful.
- The same TypeScript module runs in the browser and behind the API endpoint (Module-First pattern). Browser results are byte-identical to the API output.
- Analysis runs locally in the browser — text you paste never reaches a server unless you call the API endpoint explicitly.
API Usage Example:
POST /api/tools/seo/keyword-density-checker
Content-Type: application/json
{
"text": "The quick brown fox jumps over the lazy dog. The fox is quick.",
"mode": "plain",
"stopwords": "en",
"minLength": 3,
"topN": 20
}