HSA contributions and withdrawals are taxed differently depending on what you use the money for

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 pay 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 depends entirely on three things: whether the contribution came from your paycheck (pre-tax) or your own money (potentially deductible), whether the withdrawal is for a may have access to medical expense, and your age or health status at the time of withdrawal. Get these right and an HSA is one of the most tax-efficient ways to save for healthcare. Get them wrong and you owe taxes and penalties on money you thought was sheltered.

Key Takeaways

  • Contributions to an HSA reduce your taxable income whether they come from your paycheck or you deposit them yourself, as long as you are covered by a high-deductible health plan.
  • Withdrawals for may have access to medical expenses—doctor visits, prescriptions, dental work, vision care, and many other healthcare costs—are never taxed.
  • Withdrawals for non-medical expenses are taxed as ordinary income plus a 20% penalty, with limited exceptions for people over 65 or those who become ineligible for an HSA.
  • Investment earnings inside an HSA grow tax-free and are not taxed when withdrawn for may have access to medical expenses, but are taxed if withdrawn for other reasons.
  • You must keep receipts and records showing that each withdrawal was for a may have access to expense; the IRS can audit HSA withdrawals years after they occur.

How contributions reduce what you owe in taxes

If your employer deducts HSA contributions from your paycheck before taxes are calculated, that money never shows up on your W-2 as income. You do not pay federal income tax, Social Security tax, or Medicare tax on it. This is the most common path and requires no action on your part beyond enrolling in the HSA when your employer offers it.

If you contribute your own money to an HSA—by depositing a check or transferring funds yourself—you can deduct that contribution on your tax return, up to the annual limit set by the IRS. For 2024, the limit is $4,150 for individual coverage and $8,300 for family coverage. You claim the deduction on Form 8889 when you file your taxes. Either way, the contribution reduces your taxable income dollar for dollar.

This tax deduction applies only if you are covered by a high-deductible health plan (HDHP) on the date you make the contribution. If you drop the HDHP mid-year, you can only deduct contributions made while you were enrolled. If you contribute after the year ends, you have until the tax filing deadline (usually April 15) to make that contribution and claim it on that year's return.

may have access to medical expenses are never taxed when withdrawn

The IRS maintains a list of may have access to medical expenses. The broad categories include doctor visits, hospital care, surgery, prescription drugs, dental work, vision care (including glasses and contacts), hearing aids, and medical equipment like crutches or wheelchairs. Mental health treatment, including therapy and psychiatric medication, counts. So do many over-the-counter items: pain relievers, antacids, allergy medicine, and first-aid supplies all may have access to if you have a prescription or a doctor's recommendation.

You can withdraw money from your HSA to pay for these expenses without owing any tax on the withdrawal, even if the money in your account has grown through investment earnings. The earnings themselves are tax-free when used for may have access to expenses. This is the core tax advantage of an HSA: you get a deduction going in, tax-free growth while the money sits there, and tax-free withdrawal when you use it for healthcare.

Expenses that do not may have access to include cosmetic surgery (unless it is reconstructive after an injury or illness), over-the-counter drugs without a prescription, gym memberships, vitamins, and most dental work that is purely cosmetic. Long-term care insurance premiums may may have access to under specific rules. If you are unsure whether an expense qualifies, the IRS publishes Publication 502, which lists hundreds of specific items and services.

Non-medical withdrawals trigger taxes and a 20% penalty

If you withdraw HSA money for something other than a may have access to medical expense, you owe income tax on the full amount of the withdrawal at your ordinary tax rate, plus a 20% penalty on top of that. If you withdraw $1,000 for a non-may have access to expense and your tax bracket is 22%, you owe $220 in income tax plus $200 in penalty, for a total of $420. The penalty applies to the withdrawal itself, not just the earnings.

This penalty is separate from income tax and is not waived simply because you did not know the expense did not may have access to. The IRS expects you to know the rules or to ask before you withdraw. If you make a mistake—for example, you withdraw money thinking a particular expense qualifies when it does not—you still owe the penalty unless you fall into a narrow exception.

The exceptions are: you are age 65 or older (the penalty goes away, but income tax still applies), you become disabled, or you are no longer covered by any HDHP. If you lose your high-deductible health plan coverage, you can withdraw the full HSA balance without penalty, though you still owe income tax on any non-may have access to expenses. If you die, your beneficiary can withdraw the balance without penalty, though they owe income tax on non-may have access to amounts.

Investment earnings inside an HSA are taxed only if misused

