function calculateSavingsRate() {
var income = parseFloat(document.getElementById('netIncome').value);
var expenses = parseFloat(document.getElementById('monthlyExpenses').value);
var resultsDiv = document.getElementById('mmm-results');
if (isNaN(income) || isNaN(expenses) || income <= 0) {
alert("Please enter valid positive numbers for income and expenses.");
return;
}
var savings = income – expenses;
var rate = (savings / income) * 100;
if (savings = Income)";
resultsDiv.style.display = 'block';
return;
}
// Calculation based on "Shockingly Simple Math of Early Retirement"
// Assumptions: 5% Real Investment Return, 4% Safe Withdrawal Rate (SWR)
// The formula for years to FI:
// Years = ln((Expenses / (Savings * ReturnRate / SWR)) * (ReturnRate / (1 + ReturnRate)) + 1) / ln(1 + ReturnRate)
// Simplified approximation for standard MMM table:
var r = 0.05; // 5% real return
var swr = 0.04; // 4% rule
var i = rate / 100; // savings rate as decimal
var yearsToFI;
if (i >= 0.99) {
yearsToFI = 0;
} else {
// Years = ln( (Investment_Goal * r / Savings) + 1 ) / ln(1 + r)
// Goal = Expenses / swr
var goal = expenses / swr;
var annualSavings = savings * 12;
yearsToFI = Math.log((goal * r / annualSavings) + 1) / Math.log(1 + r);
}
document.getElementById('rateOutput').innerText = rate.toFixed(1) + "%";
document.getElementById('savingsOutput').innerText = "$" + savings.toLocaleString();
document.getElementById('yearsOutput').innerText = yearsToFI.toFixed(1) + " Years";
var insight = "";
if (rate < 15) {
insight = "At this rate, you're on the traditional 40+ year career path. Reducing expenses can drastically shorten this.";
} else if (rate < 50) {
insight = "You're doing great! You are well ahead of the average person and approaching early retirement territory.";
} else {
insight = "You are a Mustachian warrior! Working is now essentially optional for you in the near future.";
}
document.getElementById('insightText').innerText = insight;
resultsDiv.style.display = 'block';
}
Understanding the MMM Savings Rate
The "MMM Savings Rate" refers to the core philosophy popularized by Mr. Money Mustache in his seminal article, "The Shockingly Simple Math of Early Retirement." Unlike traditional financial advice that focuses on investment returns or picking stocks, this calculation proves that your savings rate is the single most important factor in determining when you can retire.
Why Your Savings Rate is the Only Number That Matters
Your savings rate is powerful because it works in two directions simultaneously:
- Accumulation: The more you save, the faster your "Stash" grows through compound interest.
- Requirement: The more you save, the less you spend. Because you spend less, the total amount of money you need to support your lifestyle (the "FI Number") actually decreases.
The Math Breakdown
The calculation above assumes a 5% real investment return (after inflation) and follows the 4% Rule (Safe Withdrawal Rate). Under these assumptions, the math remains constant regardless of whether you earn $50,000 or $500,000:
| Savings Rate |
Working Years to FI |
| 10% | 51 Years |
| 25% | 32 Years |
| 50% | 17 Years |
| 75% | 7 Years |
How to Increase Your Savings Rate
To move the needle, you have two levers: Increase Income or Decrease Expenses. However, Mustachianism emphasizes decreasing expenses first. Why? Because a dollar saved is better than a dollar earned. Earnings are taxed; savings are not. Furthermore, decreasing your spending permanently lowers the amount of capital required to retire forever.
Example Calculation
If you take home $4,000 a month and spend $2,000, your savings rate is 50%. According to the math, you can retire in approximately 17 years, assuming you start from zero. If you already have some investments, your timeline is even shorter.