AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I check keyword density and TF-IDF for my content — the most-used words and phrases, whether I’m keyword-stuffing, and my target keyword’s density — without uploading the text?

Open AnyTool&rsquo;s Keyword Density &amp; TF-IDF tool, paste your article or page copy, and it analyses it entirely in your browser. It computes <strong>keyword density</strong> &mdash; density = (occurrences &divide; total words) &times; 100 &mdash; for <strong>1-, 2- and 3-word phrases</strong> (n-grams) in ranked tables, plus a <strong>TF-IDF-style prominence score</strong> that boosts <strong>distinctive</strong> topic terms over filler by multiplying term frequency by an IDF proxy drawn from a built-in common-English word reference. Each single word above roughly <strong>4% density</strong> is flagged as a possible <strong>keyword-stuffing</strong> (over-optimization) risk, and you can enter one <strong>target keyword</strong> to see its exact, phrase-aware density with a natural-range verdict. A stop-word toggle keeps &ldquo;the&rdquo;, &ldquo;and&rdquo; and &ldquo;of&rdquo; from drowning out real terms, and a bar view shows your most prominent phrases at a glance. Everything is computed locally &mdash; your text is never uploaded, so it is safe for unpublished drafts and client copy. Honest caveat: keyword density is a <strong>rough, dated metric</strong>. Google ranks on <strong>meaning</strong>, not a density number, and has never published an ideal percentage &mdash; so there is <strong>no target to hit</strong>. Use the tool to catch accidental over-use (stuffing, which Google can penalise) or under-use and to see your real phrases; the TF-IDF score is an <strong>approximation</strong> (a common-word reference stands in for a real corpus), so write naturally for readers.

  • Keyword density = (occurrences &divide; total words) &times; 100, for 1-, 2- and 3-word phrases, ranked most-used-first
  • TF-IDF-style prominence score highlights distinctive terms using a built-in common-word reference (an approximation, not a corpus TF-IDF)
  • Flags single words above ~4% density as possible keyword stuffing / over-optimization
  • Optional target keyword shows its exact, phrase-aware density with a natural-range (~0.5&ndash;3%) verdict
  • 100% client-side &mdash; honest that there is no ideal density; Google ranks on meaning, so write naturally

What is

Keyword density &amp; TF-IDF

<strong>Keyword density</strong> is the percentage of a page&rsquo;s words that are a given keyword: density = (keyword occurrences &divide; total words) &times; 100. For example, a term used 8 times in a 200-word article has a density of 4%. It was an early on-page SEO metric, but modern search engines rank on <strong>meaning and relevance</strong> rather than a density figure, and Google has <strong>never published an ideal density</strong> &mdash; so it has no magic target. Its real use today is a <strong>sanity check</strong>: unusually high density (commonly cited as above ~3&ndash;4% for a single term) can indicate <strong>keyword stuffing</strong>, an over-optimization signal Google&rsquo;s spam systems can penalise, while very low density may mean a topic is barely covered. <strong>TF-IDF</strong> (term frequency &times; inverse document frequency) is a related, more informative measure: TF is how often a term appears in your document, and IDF down-weights words that are common across many documents, so distinctive topic words score higher than filler like &ldquo;the&rdquo; or &ldquo;make&rdquo;. True TF-IDF requires a <strong>corpus of documents</strong> to derive IDF; with a single pasted document a tool must approximate IDF, for example from a general English word-frequency reference. <strong>N-grams</strong> (1-, 2- and 3-word phrases) reveal the actual phrases a page leans on, which is often more useful than single-word counts.

SEO & Web

Related terms

keyword densityTF-IDFterm frequencyinverse document frequencykeyword stuffingover-optimizationn-gramstop wordson-page SEOkeyword prominence

Frequently Asked Questions

There is no official ideal. Google has never set a target density and ranks on meaning, not a percentage. Many SEOs cite a natural range of about 0.5 to 3 percent for a primary term, with above roughly 4 percent risking keyword stuffing.

