Calculate Product Cost

Quick SEO Content Analyzer

Paste your content below to analyze word count, reading time, and keyword density for better search rankings.

Word Count
0
Reading Time
0m
Characters
0

Top Keyword Density

function analyzeSEOContent() { var text = document.getElementById('seo-text-input').value; var resultsBox = document.getElementById('seo-results'); var densityBox = document.getElementById('density-report'); if (text.trim() === ") { alert('Please enter some text to analyze.'); return; } var words = text.trim().split(/\s+/).filter(function(w) { return w.length > 0; }); var wordCount = words.length; var charCount = text.length; var readingTime = Math.ceil(wordCount / 225); document.getElementById('stat-words').innerText = wordCount; document.getElementById('stat-time').innerText = readingTime + 'm'; document.getElementById('stat-chars').innerText = charCount; resultsBox.style.display = 'grid'; densityBox.style.display = 'block'; var freq = {}; var stopwords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'that', 'with', 'as', 'for', 'was', 'on', 'are', 'by']; for (var i = 0; i 3 && stopwords.indexOf(word) === -1) { freq[word] = (freq[word] || 0) + 1; } } var sorted = []; for (var key in freq) { sorted.push([key, freq[key]]); } sorted.sort(function(a, b) { return b[1] – a[1]; }); var densityHtml = '
    '; var limit = Math.min(5, sorted.length); for (var j = 0; j < limit; j++) { var percentage = ((sorted[j][1] / wordCount) * 100).toFixed(1); densityHtml += '
  • ' + sorted[j][0] + ': ' + percentage + '%
  • '; } densityHtml += '
'; document.getElementById('density-list').innerHTML = sorted.length > 0 ? densityHtml : 'No significant keywords found.'; } function resetSEOAnalyzer() { document.getElementById('seo-text-input').value = "; document.getElementById('seo-results').style.display = 'none'; document.getElementById('density-report').style.display = 'none'; }

Leave a Comment