HSA contributions and withdrawals are taxed differently depending on what you do with the money
Money you put into an HSA is not taxed when it goes in. Money you take out to pay for may have access to medical expenses is not taxed when it comes out. But if you withdraw HSA funds for something other than a may have access to medical expense, you owe income tax on that withdrawal plus a 20% penalty — unless you are over 65, disabled, or no longer covered by a high-deductible health plan.
The tax treatment changes once you turn 65. After that, you can withdraw money for any reason without the 20% penalty, though non-medical withdrawals are still subject to income tax. This makes an HSA function like a traditional retirement account after age 65.
Investment earnings inside your HSA — interest, dividends, capital gains — are never taxed as long as the money stays in the account and you use it for may have access to medical expenses. If you withdraw those earnings for a non-may have access to expense before age 65, you owe tax on the earnings plus the 20% penalty.
Key Takeaways
- Contributions to your HSA reduce your taxable income in the year you make them, whether your employer contributes or you contribute yourself.
- Withdrawals for may have access to medical expenses — doctor visits, prescriptions, dental work, vision care, and many other costs — are never taxed.
- Withdrawals for non-medical expenses before age 65 trigger both income tax and a 20% penalty on the amount withdrawn.
- After age 65, you can withdraw HSA money for any reason without the penalty, but non-medical withdrawals are still taxed as ordinary income.
- Investment earnings inside the HSA are tax-free as long as you use the money for may have access to medical expenses.
How contributions lower your tax bill
When you contribute to an HSA, that money comes off the top of your taxable income. If you earn $50,000 and put $3,000 into an HSA, you report $47,000 as your income to the IRS. This works whether you contribute through payroll deduction (the most common route) or make contributions yourself.
Your employer's contributions to your HSA also reduce your taxable income, and they do not count toward the annual contribution limit that applies to your own contributions. If your employer puts $1,500 into your HSA and you put in $2,000, you have contributed $3,500 total, and all of it is deducted from your taxable income.
The contribution limit changes each year. For 2024, the limit is $4,150 for individual coverage and $8,300 for family coverage. These limits are set by the IRS and typically increase slightly each year to account for inflation.
What counts as a may have access to medical expense
The IRS maintains a specific list of medical expenses you can pay with HSA money tax-free. The list is long and includes obvious costs like doctor visits, hospital stays, prescription medications, and dental and vision care. It also includes less obvious expenses: hearing aids, crutches, wheelchairs, insulin, and even certain over-the-counter medications if you have a prescription for them.
Expenses that do not may have access to include cosmetic procedures (unless medically necessary), most over-the-counter medications without a prescription, gym memberships, vitamins, and toiletries. Long-term care insurance premiums and certain long-term care services may may have access to, but the rules are narrow.
If you are unsure whether a specific expense qualifies, the IRS publishes Publication 502, which lists hundreds of may have access to and non-may have access to expenses. Your HSA provider may also have a tool to check specific items. When in doubt, keep the receipt and the prescription or medical documentation — if the IRS questions the withdrawal later, you will need proof that it was for a may have access to expense.
The 20% penalty for non-may have access to withdrawals before age 65
If you withdraw HSA money for something other than a may have access to medical expense before you turn 65, you owe income tax on the full amount plus a 20% penalty. That penalty is separate from the income tax, not a replacement for it.
Example: You withdraw $1,000 from your HSA to pay for a vacation. You owe income tax on that $1,000 at your ordinary tax rate (which might be 22%, 24%, or higher depending on your income). You also owe a 20% penalty, which is $200. Your total tax liability on that withdrawal is the income tax plus $200.
The penalty does not apply if you are over 65, disabled, or no longer covered by a high-deductible health plan. If you leave your HSA-may be able to access health plan and switch to a regular health plan, non-medical withdrawals after that point are still taxed as income but the 20% penalty no longer applies.
Tax treatment after age 65
Once you turn 65, the 20% penalty disappears. You can withdraw money from your HSA for any reason — a vacation, a car, groceries, anything — and you will not owe the penalty. You will still owe income tax on non-medical withdrawals, but the penalty is gone.
This makes an HSA similar to a traditional IRA or 401(k) after age 65. Many people use this feature to let their HSA grow as a retirement savings vehicle, withdrawing only for medical expenses while working and then using it more flexibly once they retire.
If you are on Medicare, you can still contribute to an HSA as long as you are covered by a high-deductible health plan. However, once you enroll in Medicare Part A, you can no longer make new contributions to an HSA, even if you are still working.
Investment earnings and how they are taxed
If your HSA balance is large enough, you can invest the money in mutual funds, stocks, or other securities. Any interest, dividends, or capital gains from those investments are not taxed while the money stays in the HSA.
If you withdraw the investment earnings for a may have access to medical expense, they are never taxed. If you withdraw them for a non-medical expense before age 65, you owe income tax on the earnings plus the 20% penalty. After age 65, you owe income tax on non-medical withdrawals but no penalty.
The cost basis of investments does not matter for HSA purposes. If you buy a stock for $1,000 and it grows to $2,000, you can withdraw the full $2,000 for a may have access to medical expense with no tax. If you withdraw it for a non-medical expense before age 65, you owe tax and the penalty on the full $2,000.
Reporting HSA activity to the IRS
Your HSA provider sends you a Form 1099-SA each year, which reports all distributions (withdrawals) from your HSA. You report this on your tax return. If you made non-may have access to withdrawals, you will also file Form 8889, which calculates the taxable portion and the 20% penalty.
Your employer reports contributions made through payroll deduction on your W-2 form, in Box 12 with code W. These contributions are already excluded from your taxable income, so you do not need to report them again on your return — they are already accounted for.
If you made contributions yourself (not through payroll), you report them on Form 8889 when you file your tax return. You can deduct these contributions even if you do not itemize deductions, which is one reason HSAs are valuable for tax purposes.
Frequently Asked Questions
Do I have to pay taxes on HSA interest and investment gains?
No, as long as the money stays in the HSA. Interest, dividends, and capital gains are never taxed while in the account. If you withdraw those earnings for a non-may have access to expense before age 65, you owe income tax on the earnings plus a 20% penalty. After 65, you owe income tax but no penalty.
What happens if I accidentally use my HSA debit card for a non-medical expense?
You owe income tax on that amount plus a 20% penalty if you are under 65. Report it on Form 8889 when you file your taxes. Some HSA providers allow you to reimburse the account within a certain timeframe to avoid the tax hit, so contact your provider immediately if this happens.
Can I deduct HSA contributions on my taxes if I did not contribute through payroll?
Yes. You report self-directed contributions on Form 8889, and they reduce your taxable income even if you do not itemize deductions. This is one of the few above-the-line deductions available to most taxpayers.
Do I owe taxes if I use my HSA to pay for my spouse's medical expenses?
No. You can use HSA funds to pay for may have access to medical expenses of your spouse and dependents, even if they are not covered by your health plan. The expense itself must be may have access to; the relationship to you does not change the tax treatment.
What if I have an HSA but switch to a regular health plan?
You keep the HSA and can continue to withdraw money for may have access to medical expenses tax-free. Non-medical withdrawals are still taxed as income, but the 20% penalty no longer applies because you are no longer covered by a high-deductible plan.