Compare Cities Cost of Living Calculator

SEO Keyword Density & Word Count Tool

Analyze your content for SEO optimization and word count metrics.

Total Words
0
Characters
0
Reading Time
0m

Top Keyword Density

Keyword Count Density
function analyzeSEOText() { var text = document.getElementById('seoContentInput').value; if (!text || text.trim() === ") { alert('Please enter some text to analyze.'); return; } var words = text.toLowerCase().match(/\b\w+\b/g); if (!words) return; var wordCount = words.length; var charCount = text.length; var readTime = Math.ceil(wordCount / 200); document.getElementById('resWordCount').innerText = wordCount; document.getElementById('resCharCount').innerText = charCount; document.getElementById('resReadTime').innerText = readTime + 'm'; var dictionary = {}; var stopWords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'with', 'for', 'on', 'was', 'as', 'at', 'by', 'an', 'be', 'this', 'that', 'or', 'from', 'are']; for (var i = 0; i 2 && stopWords.indexOf(w) === -1) { dictionary[w] = (dictionary[w] || 0) + 1; } } var sortedKeywords = []; for (var key in dictionary) { sortedKeywords.push([key, dictionary[key]]); } sortedKeywords.sort(function(a, b) { return b[1] – a[1]; }); var tbody = document.getElementById('densityBody'); tbody.innerHTML = "; var limit = Math.min(sortedKeywords.length, 10); for (var j = 0; j < limit; j++) { var kw = sortedKeywords[j][0]; var count = sortedKeywords[j][1]; var density = ((count / wordCount) * 100).toFixed(2) + '%'; var row = ''; row += '' + kw + ''; row += '' + count + ''; row += '' + density + ''; row += ''; tbody.innerHTML += row; } document.getElementById('seoResults').style.display = 'block'; } function clearSEOText() { document.getElementById('seoContentInput').value = "; document.getElementById('seoResults').style.display = 'none'; }

Leave a Comment