Keyword Density Analyzer

The Keyword Density Analyzer Bookmarklet is a powerful tool for SEO analysis and content optimization.

With one click, this bookmarklet analyzes the current webpage and shows you the density of the most frequently used words.

Perfect for quick SEO analysis and content optimization. No more complex tools or manual counting - just click and analyze!

javascript:!function(){const e=document.body.innerText.toLowerCase().match(/\b\w+\b/g)||[],n=e.length,t={};e.forEach((e=>{e.length>3&&(t[e]=(t[e]||0)+1)}));const o=Object.entries(t).sort((([,e],[,n])=>n-e)).slice(0,10).map((([e,t])=>({word:e,count:t,percentage:(t/n*100).toFixed(2)}))).map((({word:e,count:n,percentage:t})=>`${e}: ${n} occurrences (${t}%)`)).join("\n");alert("Top 10 Keywords by Density:\n\n"+o)}();
Drag me to bookmark bar: 👉🏻 Keyword Density Analyzer

This tool streamlines your content analysis by:

Why Use the Keyword Density Analyzer?

This essential tool makes keyword density analysis effortless. Perfect for SEO professionals, content writers, and anyone who needs to optimize their content for search engines. Simply click the bookmarklet to instantly see the most frequently used words and their density percentages. Helps you quickly identify overused or underused keywords and optimize your content accordingly.

Features

How to Use

  1. Click the bookmarklet
  2. A popup will show the top 10 keywords with their:
    • Number of occurrences
    • Percentage of total words

Code

javascript:(function(){
const text = document.body.innerText;
const words = text.toLowerCase().match(/\b\w+\b/g) || [];
const wordCount = words.length;
const wordFreq = {};

words.forEach(word => {
if (word.length > 3) { // Ignore short words
wordFreq[word] = (wordFreq[word] || 0) + 1;
}
});

const sortedWords = Object.entries(wordFreq)
.sort(([,a], [,b]) => b - a)
.slice(0, 10);

const density = sortedWords.map(([word, count]) => ({
word,
count,
percentage: ((count / wordCount) * 100).toFixed(2)
}));

const result = density.map(({word, count, percentage}) =>
`${word}: ${count} occurrences (${percentage}%)`
).join('\n');

alert('Top 10 Keywords by Density:\n\n' + result);
})();

Use Cases