Roth vs Traditional 401(k) & IRA Calculator — optimized for your whole life
Free optimizer that splits your savings between traditional 401(k), Roth 401(k), IRAs, HSA and brokerage year by year — using a real linear-programming solver that also plans your retirement Roth conversions and withdrawals — to maximize what you keep after tax.
Already retired? Use the Roth conversion optimizer instead. All figures are in today's dollars and use 2026 federal tax law.
Your plan
Is the mix worth it?
Contributions by account while working
Account balances (start of each year)
Year-by-year plan
Assumptions
- All amounts are in today's dollars; the return, raises and limits are after inflation.
- Spouses are assumed to be the same age, and a married couple never switches to single filing.
- Employer match goes into a traditional account unless you tick the Roth match option.
- HSA money is assumed to be spent on medical costs, so it is never taxed on the way out.
- The backdoor Roth assumes you have no other pre-tax IRA money (the pro-rata rule is not modeled).
- Contribution limits are the 2026 amounts, indexed with inflation, with age-based catch-ups added automatically.
- Federal tax uses 2026 brackets and standard deduction; state tax is the flat rate or brackets you chose. Local taxes are not included.
- The leftover traditional balance at the end is valued after the tax rate you entered.
Not tax or investment advice. This is a model: it simplifies real tax law, uses one real rate of return for every account, and does not cover self-employed plans, after-tax (mega-backdoor) 401(k) contributions, or different-age spouses. Results depend entirely on your inputs. Confirm any plan with a qualified tax professional before acting. Built by Kind of Lost.
Worked example: age 35, $110,000 salary, retiring at 60
This is the sample scenario the form loads with, solved exactly as it is when you press Optimize. A single 35-year-old earns $110,000, with raises of 1% a year above inflation, and plans to stop working at 60. Their employer matches 100% of the first 4% of pay. They have a 401(k) with a Roth option, can use an IRA, and have no HSA. They start with $60,000 in traditional accounts, $15,000 in Roth and $20,000 in a brokerage account, spend $60,000 a year while working and $55,000 a year in retirement, and expect $28,000 a year of Social Security from 67. Returns are 5% above inflation, the plan runs to age 92, and any traditional money left at the end is valued after 22% tax. Everything is in today's dollars.
- Optimal mix: $6,712,726 after tax at age 92.
- Always traditional: $6,558,226, so the optimal mix is worth $154,499 more (+2.4%).
- Always Roth: $6,488,204, so the optimal mix is worth $224,521 more (+3.5%).
This year, at age 35: $24,500 into the Roth 401(k), $7,500 into a Roth IRA through the backdoor, and $4,400 of employer match on top. The plan also converts $11,800 of the existing traditional balance to Roth while there is room left in the 22% bracket.
Over time it changes its mind. Across the 25 working years the plan puts $343,849 into the traditional 401(k), $348,651 into the Roth 401(k) and $198,500 into Roth IRAs, so about 61% of employee contributions go to Roth. It is not one rule applied every year. Ages 35 and 36 are all Roth. Ages 37 to 42 start mostly traditional and drift toward Roth, ages 43 to 51 are mostly Roth, and ages 52 to 59 put the full $32,500 (the limit including catch-up) into the traditional 401(k). Because the plan also has to fund $60,000 a year of living costs, the maximum cannot always go into Roth: where cash is tight, a traditional dollar costs less take-home pay than a Roth dollar.
Then retirement. After stopping work at 60 the plan sits in the 12% bracket. It converts about $66,500 in the first year and $44,209 in the second, filling the bracket each time, then $5,700 to $7,750 a year until Social Security starts at 67. By 92 the traditional balance is gone and everything left is Roth. Over the whole life the plan converts $178,254 and pays $615,976 in income tax.
Your numbers will differ. The best mix depends on your pay, your spending, your match and how many years remain until you stop working, which is why the tool re-solves the whole plan for your inputs.
Related tools
Already retired, or within a few years of it? The Roth conversion optimizer plans conversions and withdrawals from your current balances. This page uses the same engine and adds the working years in front of it. For single-year numbers, see the retirement withdrawal tax calculator and the IRMAA calculator.
Frequently asked questions
Should I do Roth or traditional 401(k)?
It depends on whether your tax rate is higher now or later, and that is a year-by-year question rather than a one-time choice. Traditional contributions save tax at today's marginal rate and are taxed when you take the money out. Roth contributions are taxed now and come out tax-free. This calculator solves the question for your whole life at once: for every working year it picks how much goes to the traditional 401(k), Roth 401(k), IRA, HSA and a taxable brokerage account, then plans conversions and withdrawals in retirement. In the worked example above (single, age 35, $110,000 salary) the best plan is a blend, with about 61% of employee contributions going to Roth, and it beats always-traditional by $154,499 and always-Roth by $224,521.
Should I choose Roth or traditional if I retire early?
Retiring early often creates several low-income years before Social Security and required distributions start, and those years can be taxed in the 10% or 12% brackets. That favors traditional contributions while your income is high, followed by conversions to Roth in the low-income gap. The optimizer models those retirement years, so it finds this trade on its own: set your retirement age and spending and compare. In the worked example, retiring at 60 puts the plan in the 12% bracket while the working years sit in the 22% bracket, and the last eight working years go entirely to the traditional 401(k). Before age 59½ the model also applies the 10% early-withdrawal penalty rules for Roth withdrawals, but it does not model 72(t) payments or the Rule of 55.
Does the employer match change the answer?
Yes, in two ways. First, a match is free money, so the optimizer contributes enough to capture it whenever that is worth doing; enter it as tiers, such as 100% of the first 3% of pay and then 50% of the next 2%. Second, the match normally lands in a traditional account even when your own contribution is Roth, so it adds pre-tax money to your balance and can tip your own contributions toward Roth. If your plan pays the match into a Roth account, tick that option under Advanced and it is treated as taxable pay.
What if I have kids?
Add their birth years under Advanced. Each child under 17 earns the $2,200 child tax credit (2026), which phases out above $200,000 of income for single filers and $400,000 for married couples. A single parent also files as head of household while a child is under 19, which brings wider brackets and a larger standard deduction. Because the credit and the brackets change what each deduction is worth, children can shift the best mix. Childcare, 529 plans and college costs are not modeled; include them in your spending.
Is the backdoor Roth included?
Yes, and it is on by default. With it on, the optimizer can put the full IRA limit into a Roth IRA at any income by contributing after tax and converting. It assumes you have no other pre-tax IRA money, because the pro-rata rule is not modeled; if you do, turn the backdoor off and the direct Roth IRA limit is reduced by the income phase-out. Tick the exact phase-outs option to apply the Roth IRA, IRA deduction and child tax credit phase-outs to the income the plan actually produces; it is slower because the model becomes a mixed-integer program. The mega-backdoor (after-tax 401(k) contributions) is not modeled.
How is this different from other Roth vs traditional calculators?
Most Roth vs traditional calculators compare one flat tax rate now against one flat rate in retirement and assume every dollar goes one way. Real tax brackets are stair steps, and the best answer changes from year to year: your income rises, children arrive and leave, you may have low-income years after you stop working, and Social Security and required minimum distributions stack on top later. This calculator optimizes every year: how much goes to each account, then later conversions, RMDs and withdrawals, against the actual federal brackets. It then re-solves the plan with every contribution forced to traditional and again forced to Roth, so you can see what the mix is worth in dollars. Both of those comparison runs still optimize conversions and withdrawals afterward.
What about the HSA, and what happens to money that doesn't fit in an account?
You choose which accounts you have and the solver decides how much goes into each. If you select an HSA, contributions up to the limit (self-only or family, plus the 55+ catch-up) are available until 65, and the dollars are treated as tax-free money spent on medical costs. Paycheck HSA contributions also skip the 7.65% payroll tax unless you turn that off. Anything left after limits, spending and tax goes to a taxable brokerage account, which is taxed on its gains when sold.
What isn't included in this calculator?
Not modeled: self-employed plans such as the solo 401(k) and SEP IRA, after-tax (mega-backdoor) 401(k) contributions, spouses of different ages, Social Security spousal and survivor rules, the pro-rata rule for the backdoor Roth, 72(t) payments and the Rule of 55, dividend and interest tax drag, and local income taxes. State tax is either one flat rate or the real brackets of the state you choose, prefilled and editable. The IRMAA Medicare surcharge and the 3.8% net investment income tax can be switched on under Advanced. It uses one real rate of return for every account and 2026 federal tax law held constant in today's dollars. Treat the output as a starting point to bring to a CPA or financial planner, not a final plan.