The Formula
Keyword Density (%) = (Number of keyword occurrences ÷ Total word count) × 100
Basic Keyword Density Formula
The standard keyword density formula calculates the percentage of times a single keyword appears in your content relative to the total word count:
Formula
(Keyword Count ÷ Total Words) × 100
Example
15 occurrences in 1,000 words = 1.5% density
This formula works for single words. For multi-word phrases, the calculation is slightly different.
Multi-Word Phrase Density
When calculating density for a phrase like “keyword density checker” (a 3-word phrase), you need to account for the number of possible phrase positions in your text:
Phrase Density (%) = (Phrase occurrences ÷ Total word count) × N × 100
Where N is the number of words in the phrase. However, in practice, most SEO tools use the simpler formula (occurrences ÷ total words × 100) even for phrases, and that’s the number you should optimise against.
Beyond Basic Density: TF-IDF
TF-IDF (Term Frequency – Inverse Document Frequency) is a more sophisticated way to measure keyword importance. Instead of just counting how often a word appears in your content, it compares that frequency against how commonly the word appears across all documents on the web.
- TF (Term Frequency) = How often the word appears in your document
- IDF (Inverse Document Frequency) = How rare the word is across all documents
- TF-IDF = TF × IDF — high score means the word is frequent in your document AND relatively rare elsewhere
A high TF-IDF score suggests the word is genuinely important to your content, not just a common word like “the” or “is” that appears frequently everywhere. Modern SEO tools often use TF-IDF analysis alongside basic keyword density for more meaningful insights.
Quick Density Calculator
Use this reference table to quickly find your target keyword count based on content length and desired density:
| Content Length | 0.5% Density | 1.0% Density | 1.5% Density | 2.0% Density |
| 500 words | 2–3 times | 5 times | 7–8 times | 10 times |
| 1,000 words | 5 times | 10 times | 15 times | 20 times |
| 1,500 words | 7–8 times | 15 times | 22–23 times | 30 times |
| 2,000 words | 10 times | 20 times | 30 times | 40 times |
| 3,000 words | 15 times | 30 times | 45 times | 60 times |
For a more precise analysis, use our Keyword Density Checker to paste your content and see exact density figures for every word and phrase.
Frequently Asked Questions
What is the keyword density formula?
The keyword density formula is: (Number of keyword occurrences ÷ Total word count) × 100. This gives you a percentage representing how frequently your keyword appears relative to the total content.
How do I calculate keyword density for a phrase?
For multi-word phrases, most SEO tools use the same formula: (phrase occurrences ÷ total word count) × 100. For example, if ‘content marketing’ appears 8 times in a 1,000-word article, the density is 0.8%.
What is TF-IDF and how does it differ from keyword density?
TF-IDF (Term Frequency – Inverse Document Frequency) measures how important a word is to a document compared to all documents. Unlike simple keyword density, TF-IDF accounts for how common a word is across the web, giving more weight to unique, topic-specific terms.
Should I use keyword density or TF-IDF for SEO?
Use basic keyword density as a quick sanity check (0.5–2.5% range), and TF-IDF analysis for deeper content optimisation. Many professional SEO tools combine both approaches for comprehensive analysis.