Keyword density is (keyword occurrences divided by total words) times 100, and there is no officially recommended figure — Google has never published an ideal density and ranks pages on meaning and relevance rather than a keyword count. As a rule of thumb, many SEO professionals treat roughly 0.5 to 3 percent for a primary term as comfortable and natural, and Yoast, for instance, suggests around 0.5 to 3 percent; above about 3 to 4 percent a single term starts to read as repetitive and can look like keyword stuffing. But these are guidelines for spotting accidental over- or under-use, not a target to optimise toward. The better practice is to place your keyword where it naturally fits — the title, the first paragraph, a heading or two — and then write for readers. AnyTool&rsquo;s tool shows your density and flags terms above ~4% so you can catch over-use, without pretending there is a perfect number.

Keyword stuffing is cramming a page with a keyword to manipulate rankings. Google&rsquo;s spam policies treat it as spam, so it can lower your rankings, and severe cases with hidden or repeated text can get a page deindexed.

Keyword stuffing means filling a page with a keyword — or lists of words, phone numbers or place names — in an unnatural, repetitive way to try to manipulate search rankings. Google&rsquo;s web spam policies explicitly list it as a violation: its automated systems and, where needed, human reviewers can respond, so a stuffed page may rank lower or, in severe cases (especially invisible techniques like hidden text or the same phrase repeated over and over), be removed from results entirely. It also does not even work anymore — you do not need to use a keyword a set number of times to rank for it, and modern engines treat repetitive or irrelevant keywords as spam. The fix is to write useful, information-rich content that uses keywords in context. This tool flags single words above ~4% density precisely so you can catch accidental stuffing before it becomes a problem.

TF-IDF multiplies how often a term appears in your document by how rare it is across many documents, so distinctive words score higher than common ones. This tool approximates the rarity part from a built-in common-word list, so it is an approximation, not a true corpus TF-IDF.

TF-IDF stands for term frequency times inverse document frequency. Term frequency is simply how often a word appears in your page; inverse document frequency measures how rare that word is across a large set of documents, so words that appear on almost every page (like &ldquo;best&rdquo;, &ldquo;guide&rdquo; or &ldquo;and&rdquo;) get down-weighted, while distinctive topic words get boosted. Multiply the two and you get a score that highlights the special vocabulary of your content rather than filler. The catch is that a true IDF needs a corpus — many documents — to know what is rare, and a single pasted document cannot provide that. So this tool approximates IDF using a built-in reference of the most common English words: terms near the top of that list score low, and words absent from it score high. That makes the TF-IDF column here an honest approximation that surfaces distinctive terms, not a true corpus TF-IDF, which is why it is best used to compare the relative prominence of terms in your own text.

No. Your text is tokenized and counted entirely in your browser with plain JavaScript and is never uploaded, logged or stored, so it is safe for unpublished drafts and client copy. It also works offline once cached.

The Keyword Density &amp; TF-IDF tool is 100% client-side: the text you paste is split into words and phrases and counted with ordinary JavaScript on your device — nothing is fetched, uploaded, logged or stored on a server, and no CDN is called for processing. That makes it safe for analysing unpublished articles, client copy and confidential content without exposing them. It analyses as you type, offers 1-, 2- and 3-word phrase tables, a stop-word toggle, a target-keyword density check and a copyable report; it works offline once cached as a PWA, supports dark mode and a mobile layout with a sticky Sample / Copy bar. The logic is a small pure engine (keywordDensityEngine.ts) that reuses the shared textStatsEngine tokenizer with no new dependency — everything runs locally in your browser.

Detailed Explanation

How It Works

What the Keyword Density & TF-IDF Tool Computes

