Tool · Investor Sam Health

HSA vs Taxable Account Calculator

June 30, 2026 • By the Investor Sam Editorial Team • Reviewed by Berly Sam Varghese, Editor
A Health Savings Account is the only account in the U.S. tax code that is triple tax-advantaged: contributions go in pre-tax, the money grows tax-free, and qualified medical withdrawals come out tax-free. A regular taxable brokerage account gives you none of those breaks — you fund it with after-tax dollars and pay tax on dividends and gains along the way. This calculator grows the same yearly savings in both accounts so you can see, in real dollars, how far ahead the HSA pulls over time. Because you will have medical costs in retirement anyway, an HSA used as a stealth retirement account is one of the most efficient places a long-term saver can put money.

Example: Annual contribution: 4000 $ · Expected annual return: 7 % · Years invested: 20 · Your marginal tax rate: 24 % · Annual tax drag on the taxable account: 0.5 %

HSA advantage$45,953
HSA ending value$163,982
Taxable account ending value$118,029

Worked example

Put $4,000 a year into an HSA earning 7% for 20 years and it grows to about $163,982, because nothing is taxed along the way. Save the same $4,000 in a taxable brokerage account and two frictions eat into it: you fund it with after-tax dollars (so only about $3,040 of each $4,000 actually goes in at a 24% marginal rate) and a 0.5% annual tax drag on dividends and gains lowers the effective return to 6.5%. That taxable account ends at roughly $118,029. The HSA finishes about $45,953 ahead — the price of taxes on the exact same savings and the exact same market return.

Frequently asked questions

Why does the HSA end up so far ahead?

Three tax breaks compound at once. Your contribution is pre-tax, so more money starts working from day one; the growth is never taxed as it compounds; and qualified medical withdrawals are tax-free. A taxable account loses to income tax on the way in and a yearly drag on dividends and realized gains on the way through, and both frictions compound over decades.

What is the tax drag on the taxable account?

Even a buy-and-hold index investor pays tax each year on dividends and any realized capital gains, which quietly lowers the compounding rate. That annual leak is the tax drag — commonly a few tenths of a percent to over 1% depending on the fund and your bracket. The HSA has zero drag, which is why a small percentage difference turns into thousands of dollars over 20 years.

Do I have to spend HSA money on medical costs?

To keep withdrawals tax-free, yes — but the definition is broad, and the typical retiree faces large lifetime medical and long-term-care costs anyway. You can also pay out of pocket now, save the receipts, and reimburse yourself tax-free years later. After age 65 you can withdraw for any reason and simply pay ordinary income tax, which makes the HSA behave like a traditional IRA at worst.

Is an HSA better than a 401(k) or IRA?

For money you will spend on healthcare, the HSA is the most tax-efficient account there is because qualified medical withdrawals are tax-free, which no 401(k) or traditional IRA offers. A common priority is to capture any 401(k) employer match first, then max the HSA, then return to the 401(k) or IRA. This tool isolates the HSA-versus-taxable gap; the match changes the ranking against a 401(k).

What return should I enter?

Use a long-run expected return for how the money is actually invested. A diversified stock-heavy portfolio has historically returned roughly 7% after inflation, while cash sitting in the HSA's default sweep earns almost nothing. The advantage this tool shows only appears if you invest the HSA balance rather than leaving it uninvested.

💎
InvestorSam.com
Stock analysis, market insights & portfolio research — free
Ready to put these numbers to work?
Get stock picks, earnings analysis, and market commentary from Investor Sam.
Visit InvestorSam.com →

Sources

Berly Sam Varghese · Editor, Investor Sam

Berly Sam Varghese is an engineer who treats money the way he treats any hard problem — something to be engineered, not gambled on. He funded years of education and built real financial stability the patient way, by living below his means and investing rather than borrowing. He writes for the person staring at a medical bill they don’t yet know how to cover. He reviews and approves every article on Investor Sam and checks the figures against primary sources before anything is published. More about our standards.