Break-Even Point Calculator
Enter Your Business Data
Break-Even Analysis
Enter your data in the 'Input Data' tab. The results will be shown here.
Please fill in all required cost and price fields with valid numbers.
"; downloadPdfButton.disabled = true; return; } if (fixedCosts < 0 || sellingPrice < 0 || variableCost < 0) { resultsOutput.innerHTML = "Cost and price values cannot be negative.
"; downloadPdfButton.disabled = true; return; } const contributionMarginPerUnit = sellingPrice - variableCost; let resultsHTML = ''; if (contributionMarginPerUnit <= 0) { resultsHTML = `Warning: The Selling Price Per Unit (${formatCurrency(sellingPrice, currency)}) is not greater than the Variable Cost Per Unit (${formatCurrency(variableCost, currency)}).
`; if (contributionMarginPerUnit === 0) { resultsHTML += `With a contribution margin of zero, the break-even point cannot be reached if fixed costs are greater than zero. Each unit sold does not contribute to covering fixed costs.
`; } else { // contributionMarginPerUnit < 0 resultsHTML += `Each unit sold results in a loss of ${formatCurrency(Math.abs(contributionMarginPerUnit),currency)}. Break-even is not achievable under these conditions.
`; } resultsOutput.innerHTML = resultsHTML; downloadPdfButton.disabled = true; // Or enable if we want to allow PDF of this warning state return; } const breakEvenUnits = fixedCosts / contributionMarginPerUnit; const breakEvenRevenue = breakEvenUnits * sellingPrice; const contributionMarginRatio = (contributionMarginPerUnit / sellingPrice) * 100; resultsHTML = `Contribution Margin Per Unit: ${formatCurrency(contributionMarginPerUnit, currency)}
Contribution Margin Ratio: ${contributionMarginRatio.toFixed(2)}%
Break-Even Point in Units: ${formatUnits(breakEvenUnits)} units
(Number of units you need to sell to cover all your costs)
Break-Even Point in Revenue: ${formatCurrency(breakEvenRevenue, currency)}
(Total revenue required to cover all your costs)
`; resultsOutput.innerHTML = resultsHTML; downloadPdfButton.disabled = false; } // Add event listeners to input fields to recalculate when on results tab ['bep-fixed-costs', 'bep-selling-price', 'bep-variable-cost', 'bep-currency-symbol'].forEach(id => { document.getElementById(id).addEventListener('input', () => { if (tabs[currentTabIndex].dataset.tab === 'results') { calculateAndDisplayBreakEven(); } if(id === 'bep-currency-symbol') updateCurrencySymbolDisplay(); }); }); downloadPdfButton.addEventListener('click', function () { if (typeof jspdf === 'undefined' || typeof jspdf.jsPDF === 'undefined') { alert('Error: jsPDF library is not loaded. Cannot generate PDF.'); return; } const { jsPDF } = jspdf; const doc = new jsPDF(); const businessName = getTextValue('bep-business-name') || 'N/A'; const periodDesc = getTextValue('bep-period-desc') || 'N/A'; const currency = currencySymbolInput.value || '$'; const fixedCosts = getNumericValue('bep-fixed-costs'); const sellingPrice = getNumericValue('bep-selling-price'); const variableCost = getNumericValue('bep-variable-cost'); // Primary color from CSS variable const primaryColor = getComputedStyle(document.documentElement).getPropertyValue('--bep-primary-color').trim(); const secondaryColor = getComputedStyle(document.documentElement).getPropertyValue('--bep-secondary-color').trim(); const textColor = getComputedStyle(document.documentElement).getPropertyValue('--bep-text-color').trim(); const buttonTextColor = getComputedStyle(document.documentElement).getPropertyValue('--bep-button-text-color').trim(); doc.setFontSize(18); doc.setTextColor(primaryColor); doc.text('Break-Even Point Analysis', 105, 20, null, null, 'center'); doc.setFontSize(12); doc.setTextColor(textColor); doc.text(`Business Name: ${businessName}`, 14, 35); doc.text(`Period for Fixed Costs: ${periodDesc}`, 14, 42); doc.text(`Currency: ${currency}`, 14, 49); const inputData = [ ['Input Item', 'Value'], ['Total Fixed Costs', formatCurrency(fixedCosts, currency)], ['Selling Price Per Unit', formatCurrency(sellingPrice, currency)], ['Variable Cost Per Unit', formatCurrency(variableCost, currency)] ]; doc.autoTable({ startY: 55, head: [['Input Data', '']], body: inputData, theme: 'grid', headStyles: { fillColor: secondaryColor, textColor: buttonTextColor, fontStyle: 'bold' }, columnStyles: { 0: { fontStyle: 'bold' } } }); const contributionMarginPerUnit = sellingPrice - variableCost; let resultsData = []; if (contributionMarginPerUnit <= 0) { resultsData.push(['Contribution Margin Per Unit', formatCurrency(contributionMarginPerUnit,currency)]); if (sellingPrice === variableCost) { resultsData.push(['Break-Even Point', 'Not achievable (Contribution Margin is zero)']); } else { resultsData.push(['Break-Even Point', 'Not achievable (Selling Price < Variable Cost)']); } } else { const breakEvenUnits = fixedCosts / contributionMarginPerUnit; const breakEvenRevenue = breakEvenUnits * sellingPrice; const contributionMarginRatio = (contributionMarginPerUnit / sellingPrice) * 100; resultsData = [ ['Contribution Margin Per Unit', formatCurrency(contributionMarginPerUnit, currency)], ['Contribution Margin Ratio', `${contributionMarginRatio.toFixed(2)}%`], ['Break-Even Point in Units', `${formatUnits(breakEvenUnits)} units`], ['Break-Even Point in Revenue', formatCurrency(breakEvenRevenue, currency)] ]; } doc.autoTable({ startY: doc.lastAutoTable.finalY + 10, head: [['Analysis Results', '']], body: resultsData, theme: 'grid', headStyles: { fillColor: primaryColor, textColor: buttonTextColor, fontStyle: 'bold' }, columnStyles: { 0: { fontStyle: 'bold' } } }); const finalY = doc.lastAutoTable.finalY || 70; doc.setFontSize(10); doc.setTextColor(150); doc.text(`Report generated on: ${new Date().toLocaleDateString()}`, 14, finalY + 15); doc.save(`Break_Even_Analysis_${businessName.replace(/\s+/g, '_') || 'Report'}.pdf`); }); showTab(0); // Initialize first tab });