HSA versus traditional 401(k) or IRA
Whether the same pre-tax money is worth more in a health savings account or a traditional 401(k) or IRA once it is spent in retirement, with the federal and state tax on the traditional withdrawal figured for your state.
- Income kept after tax, the withdrawal from an HSA
- $54,000
- Income kept after tax, the withdrawal from a traditional plan
- $52,129
- Federal and state tax with the traditional withdrawal
- $1,871
- Either account in 25 years, before tax
- $190,908.41
- The same, in today’s dollars
- $102,974.20
- Assumed. The tax is figured on the first retirement year’s withdrawal and Social Security in today’s dollars, with no other income, under 2025 federal and state law, as if the brackets keep pace with inflation. Future law may differ.
- Provisional. Some 2025 constants are provisional and may change.
- Assumed. Both accounts get the same pre-tax money and the same return, so the difference is only the tax when it is spent. The tax each saves when it goes in is not compared: an HSA through payroll also avoids Social Security and Medicare tax, a 401(k) deferral does not, and a few states tax HSA contributions.
- Assumed. A year in retirement is the withdrawal you enter and your Social Security, in today’s dollars: from an HSA spent on medical expenses the withdrawal is not taxed; from a traditional plan it is.
How it works
The same yearly amount goes into each account at the end of every year and grows at the same return, rounded to the cent; the balance is then put in today’s dollars by dividing by (1 + inflation) for each year.
For one year in retirement, the federal and state tax is figured by the Form 1040 engine and your state’s engine on your Social Security with the withdrawal taxed, as from a traditional plan, and without it, as from an HSA spent on qualified medical expenses; what you keep is that year’s income less each. From 65 an HSA spent on anything else is taxed like the traditional plan.
Nothing you enter leaves your browser, and nothing is stored. The same calculator is available to AI agents as the tool calc_hsa_vs_traditional, in the page through WebMCP and at https://taxmath.org/mcp.
Sources
Put this calculator on your site
Paste this where the calculator should appear. Our script draws the calculator above the credit line, which is a plain link in your page. It is free, needs no signup and keeps nothing your readers type. Please keep the credit line. The embed page lists the options it takes.