Skip to main content
Engagement Rate Calculator
value; const timePeriod = document.getElementById('timePeriod').value; const resultDiv = document.getElementById('result'); const benchmarkDiv = document.getElementById('benchmarkDisplay'); const periodDiv = document.getElementById('periodDisplay'); // Clear previous results resultDiv.className = 'result-display'; benchmarkDiv.style.display = 'none'; periodDiv.style.display = 'none'; // Validation based on formula type let denominator, denominatorName; if (formula === 'reach') { if (isNaN(engagements) || isNaN(reach)) { resultDiv.innerHTML = 'Please enter valid numbers for engagements and reach'; return; } if (reach === 0) { resultDiv.innerHTML = 'Total reach cannot be zero'; return; } denominator = reach; denominatorName = 'reach'; } else { if (isNaN(engagements) || isNaN(followers)) { resultDiv.innerHTML = 'Please enter valid numbers for engagements and followers'; return; } if (followers === 0) { resultDiv.innerHTML = 'Total followers cannot be zero'; return; } denominator = followers; denominatorName = 'followers'; } if (engagements < 0 || denominator < 0) { resultDiv.innerHTML = 'Values cannot be negative'; return; } // Calculate engagement rate const engagementRate = (engagements / denominator) * 100; // Display result resultDiv.innerHTML = `
Engagement Rate (by ${denominatorName}):
${engagementRate.toFixed(2)}%
`; // Show benchmark comparison displayBenchmark(platform, engagementRate, formula); // Display time period info if selected if (timePeriod) { displayPeriodInfo(timePeriod, engagements, denominator, engagementRate, denominatorName); } } function displayBenchmark(platform, rate, formula) { const benchmarkDiv = document.getElementById('benchmarkDisplay'); const benchmarkInfo = benchmarkDiv.querySelector('.benchmark-info'); // 2025 benchmarks by platform and formula type const benchmarks = { facebook: { reach: 0.27, followers: 0.15 }, instagram: { reach: 0.83, followers: 1.22 }, tiktok: { reach: 4.25, followers: 2.5 }, linkedin: { reach: 0.54, followers: 2.61 }, twitter: { reach: 0.045, followers: 0.045 }, youtube: { reach: 1.63, followers: 1.63 }, generic: { reach: 1.0, followers: 1.0 } }; const benchmark = benchmarks[platform] ? benchmarks[platform][formula] : benchmarks.generic[formula]; const platformName = platform.charAt(0).toUpperCase() + platform.slice(1); let status, message; if (rate >= benchmark * 2) { status = 'benchmark-good'; message = `🎉 Excellent! Your ${rate.toFixed(2)}% is well above ${platformName} average (${benchmark}%)`; } else if (rate >= benchmark) { status = 'benchmark-good'; message = `✅ Good! Your ${rate.toFixed(2)}% is above ${platformName} average (${benchmark}%)`; } else if (rate >= benchmark * 0.5) { status = ''; message = `📊 Your ${rate.toFixed(2)}% is below ${platformName} average (${benchmark}%) - room for improvement`; } else { status = 'benchmark-poor'; message = `📉 Your ${rate.toFixed(2)}% is significantly below ${platformName} average (${benchmark}%)`; } benchmarkDiv.className = `benchmark-display ${status}`; benchmarkInfo.innerHTML = message; benchmarkDiv.style.display = 'block'; } function displayPeriodInfo(timePeriod, engagements, denominator, rate, denominatorName) { const periodDiv = document.getElementById('periodDisplay'); const periodInfo = periodDiv.querySelector('.period-info'); let periodText = ''; let dailyAvg = ''; if (timePeriod === 'custom') { const startDate = document.getElementById('startDate').value; const endDate = document.getElementById('endDate').value; if (startDate && endDate) { const start = new Date(startDate); const end = new Date(endDate); const days = Math.ceil((end - start) / (1000 * 60 * 60 * 24)) + 1; periodText = `${formatDate(startDate)} to ${formatDate(endDate)} (${days} days)`; dailyAvg = `
Daily avg: ${(engagements/days).toFixed(1)} engagements, ${(denominator/days).toLocaleString()} ${denominatorName}`; } } else { const days = parseInt(timePeriod); const periodNames = { 7: '1 Week', 30: '1 Month', 90: '90 Days', 180: '6 Months', 365: '1 Year' }; periodText = `${periodNames[days]} (${days} days)`; dailyAvg = `
Daily avg: ${(engagements/days).toFixed(1)} engagements, ${(denominator/days).toLocaleString()} ${denominatorName}`; } if (periodText) { periodInfo.innerHTML = ` 📅 Period: ${periodText} ${dailyAvg} `; periodDiv.style.display = 'block'; } } function formatDate(dateStr) { const date = new Date(dateStr); return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }); } function updatePlatformSettings() { const platform = document.getElementById('platform').value; const engagementHelp = document.getElementById('engagementHelp'); const formulaNote = document.getElementById('formulaNote'); const platformEngagements = { facebook: 'Likes + Comments + Shares + Reactions + Clicks', instagram: 'Likes + Comments + Shares + Saves + Story interactions', tiktok: 'Likes + Comments + Shares + Views (3+ seconds)', linkedin: 'Likes + Comments + Shares + Clicks + Follows', twitter: 'Likes + Retweets + Replies + Clicks', youtube: 'Likes + Comments + Shares + Subscribers gained', generic: 'All meaningful interactions with your content' }; const platformNotes = { facebook: 'Facebook: Reach-based calculation recommended for paid content, follower-based for organic posts', instagram: 'Instagram: Saves and story interactions are crucial. Follower-based often preferred.', tiktok: 'TikTok: Highest engagement rates. Include 3+ second video views in engagements.', linkedin: 'LinkedIn: Professional network with higher comment engagement. Include profile follows.', twitter: 'Twitter/X: Lower overall rates but high conversation value. Include all click interactions.', youtube: 'YouTube: Include subscriber gains and community post interactions when available.', generic: 'Generic calculation - adapt engagement definition to your specific platform needs' }; engagementHelp.textContent = platformEngagements[platform] || platformEngagements.generic; formulaNote.textContent = platformNotes[platform] || platformNotes.generic; // Recalculate if values are present const engagements = document.getElementById('engagements').value; const reach = document.getElementById('reach').value; const followers = document.getElementById('followers').value; const formula = document.querySelector('input[name="formula"]:checked').