Many HSAs allow you to invest the balance in mutual funds, stocks, or other securities, similar to a 401(k). Any gains from those investments are not taxed while the money sits in the HSA. When you withdraw funds for a may have access to medical expense, you withdraw both your contributions and the earnings tax-free. This is a significant advantage over a regular savings account, where you would owe tax on the interest.

If you withdraw HSA funds for a non-may have access to expense, you owe income tax on the earnings portion of that withdrawal, plus the 20% penalty applies to the entire withdrawal (contributions and earnings combined). For example, if you withdraw $2,000 that consists of $1,500 in contributions and $500 in investment gains, and the withdrawal is non-may have access to, you owe income tax on the full $2,000 plus a 20% penalty on the full $2,000.

The earnings are taxed at your ordinary income tax rate, not at capital gains rates. This is different from a brokerage account, where long-term capital gains might be taxed at a lower rate. The HSA structure prioritizes tax-free growth for healthcare spending, not investment returns.

Record-keeping and IRS audits of HSA withdrawals

You are responsible for keeping receipts and documentation showing that each withdrawal was for a may have access to medical expense. The HSA custodian (your bank or investment firm) does not verify this; they simply process the withdrawal. The IRS can audit your HSA years after a withdrawal occurs and ask you to prove that the money was spent on may have access to expenses. If you cannot produce documentation, the IRS can assess taxes and penalties retroactively.

Keep the receipt or invoice from the healthcare provider, the pharmacy, or the medical supplier. If you paid out of pocket and then reimbursed yourself from the HSA later, keep both the receipt for the original expense and documentation showing when you withdrew the money. If the expense was paid by insurance and you withdrew HSA funds to cover your out-of-pocket cost (copay, coinsurance, or deductible), keep the explanation of benefits from your insurance company showing what you owed.

The IRS does not require you to submit receipts when you file your tax return, but you must have them available if audited. Many HSA custodians now offer tools to photograph and store receipts, or you can keep them in a folder or spreadsheet. The longer you hold the HSA, the more important this record-keeping becomes, because the IRS can go back multiple years in an audit.

State income tax treatment varies by location

Most states follow federal tax law and do not tax HSA contributions or may have access to withdrawals. However, a few states tax HSA contributions or do not recognize the federal deduction. New Hampshire and Tennessee tax investment earnings inside an HSA, even if the withdrawal is for a may have access to expense. California does not allow the federal HSA deduction on state returns, meaning contributions reduce your federal taxable income but not your California state income.

If you live in one of these states, your HSA is still valuable, but the tax benefit is smaller than in other states. Check your state's tax authority website or ask your HSA custodian whether your state has special rules. If you move to a different state, the HSA rules do not change—your account continues to operate under federal law—but your state tax liability may shift.

Frequently Asked Questions

Do I have to report my HSA on my tax return?

If you contribute your own money to an HSA, you report the contribution on Form 8889 and claim it as a deduction. If your employer deducts contributions from your paycheck, they report it on your W-2 and you do not need to claim it separately. You do not report may have access to withdrawals. If you make non-may have access to withdrawals, you report them on Form 8889 as well.

What happens if I withdraw money from my HSA and later find out it was not a may have access to expense?

You owe income tax on the withdrawal plus a 20% penalty. You cannot go back and "undo" the withdrawal or reclassify it. If you discover the mistake before filing your tax return, you can file Form 8889 correctly and pay the taxes and penalty. If you discover it later, you may owe additional interest on top of the tax and penalty.

Can I use my HSA to pay for my spouse's medical expenses?

Yes. You can withdraw HSA funds to pay for may have access to medical expenses of your spouse or your dependents, even if they are not covered by your high-deductible health plan. The expense must still be a may have access to medical expense; the rule is about who receives the care, not who owns the HSA.

If I turn 65, can I withdraw HSA money for anything without penalty?

At 65, you can withdraw HSA funds for non-medical expenses without the 20% penalty, but you still owe income tax on those withdrawals. Withdrawals for may have access to medical expenses remain tax-free. This makes an HSA function like a traditional IRA after age 65, except that may have access to medical expenses are always tax-free.

Does my HSA balance carry over to the next year?

Yes. Unlike a flexible spending account (FSA), an HSA has no "use it or lose it" rule. Money you do not spend in one year stays in the account and can be withdrawn in future years. This is why record-keeping matters: you might withdraw money in 2026 for an expense you paid in 2024, and you need to prove the original expense occurred.