Early Retirement Calculator

Click here for source code

Summary

Current year {{new Date().getFullYear()}} (age {{data.person.age}})
Your current net worth is ({{toDollar(data.person.roth+data.person.investment+data.person.pretaxBalance)}}.)

Retirement year {{data.person.retirement.year}} (age {{data.person.retirement.age}})
When you retire, your net worth will be {{toDollar(data.person.retirement.roth+data.person.retirement.pretaxBalance+data.person.retirement.investment)}}: you'll have {{toDollar(data.person.retirement.investment)}} in your post-tax investment accounts, {{toDollar(data.person.retirement.roth)}} in your Roth IRA/401k accounts, and {{toDollar(data.person.retirement.pretaxBalance)}} in your tax deferred traditional retirement accounts.
Your current retirement plan cannot get you to {{data.person.retirement.age}}, your post-tax balance will be {{toDollar(data.person.retirement.investment)}}, try adjusting your retirement plan!
After retirement, all your spending, including taxes that you need to pay will come from your post-tax investment account until you reach the age of {{data.noPenaltyWithdraw.age}}, which means that you'll need to pay capital gain taxes for the amount drawn.
Note: the calculation assumes 50% withdraws from post-tax investment accounts are capital gains
Note: For ease of calculation, age 60 is used, instead of 59.5

Penalty free withdraw year {{data.noPenaltyWithdraw.year}} (age {{data.noPenaltyWithdraw.age}})
After you've reached the age of {{data.noPenaltyWithdraw.age}} (59.5), your net worth will be {{toDollar(data.noPenaltyWithdraw.roth+data.noPenaltyWithdraw.pretaxBalance+data.noPenaltyWithdraw.investment)}}: you'll have {{toDollar(data.noPenaltyWithdraw.investment)}} in your post-tax investment account, {{toDollar(data.noPenaltyWithdraw.roth)}} in your Roth IRA/401k accounts, and {{toDollar(data.noPenaltyWithdraw.pretaxBalance)}} in your tax deferred traditional retirement accounts.
You can start withdrawing funds from pretax accounts without penalty, however, you'll pay ordinary income tax for the withdraws. At this time, instead of selling investments from post-tax accounts to cover taxes and spending, the funds should come from your pretax accounts. The step-up rule allows you to pass down your brokerage investment balance to your heir without incurring capital gain tax.
Your current retirement plan cannot get you through {{data.noPenaltyWithdraw.age}} where you can withdraw from pretax accounts without penalty. Your post-tax savings is {{toDollar(data.noPenaltyWithdraw.investment)}}, You have {{toDollar(data.noPenaltyWithdraw.pretaxBalance)}} in pretax accounts, consider adjusting your plan, or look into "55 rule" or "72t" for early withdraw.
Social Security benefit starting year {{data.person.ss.year}} (age {{data.person.ss.age}})
You indicated that you want to start receiving the social security benefit at the age of {{data.person.ss.age}}, and the monthly benefit will be {{toDollar(data.person.ss.perMonth)}}.

Required Minimum Distribution year {{data.rmd.year}} (age {{data.rmd.age}})
Your pretax retirement accounts will have {{toDollar(data.rmd.pretaxBalance)}}
Good Job
You'll be required to take out {{toDollar(data.rmd.rmd)}} from your pretax accounts this year, your estimated tax bill will be {{toDollar(data.rmd.tax)}} for withdraw amount of {{toDollar(data.rmd.dist)}}.

End of life year {{data.person.deceased.year}} (age {{data.person.deceased.age}})
When you die, your net worth will be {{toDollar(data.person.deceased.roth+data.person.deceased.pretaxBalance+data.person.deceased.investment)}}: you'll have {{toDollar(data.person.deceased.investment)}} in your post-tax investment accounts, {{toDollar(data.person.deceased.roth)}} in your Roth IRA/401k accounts, and {{toDollar(data.person.deceased.pretaxBalance)}} in your tax deferred traditional retirement accounts.

Tip: How much money you will end up with is what matters, not how much taxes you will pay.
TODOs
  1. add calculation for Singler filer, and other types
  2. before retirement, if started conversion, and salary doesn't cover tax, need to take tax out of investment
  3. different state capital gain tax from ordinary
  4. custom % conversion
  5. spouse
  6. today's currency view
  7. one-off expenses & income