Keyword Density &amp; TF-IDF is a 100% client-side tool that analyses pasted content and reports its most prominent terms live as you type. <strong>Keyword density</strong> is the core metric: density = (occurrences &divide; total words) &times; 100 — a term used 8 times in a 200-word article has a density of 4%. The tool computes density for <strong>1-, 2- and 3-word phrases</strong> (n-grams) in ranked tables so you can see the actual phrases a page leans on, not just single words, with an optional stop-word filter so &ldquo;the&rdquo;, &ldquo;and&rdquo; and &ldquo;of&rdquo; do not crowd out real topic terms. Alongside density it shows a <strong>TF-IDF-style prominence score</strong>: term frequency multiplied by an inverse-document-frequency proxy, so words that are common across general English are down-weighted and <strong>distinctive</strong> topic words rank higher. Each single word above roughly <strong>4% density</strong> is flagged as a possible <strong>keyword-stuffing</strong> (over-optimization) risk, and an optional <strong>target keyword</strong> field reports that keyword&rsquo;s exact, phrase-aware density with a natural-range verdict. A bar view surfaces the top terms visually, and a copyable report captures the whole analysis.

  • Keyword density = (occurrences ÷ total words) × 100, for 1-, 2- and 3-word phrases, ranked most-used-first
  • TF-IDF-style prominence column boosts distinctive terms over common filler
  • Flags single words above ~4% density as possible keyword stuffing / over-optimization
  • Optional target keyword shows exact, phrase-aware density with a natural-range verdict
  • Optional stop-word filter, a top-terms bar view and a copyable report
Methodology

How Density and the TF-IDF Approximation Are Computed In-Browser

All logic lives in a small pure module (keywordDensityEngine.ts) with no new dependency and no DOM access; it reuses the shared textStatsEngine tokenizer so word counts stay consistent with the sibling readability and word-counter tools. The text is tokenized into lower-cased words (letters/digits, keeping intra-word apostrophes and hyphens), and contiguous <strong>n-grams</strong> of length 1, 2 and 3 are generated. For each term, <strong>density</strong> is the share of the copy its words occupy: for a phrase of n words appearing c times in W total words, density = (c &times; n) &divide; W &times; 100. <strong>TF-IDF</strong> is term frequency (c &divide; W) multiplied by an <strong>IDF proxy</strong>: the engine ships a curated list of the most common English words ranked by frequency, maps each word&rsquo;s rank to a pseudo document-frequency, and computes idf = ln(1 &divide; df); words absent from the list are treated as rare (high IDF), and a phrase takes the maximum IDF of its words with a small boost for length. Stop-word removal drops single pure stop-words and phrases where every word is a stop-word. The over-optimization flag uses widely-cited rules of thumb — roughly 0.5&ndash;3% is a comfortable natural band and above ~4% for a single term looks stuffed — and the target keyword is matched as a contiguous run for an exact count. This is deliberately an <strong>approximation</strong> of TF-IDF: a true IDF needs a corpus of documents, which a single pasted document cannot provide, so the common-word reference stands in for that corpus.

  • One pure engine (keywordDensityEngine.ts), no new dependency; reuses textStatsEngine for tokenizing
  • Density for an n-word phrase = (count × n) ÷ total words × 100
  • TF-IDF = term frequency × an IDF proxy from a built-in common-word frequency reference
  • Stop-word filter drops pure-stop-word single words and phrases; target keyword matched as a contiguous run
  • Approximation by design — true IDF needs a document corpus a single document cannot provide
Limitations

Keyword Density Is a Rough, Dated Metric — There Is No Ideal %

