Enter your text below to calculate word count, estimated reading time, and keyword density.
Word Count:0
Reading Time:0 min
Keyword Density:0%
SEO Recommendation:–
function analyzeSEOContent() {
var text = document.getElementById('content-body').value.trim();
var keyword = document.getElementById('target-keyword').value.trim().toLowerCase();
var resultsPanel = document.getElementById('results-panel');
if (text.length === 0) {
alert('Please enter some content to analyze.');
return;
}
var words = text.split(/\s+/).filter(function(w) { return w.length > 0; });
var wordCount = words.length;
var readTime = Math.ceil(wordCount / 225);
var density = 0;
if (keyword.length > 0) {
var regex = new RegExp('\\b' + keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '\\b', 'gi');
var matches = text.match(regex);
if (matches) {
density = (matches.length / wordCount) * 100;
}
}
var advice = "";
if (wordCount 3) {
advice = "Keyword density is high (" + density.toFixed(2) + "%). Watch out for keyword stuffing.";
} else if (density 0) {
advice = "Keyword density is low. Ensure your primary keyword is mentioned in key sections.";
} else {
advice = "Good balance! Ensure your content provides value and uses LSI keywords.";
}
document.getElementById('res-word-count').innerText = wordCount;
document.getElementById('res-read-time').innerText = readTime + " min";
document.getElementById('res-density').innerText = density.toFixed(2) + "%";
document.getElementById('res-advice').innerText = advice;
resultsPanel.style.display = 'block';
}