function calculateCoastFIRE() {
var currentSavings = parseFloat(document.getElementById('currentSavings').value);
var currentAge = parseFloat(document.getElementById('currentAge').value);
var retirementAge = parseFloat(document.getElementById('retirementAge').value);
var withdrawalAge = parseFloat(document.getElementById('withdrawalAge').value);
var desiredAnnualSpending = parseFloat(document.getElementById('desiredAnnualSpending').value);
var inflationRate = parseFloat(document.getElementById('inflationRate').value) / 100;
var investmentReturnRate = parseFloat(document.getElementById('investmentReturnRate').value) / 100;
var safeWithdrawalRate = parseFloat(document.getElementById('safeWithdrawalRate').value) / 100;
// Input validation
if (isNaN(currentSavings) || isNaN(currentAge) || isNaN(retirementAge) || isNaN(withdrawalAge) ||
isNaN(desiredAnnualSpending) || isNaN(inflationRate) || isNaN(investmentReturnRate) || isNaN(safeWithdrawalRate)) {
document.getElementById('statusMessage').innerHTML = "Please enter valid numbers for all fields.";
document.getElementById('statusMessage').style.color = "red";
document.getElementById('targetNestEggOutput').innerHTML = "";
document.getElementById('coastFireNumberOutput').innerHTML = "";
document.getElementById('projectedSavingsOutput').innerHTML = "";
return;
}
if (currentAge >= retirementAge) {
document.getElementById('statusMessage').innerHTML = "Current Age must be less than Age to Stop Contributing.";
document.getElementById('statusMessage').style.color = "red";
document.getElementById('targetNestEggOutput').innerHTML = "";
document.getElementById('coastFireNumberOutput').innerHTML = "";
document.getElementById('projectedSavingsOutput').innerHTML = "";
return;
}
if (retirementAge >= withdrawalAge) {
document.getElementById('statusMessage').innerHTML = "Age to Stop Contributing must be less than Age to Start Withdrawing.";
document.getElementById('statusMessage').style.color = "red";
document.getElementById('targetNestEggOutput').innerHTML = "";
document.getElementById('coastFireNumberOutput').innerHTML = "";
document.getElementById('projectedSavingsOutput').innerHTML = "";
return;
}
if (safeWithdrawalRate <= 0) {
document.getElementById('statusMessage').innerHTML = "Safe Withdrawal Rate must be greater than 0.";
document.getElementById('statusMessage').style.color = "red";
document.getElementById('targetNestEggOutput').innerHTML = "";
document.getElementById('coastFireNumberOutput').innerHTML = "";
document.getElementById('projectedSavingsOutput').innerHTML = "";
return;
}
if (investmentReturnRate <= inflationRate) {
document.getElementById('statusMessage').innerHTML = "Investment Growth Rate should ideally be higher than Inflation Rate for real growth.";
document.getElementById('statusMessage').style.color = "orange";
} else {
document.getElementById('statusMessage').style.color = "#007bff"; // Reset color if valid
}
// 1. Calculate Future Desired Annual Spending (adjusted for inflation)
var yearsToWithdrawalFromCurrent = withdrawalAge – currentAge;
var futureSpending = desiredAnnualSpending * Math.pow((1 + inflationRate), yearsToWithdrawalFromCurrent);
// 2. Calculate Total Nest Egg Needed at Withdrawal Age
var nestEggNeeded = futureSpending / safeWithdrawalRate;
// 3. Calculate the "Coast FIRE Number" (Amount needed by Age to Stop Contributing)
var yearsOfGrowthAfterStoppingContributions = withdrawalAge – retirementAge;
var coastFireNumberAtRetirementAge = nestEggNeeded / Math.pow((1 + investmentReturnRate), yearsOfGrowthAfterStoppingContributions);
// 4. Project Current Savings to Age to Stop Contributing
var yearsUntilRetirement = retirementAge – currentAge;
var projectedSavingsAtRetirementAge = currentSavings * Math.pow((1 + investmentReturnRate), yearsUntilRetirement);
// Display results
document.getElementById('targetNestEggOutput').innerHTML = "Target Nest Egg at Age " + withdrawalAge + ": $" + nestEggNeeded.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 });
document.getElementById('coastFireNumberOutput').innerHTML = "Amount Needed by Age " + retirementAge + " (Coast FIRE Number): $" + coastFireNumberAtRetirementAge.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 });
document.getElementById('projectedSavingsOutput').innerHTML = "Projected Value of Current Savings by Age " + retirementAge + ": $" + projectedSavingsAtRetirementAge.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 });
if (projectedSavingsAtRetirementAge >= coastFireNumberAtRetirementAge) {
document.getElementById('statusMessage').innerHTML = "Congratulations! You have reached your Coast FIRE number by age " + retirementAge + "!";
document.getElementById('statusMessage').style.color = "green";
} else {
var shortfall = coastFireNumberAtRetirementAge – projectedSavingsAtRetirementAge;
document.getElementById('statusMessage').innerHTML = "You need to save an additional $" + shortfall.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) + " by age " + retirementAge + " to reach your Coast FIRE number.";
document.getElementById('statusMessage').style.color = "red";
}
}
Understanding Coast FIRE
Coast FIRE is a financial independence strategy where you save and invest a significant amount of money early in your career, enough so that it can grow untouched through compound interest to fund your retirement by a traditional retirement age, without requiring any further contributions. Once you hit your Coast FIRE number, you no longer need to actively save for retirement, freeing you to pursue less stressful, lower-paying jobs, work part-time, or simply enjoy a more relaxed career path until you're ready to fully retire.
How Coast FIRE Works
The core idea behind Coast FIRE is leveraging the power of compound interest over a long period. Instead of saving aggressively until your full retirement, you front-load your savings. This initial nest egg then "coasts" on its own, growing exponentially over decades, until it reaches your desired retirement fund size. This approach offers immense flexibility and reduces financial pressure in your later working years.
The calculator above helps you determine:
Your Target Nest Egg: The total amount you'll need saved by your withdrawal age to support your desired annual spending, adjusted for inflation.
Your Coast FIRE Number: The specific amount you need to have saved by the age you plan to stop contributing (your "retirement age" in this context) for it to grow into your target nest egg by your withdrawal age.
Projected Value of Current Savings: What your existing savings will grow to by your planned age to stop contributing, assuming no further contributions.
Key Inputs Explained
Current Savings: The total amount you have saved and invested for retirement right now.
Current Age: Your age today.
Age to Stop Contributing: The age at which you plan to stop making active contributions to your retirement accounts. After this point, your money will grow passively.
Age to Start Withdrawing: The age at which you plan to fully retire and begin drawing income from your nest egg.
Desired Annual Spending in Retirement (Today's Value): How much money you anticipate needing to spend each year in retirement, expressed in today's dollars. The calculator will adjust this for inflation.
Expected Annual Inflation Rate: The average rate at which you expect the cost of living to increase each year. A common estimate is 2-3%.
Expected Annual Investment Growth Rate: The average annual return you expect your investments to generate. Historically, a diversified portfolio might return 6-8% after inflation, or 8-10% nominally.
Safe Withdrawal Rate: The percentage of your total nest egg you plan to withdraw each year in retirement without running out of money. The "4% Rule" is a common guideline, suggesting you can safely withdraw 4% of your initial portfolio value, adjusted for inflation annually.
Example Scenario
Let's consider an example using the default values in the calculator:
Current Savings: $100,000
Current Age: 30
Age to Stop Contributing: 45
Age to Start Withdrawing: 60
Desired Annual Spending: $50,000 (in today's dollars)
Inflation Rate: 3%
Investment Growth Rate: 7%
Safe Withdrawal Rate: 4%
Based on these inputs, the calculator would determine:
Your desired $50,000 annual spending, adjusted for 3% inflation over 30 years (from age 30 to 60), would be approximately $121,363 per year at age 60.
To support this spending with a 4% safe withdrawal rate, you would need a Target Nest Egg of approximately $3,034,075 by age 60.
To reach this target, you would need to have saved approximately $1,100,420 by age 45 (your Coast FIRE Number).
Your current $100,000, growing at 7% annually for 15 years (from age 30 to 45), would only reach approximately $275,903.
In this scenario, you would need to save an additional $824,517 by age 45 to hit your Coast FIRE number. This calculator helps you visualize the gap and plan your savings strategy accordingly.
Important Considerations
While the Coast FIRE calculator provides a powerful estimate, remember that it relies on several assumptions:
Consistent Investment Returns: Actual market returns can vary significantly year to year.
Stable Inflation: Inflation rates can fluctuate.
Fixed Spending: Your desired spending in retirement might change.
No Further Contributions: The calculation assumes you stop contributing at your specified age. If you continue to save, you'll reach your goal faster.
Use this calculator as a guide to inform your financial planning, but always consider consulting with a financial advisor for personalized advice.