The tool is deliberately honest about what keyword density can and cannot tell you. Modern Google ranks on <strong>meaning and relevance</strong>, not on how many times a keyword appears, and it has <strong>never published an ideal keyword density</strong> — so there is no target percentage to optimise toward, and chasing one can hurt your writing. What density is genuinely useful for is a <strong>sanity check</strong>: spotting <strong>accidental over-use</strong> of a term (<strong>keyword stuffing</strong>, which Google&rsquo;s spam policies treat as a violation that can lower rankings, and in severe cases with hidden or repeated text even get a page deindexed) or <strong>under-use</strong> of your main topic, and seeing the real phrases your copy leans on. The commonly cited &ldquo;natural&rdquo; range of about <strong>0.5&ndash;3%</strong> for a primary term, with above ~4% looking repetitive, is a rule of thumb, not a rule. The <strong>TF-IDF score here is an approximation</strong>: true TF-IDF compares your page against a large corpus of documents, which a single pasted document cannot supply, so the tool substitutes a built-in common-English word reference — it highlights distinctive terms but is not a true corpus TF-IDF. The honest guidance is to <strong>write naturally for readers</strong>, place your keyword where it fits (title, intro, a heading), and use these numbers to catch mistakes rather than to hit a figure.

  • Google has no ideal keyword density and ranks on meaning — there is no target % to hit
  • Density is best for catching accidental over-use (stuffing) or under-use, and seeing real phrases
  • Keyword stuffing is a Google spam-policy violation that can lower rankings or, in severe cases, deindex a page
  • The ~0.5–3% natural range is a rule of thumb, not a rule; >~4% for one term looks stuffed
  • The TF-IDF score is an approximation (common-word reference, not a real corpus) — write naturally
Privacy & Security

Why Analyzing Keyword Density In-Browser Is a Privacy Win

Many online keyword-density and TF-IDF tools send your content to a server (and some gate results behind an account or crawl your live URL). This tool instead treats your text as a plain string that is tokenized and counted with ordinary JavaScript entirely on your device; nothing is fetched, uploaded, logged or stored, and no CDN is called for processing. That makes it safe to analyse <strong>unpublished drafts, client copy and confidential content</strong> without exposing them. The analysis updates live as you type, with <strong>1-, 2- and 3-word phrase tables</strong>, an optional stop-word filter, a <strong>target-keyword</strong> density check, a top-terms bar view and a copyable report. It works offline once cached as a PWA, supports dark mode and a mobile layout with a sticky Sample / Copy bar, and has exactly three ad slots. The logic is a small pure engine (keywordDensityEngine.ts) that reuses the shared textStatsEngine tokenizer with no new dependency — so the same trustworthy, local computation backs the whole readability/SEO family.

  • Text is tokenized and counted locally — never uploaded, no server, no CDN for processing
  • Safe for unpublished drafts, client copy and confidential content; no account or crawl
  • Live 1/2/3-word phrase tables, stop-word filter, target-keyword check and a copyable report
  • Works offline once cached; dark mode and mobile with a sticky Sample / Copy bar; exactly three ad slots
  • Pure shared engine (keywordDensityEngine.ts + textStatsEngine.ts), no new dependency
Keyword density & TF-IDF: in-browser (AnyTool) vs typical online analyzers
CapabilityAnyToolTypical online tools
ProcessingTokenizes + counts in your browserOften sends your content to a server
Your textNever uploaded, works offlineUploaded / processed server-side
Account / crawlNone — paste and goOften gated behind sign-up or a URL crawl
Phrases1-, 2- and 3-word n-gram tablesOften single words only
TF-IDFApproximation via built-in word reference, clearly labelledSometimes a paywalled corpus score
HonestyStates there is no ideal density; Google ranks on meaningOften implies a target % to hit
CostFree, no sign-up, no limitsFree tier often limited / upsold

AnyTool is a 100% client-side keyword density & TF-IDF tool: paste your content and it computes keyword density — (occurrences ÷ total words) × 100 — for 1-, 2- and 3-word phrases in ranked tables, a TF-IDF-style prominence score that highlights distinctive terms using a built-in common-word reference (an approximation of a corpus TF-IDF), a keyword-stuffing flag for single words above ~4% density, and an optional target-keyword density check with a natural-range verdict. Honest caveat: keyword density is a rough, dated metric with no ideal percentage — Google ranks on meaning, has never published a density target, and severe keyword stuffing is a spam-policy violation that can lower rankings or deindex a page; the TF-IDF score is an approximation because a single document has no real corpus, so write naturally and use the tool to catch accidental over/under-use. Comparison as of June 2026.