Products SEO & GEO Agent Paid Ads Agent Website Agent Conversion Agent
How it works Pricing FAQ Blog Book a call

Keyword density formula: how it's calculated and why it misleads

Updated · 6 min read

Short answer Keyword density is the times a keyword appears, divided by the page's total words, times 100: 8 uses on 1,000 words is 0.8%. But tools count phrases, word forms and page text differently, so scores disagree. Google publishes no density formula or target; it reads headings, passages and meaning. Treat the number as a repetition check only.

Want help applying this to your business? Talk it through on a free 30-minute call.

Book a call

What is the keyword density formula?

Keyword density = (times the keyword appears ÷ total words on the page) × 100.

PageKeyword usesTotal wordsDensity
Short service page55001%
Longer service page81,0000.8%
Blog post151,5001%

That's the whole calculation. It's simple, which is why so many tools show it. The trouble is that each tool fills in the two numbers differently, and none of them is measuring what Google measures.

Why do two checkers give different numbers for the same page?

Because the formula leaves three choices open, and each tool makes its own.

ChoiceOption AOption BSame page, 1,000 words, "water heater repair" used 8 times
Count the phrase or its words?Phrase as one itemEach of its 3 words0.8% vs 2.4%
Which words are "total"?Main text onlyMenus, footer and sidebar too (say 300 more words)0.8% vs 0.62%
Do word forms count?Exact phrase only"Repairs", "repairing" count tooRises with every variant matched

Yoast, the WordPress plugin, says it compares how often your focus keyphrase occurs with the page's total text, then uses keyphrase length as "a weighting factor", so a longer phrase needs fewer uses to pass. Its Premium version recognizes word forms in some languages; the free one doesn't. Synonyms count in neither: "Synonyms do not count towards your keyphrase density score." (Yoast: What is keyphrase density)

Rank Math says its test checks how often your focus keywords "and their combinations" are used, and it counts secondary keywords too. It doesn't publish the exact formula. (Rank Math: How to score 100/100)

So a page can be green in one plugin and flagged in another without a word changing.

What density do SEO tools recommend?

Each tool sets its own range, and they don't agree.

ToolFull marksWarning
Yoast (free)0.5% to 3%Above or below that range
Yoast PremiumUpper limit 3.5% (word forms counted in some languages)Above 3.5%
Rank Math1% to 1.5%Above 2.5%

Sources: Yoast: What is keyphrase density; Rank Math: How to score 100/100.

These are product rules. Google's guidance names no percentage, and the "1–2%" often repeated online has no Google source behind it. For what Google says about repeating keywords, see keyword density: does it still matter?

Why isn't the formula how Google ranks pages?

Density averages one phrase across a whole page. Google looks at where words sit, what they mean, and what else the page offers.

Where the words are. Google's explanation of ranking:

"For example, if those keywords appear in the headings or body text of a webpage, the information might be more relevant." (Google Search: How Search works, ranking results)

Google names headings and body text, not menus or footers. The formula scores a use in the main heading the same as one in the footer.

Sections, not averages. Google's ranking systems guide describes passage ranking, a system that identifies "individual sections or "passages" of a web page to better understand how relevant a page is to a search." A strong section on pricing can match a price search even if the page's overall density is low.

Meaning, not exact strings. The same guide says RankBrain lets Google "return relevant content even if it doesn't contain all the exact words used in a search". The formula only counts exact matches (or word forms), so it misses that "hot water tank fix" serves the same searcher.

Variety helps; density tools punish it. Google's SEO Starter Guide:

"If you are varying the words (writing naturally to not be repetitive), you have more chances to show up in Search simply because you are using more keywords." (Google Search Central: SEO Starter Guide)

Swap a repeated phrase for a natural variant and your density score drops, while your page matches more searches.

More than words. Google also says it checks whether a page has relevant content beyond the keyword, such as pictures, videos or lists, and uses anonymized interaction data to judge relevance. None of that is in the formula.

Is there a density that counts as keyword stuffing?

No number. Google defines keyword stuffing by intent and effect, not a ratio:

"Keyword stuffing refers to the practice of filling a web page with keywords or numbers in an attempt to manipulate rankings in Google Search results." (Google Search Central: Spam policies)

One of its examples is repeating words or phrases "so often that it sounds unnatural". A 2% page can read fine; a 1% page with a 40-town list in the footer can break the rule. If Search Console shows a manual action, see Google manual action.

How should you use a density number, then?

As a smoke alarm for habits, not a target.

  1. Check placement first: is the phrase in the page title, main heading and first paragraph? That matters more than the count.
  2. Press Ctrl+F (Cmd+F on a Mac) and search the phrase. If it shows up in back-to-back sentences, rewrite those.
  3. If a plugin says "too low" but the phrase is already in those three places, ignore it. Add useful facts instead: price, area, what's included.
  4. If it says "too high", read the page aloud and replace forced uses with "it", "we" or a natural variant.

Example

Illustrative cases with invented numbers.

A roofer's repair page (US dollars)

"Roof repair" appears 4 times in 800 words: 0.5%. Rank Math withholds full marks; it wants 1% to 1.5%. The phrase is in the title, heading and opening line. Instead of adding 4 more uses, the owner adds "repairs from $350", a photo of a patched valley, and a short list of what the visit covers.

A Vancouver cleaning company (Canadian dollars)

Yoast free shows 3.4% for "office cleaning" and flags it. Half the uses sit in a list of near-identical subheadings: "Office cleaning Vancouver", "Office cleaning Burnaby", "Office cleaning Richmond". Replacing the list with one sentence on where the crew works brings the score into range and removes the part that looked like stuffing.

Same page, two scores

A bookkeeper's page scores 1.2% in one online checker and 3.6% in another. The second counts each word of "small business bookkeeping" separately. Nothing is wrong with the page.

FAQ

How many times should a keyword appear in 500 words?

Google sets no number. Five uses in 500 words is 1%; keep each use that reads naturally, whatever the plugin says.

How do I calculate keyword density by hand?

Count the phrase with Ctrl+F, divide by your editor's word count, and multiply by 100. Decide first whether a phrase counts once or per word.

Do synonyms count toward keyword density?

Not in Yoast, which says so outright. Google says varying your words gives you more chances to show up in Search.

Did keyword density ever matter to Google?

Google never published a density target. Its Panda system (2011, core ranking since 2015) aimed to surface high-quality, original content, not hit a ratio.

Different for you?

Keep learning

NextKeyword stuffing: what it is and why Google penalizes itKeyword stuffing breaks Google's spam policies. Google's definition, examples from a service business site, how the penalty works and how to fix it.

Do it yourself

On-page SEO checklist: every item to check before publishingA pre-publish on-page SEO checklist for one new page: content, title, headings, URL, images, links, indexing, mobile and speed, plus what to do after launch.

Ask us one question

One line is enough. We reply by email.

Sources

  1. Yoast: What is keyphrase density and why is it important?
  2. Rank Math: How to score 100/100 in Rank Math SEO tests
  3. Google Search: How Search works, ranking results
  4. Google Search Central: A guide to Google Search ranking systems
  5. Google Search Central: SEO Starter Guide
  6. Google Search Central: Spam policies for Google web search