A health savings account (HSA) lets you save money in a tax-advantaged account and then withdraw cash tax-free to pay for qualified medical expenses. Often, the money is used while you're working. But you can also use your HSA in retirement to help lower your out-of-pocket medical costs then. Doing so could help stretch your retirement savings, too.

"While no one can predict what their health care costs will be in the future, we estimate that health care costs will rise 4% annually, so the numbers can get daunting pretty fast," says Kevin Webber, a wealth adviser at Heritage Financial in Westwood, Mass. "HSAs can give clients some control over their tax bill when deciding how to pay those health-related costs."

A definition of HSAs

In 2021, you can put up to $3,600 in pre-tax money ($4,600 if you're 55-plus and $7,200 for a family or $8,200 for a family if you're 55-plus) in an HSA. Earnings from its investments aren't taxed; neither are withdrawals for qualified medical expenses. But to qualify for one, you must have a high-deductible health insurance plan — one with a minimum deductible of $1,400 for an individual or $2,800 for a family.

Before age 65, if you use HSA money for a non-qualified medical expense, you'll owe a 20% tax penalty on the amount of your withdrawal and the money you take out for that expense will be taxed as ordinary income.

You can't continue contributing to an HSA once you're on Medicare; if you do, you'll owe tax penalties.

After you die, your spouse or partner can inherit your account and turn it into their own HSA. But any money your children inherit from your HSA will be fully taxable.

Some 30 million Americans are using HSAs, says Jon Robb, senior vice president at Devenir, an HSA investment firm based in Minneapolis. On average, HSA holders older than 50 had an average HSA balance of over $4,300 in 2020. According to Fidelity Investments, the average HSA owner holds over $8,900 in it at age 65 and $8,400 at 70.

Although that's a drop in the bucket compared with the estimated $300,000 the average 65-year-old couple will need for health care, it's a nice start.

Here are five ways you can use an HSA during retirement:

1. Help bridge the gap to Medicare

Say you're 63½ and lose your job or decide to stop working before turning 65. You might not have access to retiree health coverage then, but could be able to stay on your old employer's plan under the federal COBRA law for up to 18 months.

If so, you could use your HSA to pay for those premiums and even health insurance premiums while receiving unemployment compensation.

"Utilizing an HSA in the pre-Medicare scenario can help save on taxes," says Webber. "I have a number of clients using their HSAs to pay current health care expenses. This affords them the opportunity to delay tapping into their IRAs or 401(k)s to pay for medical premiums or expenses. Then, when they are in a lower tax bracket, they can convert some of their retirement savings into a Roth IRA to help reduce taxes on future withdrawals."

Here's an example Webber offers: "One of our clients, a software engineer, and his wife, a teacher, retired in their mid-60s and used their HSA to pay for his Medicare Part B premiums. Using the HSA was the right move because her teacher's retirement pension was generous enough to place them in the 22% marginal tax bracket. Spending down the HSA allowed them to avoid taking IRA distributions to pay for Medicare, which would have been heavily taxed."

2. Pay regular medical bills

Unless you're still covered by an expensive corporate health care plan, you may be paying for vision, hearing aids and dental work from your personal savings; Medicare doesn't cover those, but you can use your HSA money for them.

Other common covered expenses for HSAs include acupuncture, blood pressure monitors, chiropractic bills, ambulance fees, diabetes supplies, non-cosmetic elective surgery and some types of medical equipment.

3. Prepare for long-term care expenses

HSAs can also cover a portion of long-term care costs but can only pay a limited amount toward a long-term care insurance policy's premiums. For example, if you are 61 to 70, up to $4,520 can be used; up to $5,640 if you're older. Any premium amounts above those numbers are not considered medical expenses.

Former employee benefits consultant Nancy Helt, of Hingham, Mass., uses her HSA to help pay for future long-term care expenses, but not for long-term care insurance.

"Working with my financial adviser, we opted not to purchase long-term care insurance because the cost versus benefit available at the time did not seem to make sense," says Helt. "I'm invested in several low-cost index funds within my HSA, which will hopefully continue to grow over the next 15 to 20 years. At that point, I may have to use those funds and other retirement income sources to pay for long-term care, live-in help or home health aides for my husband or even for me."

4. Help cover Medicare premiums

You can use your HSA to pay certain Medicare expenses, too, including premiums for Medicare Part A, Part B, Part C (Medicare Advantage) and Part D prescription drug coverage. But you can't tap an HSA for supplemental or Medigap policy premiums.

5. Pay for personal expenses

Here's one of the tantalizing secrets of an HSA: Once you enroll in Medicare, you can also use an HSA account to pay for any nonqualified medical expenses, like home renovations You don't have to pay state or federal taxes for such expenditures, but you do have to pay taxes on your investment gains for them.

This article originally appeared on NextAvenue.org.