SEO Content Analyzer
Word Count
0
Character Count
0
Enter text above to see SEO insights regarding length and optimization.
function performSeoAnalysis() {
var text = document.getElementById('seoContent').value;
var charCount = text.length;
var wordCount = text.trim() === "" ? 0 : text.trim().split(/\s+/).length;
var adviceBox = document.getElementById('seoAdvice');
var advice = "";
document.getElementById('resWords').innerHTML = wordCount;
document.getElementById('resChars').innerHTML = charCount;
if (charCount === 0) {
advice = "Please enter some text to analyze.";
} else if (charCount >= 50 && charCount <= 60) {
advice = "Title Tag: Perfect! This is the ideal length for search engine result pages (50-60 chars).";
} else if (charCount > 120 && charCount <= 160) {
advice = "Meta Description: Excellent length. It fits perfectly within the 160 character limit for desktop/mobile.";
} else if (charCount > 0 && charCount < 50) {
advice = "Short Content: This text is quite short. If this is a Title Tag, consider adding a primary keyword or brand name.";
} else if (charCount > 160 && wordCount < 300) {
advice = "Meta Description Warning: Your text exceeds 160 characters. Search engines might truncate it in results.";
} else if (wordCount >= 300) {
advice = "Article Analysis: Good start for a blog post. Focus on keyword density and using H2-H3 subheadings for better ranking.";
} else {
advice = "Analysis complete. Use this length data to align with your specific SEO goals.";
}
adviceBox.innerHTML = advice;
adviceBox.style.background = "#ebf8ff";
adviceBox.style.borderColor = "#bee3f8";
adviceBox.style.color = "#2a4365";
}
function resetSeoTool() {
document.getElementById('seoContent').value = "";
document.getElementById('resWords').innerHTML = "0";
document.getElementById('resChars').innerHTML = "0";
document.getElementById('seoAdvice').innerHTML = "Enter text above to see SEO insights regarding length and optimization.";
document.getElementById('seoAdvice').style.background = "#fffaf0";
document.getElementById('seoAdvice').style.borderColor = "#feebc8";
document.getElementById('seoAdvice').style.color = "#744210";
}