How Many Steps a Day to Lose Weight Calculator

SEO Content Analyzer

Analyze your content for SEO word count, reading time, and keyword density.

Word Count
0
Reading Time
0m
Characters
0

Top Keyword Density

function analyzeSEOContent() { var text = document.getElementById('seo_content_input').value; if (!text.trim()) { alert('Please enter some text to analyze.'); return; } var cleanText = text.replace(/[^\w\s]/gi, ").toLowerCase(); var wordsArray = cleanText.split(/\s+/).filter(function(w) { return w.length > 2; }); var wordCount = wordsArray.length; var charCount = text.length; // Calculate Reading Time (avg 225 words per minute) var readingTime = Math.ceil(wordCount / 225); // Update basic stats document.getElementById('res_word_count').innerHTML = wordCount; document.getElementById('res_char_count').innerHTML = charCount; document.getElementById('res_reading_time').innerHTML = readingTime + 'm'; // Calculate Keyword Density var counts = {}; for (var i = 0; i < wordsArray.length; i++) { var word = wordsArray[i]; counts[word] = (counts[word] || 0) + 1; } var sortedKeywords = []; for (var key in counts) { sortedKeywords.push([key, counts[key]]); } sortedKeywords.sort(function(a, b) { return b[1] – a[1]; }); var densityHtml = ''; var topX = Math.min(sortedKeywords.length, 5); for (var j = 0; j < topX; j++) { var kw = sortedKeywords[j][0]; var count = sortedKeywords[j][1]; var percentage = ((count / wordCount) * 100).toFixed(1); densityHtml += '
' + '' + kw + '' + '' + count + ' occurrences (' + percentage + '%)' + '
'; } document.getElementById('res_density_list').innerHTML = densityHtml; document.getElementById('density_section').style.display = 'block'; } function clearSEOContent() { document.getElementById('seo_content_input').value = "; document.getElementById('res_word_count').innerHTML = '0'; document.getElementById('res_char_count').innerHTML = '0'; document.getElementById('res_reading_time').innerHTML = '0m'; document.getElementById('density_section').style.display = 'none'; }

Leave a Comment