Composite Fence Cost Calculator

SEO Content Analyzer & Word Counter

Words
0
Characters
0
Read Time
0m

Keyword Density (Top 5)

Enter text to see keyword density…
function analyzeContent() { var text = document.getElementById('seo-input').value; // Character Count var charCount = text.length; document.getElementById('char-count').innerText = charCount; // Word Count var words = text.trim().split(/\s+/).filter(function(word) { return word.length > 0; }); var wordCount = words.length; document.getElementById('word-count').innerText = wordCount; // Reading Time (Average 225 wpm) var readTime = Math.ceil(wordCount / 225); document.getElementById('read-time').innerText = readTime + 'm'; // Keyword Density if (wordCount > 5) { var freqMap = {}; var stopWords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'that', 'with', 'as', 'for', 'was', 'on', 'are', 'by', 'be', 'this', 'at', 'or', 'an']; words.forEach(function(w) { var word = w.toLowerCase().replace(/[^a-z0-9]/g, "); if (word.length > 3 && stopWords.indexOf(word) === -1) { freqMap[word] = (freqMap[word] || 0) + 1; } }); var sortedKeywords = Object.keys(freqMap).sort(function(a, b) { return freqMap[b] – freqMap[a]; }).slice(0, 5); var keywordHtml = "; sortedKeywords.forEach(function(key) { var percentage = ((freqMap[key] / wordCount) * 100).toFixed(1); keywordHtml += '
' + key + ': ' + percentage + '%
'; }); document.getElementById('keyword-list').innerHTML = keywordHtml || 'Keep typing…'; } else { document.getElementById('keyword-list').innerHTML = 'Enter more text for analysis…'; } } function clearText() { document.getElementById('seo-input').value = "; analyzeContent(); } function copyToClipboard() { var textArea = document.getElementById('seo-input'); textArea.select(); document.execCommand('copy'); alert('Text copied to clipboard!'); }

Leave a Comment