Calculate Business Days

SEO Content Analyzer

Analysis Results

Word Count 0
Keyword Density 0%
function analyzeSEOContent() { var content = document.getElementById('textContent').value; var keyword = document.getElementById('focusKeyword').value.trim().toLowerCase(); var resultsBox = document.getElementById('seoResults'); var checklist = document.getElementById('seoChecklist'); if (!content || !keyword) { alert('Please enter both a keyword and content.'); return; } var words = content.toLowerCase().match(/\w+/g) || []; var wordCount = words.length; var kwRegex = new RegExp('\\b' + keyword + '\\b', 'gi'); var kwMatches = content.match(kwRegex) || []; var kwCount = kwMatches.length; var density = wordCount > 0 ? ((kwCount / wordCount) * 100).toFixed(2) : 0; document.getElementById('resWordCount').innerText = wordCount; document.getElementById('resDensity').innerText = density + '%'; var checks = []; // Length Check if (wordCount < 300) { checks.push('
  • Content is too short (Under 300 words).
  • '); } else { checks.push('
  • Good content length.
  • '); } // Density Check if (density > 0.5 && density < 2.5) { checks.push('
  • Excellent keyword density.
  • '); } else if (density >= 2.5) { checks.push('
  • Keyword stuffing risk! High density.
  • '); } else { checks.push('
  • Keyword density is low. Use it more naturally.
  • '); } // Heading Check if (content.match(/<h[1-2]/i) || content.match(/^[A-Z].*\n={2,}/m)) { checks.push('
  • Subheadings detected.
  • '); } else { checks.push('
  • Consider adding H2 or H3 subheadings.
  • '); } // Paragraph Check var paragraphs = content.split(/\n\s*\n/); var longPara = false; for (var i = 0; i 150) { longPara = true; break; } } if (longPara) { checks.push('
  • Some paragraphs are too long. Break them up.
  • '); } else { checks.push('
  • Paragraph length is optimal.
  • '); } checklist.innerHTML = checks.join("); resultsBox.style.display = 'block'; }

    Leave a Comment