If your health insurance plan leaves you eligible to participate in a health savings account, or HSA, then it pays to sign up and start making contributions. Every dollar you put into an HSA is a dollar of income the IRS will not be able to tax you on. Plus, you might really need the money for healthcare bills.

But if you're going to fund an HSA, your best bet is actually not to take withdrawals to cover your ongoing healthcare costs, but rather to leave that money alone as long as possible. Here's why.

A person at a laptop.

Image source: Getty Images.

You don't need to use up your HSA every year

Many people are familiar with flexible spending accounts (FSAs), which also let you allocate pre-tax dollars to healthcare spending. But with an FSA, you're required to use up your plan balance every year or risk forfeiting money.

HSAs don't work that way. With an HSA, you can carry your money forward indefinitely.

Not only that, but you're also allowed to invest the money in your HSA so that it grows into a larger sum over time. And you won't pay taxes on your investment gains, nor will you be taxed on withdrawals provided you're removing money for qualified medical expenses.

What this is means is that although you're allowed to tap your HSA when medical bills arise, it's even better to leave your HSA alone if you're able to cover those bills out of pocket. That way, you not only benefit from tax-free investment gains over time, but you can also reserve your HSA funds for retirement, when you might need them the most.

Don't underestimate the cost of healthcare in retirement

Many people assume that once they move over to Medicare, their healthcare bills will drop substantially. Often, the opposite holds true, and retirees wind up spending more on healthcare than they did during their working years.

Part of this is a function of aging. But part of it also stems from the many expenses Medicare enrollees face, like premium costs, co-insurance, and deductibles.

That's why it's such a good idea to leave your HSA alone during your working years if you can. If you're able to keep saving and investing that money, you might then end up with a large chunk to spend on healthcare in retirement -- a time when your income might drop compared to when you were working.

Fidelity estimates that the average couple aged 65 retiring in 2022 needs about $315,000 to cover their medical expenses during their senior years. The amount you'll need will depend on different factors, like the state of your health.

But if your retirement income is limited to Social Security benefits and modest withdrawals from a savings plan, then you might not have a lot of wiggle room to pay for healthcare. So having extra funds in an HSA could really come to your rescue.

Another thing you should know about HSAs is that once you turn 65, you can remove funds for any purpose without incurring a penalty. At a younger age, you risk being penalized on withdrawals taken for nonmedical purposes, but you get a lot more flexibility once your 65th birthday arrives.

So even if you end up in the very fortunate position of not having to spend so much money on healthcare as a retiree, rest assured that the money in your HSA can still be put to good use.