Millions of seniors struggle to pay for healthcare during retirement, which is why saving for future medical expenses in a health savings account often makes sense. A health savings account, or HSA, is a hybrid savings and investment account earmarked for healthcare costs. HSAs are funded with pre-tax dollars, and that money can then be used to pay for qualified medical expenses that pop up immediately, as well as in the future. Any funds that aren't used, however, are invested for added tax-free growth. And all withdrawals are tax-free provided they're used for eligible healthcare expenses.

HSAs have long been regarded as a valuable retirement savings tool, since other than housing, healthcare often constitutes seniors' greatest expense. The problem with HSAs is that not everyone is eligible to participate.

To contribute to an HSA, you must be on a high-deductible health insurance plan, which is currently defined as $1,350 or more if you have coverage only for yourself, or $2,700 or more if you have coverage at the family level. As such, seniors who are enrolled in Medicare are barred from funding an HSA.

The problem, however, is that a lot of older Americans find that they're still working once Medicare eligibility kicks in at age 65, and as such, have the means to fund an HSA. But even those with jobs and health insurance through their employers often sign up for Medicare Part A, which covers hospital care, because it's free and serves as secondary insurance, thereby adding a layer of coverage. Doing so, however, takes HSAs off the table.

Even non-working seniors might opt to fund an HSA because of the tax savings involved. But being on Medicare removes that option.

Are HSA changes in the works?

In July, a bipartisan bill called the Health Savings for Seniors Act was introduced in the U.S. House of Representatives. The bill aims to make HSAs more accessible to seniors by allowing Medicare enrollees to participate. For the more than 57 million older Americans who currently get coverage under Medicare, that's a big deal.

As mentioned, HSA contributions are made with pre-tax dollars. The annual contribution limit for HSAs changes from year to year, but in 2019, you can put in up to $3,500 for individual coverage, or $7,000 for family coverage. Those 55 and over get a $1,000 catch-up on top of either $3,500 or $7,000. And all of that is money the IRS can't tax you on.

Health
In this studio shot illustration, an NHS uniform close up, with stethoscope on June 6, 2019 in London, England. Getty Images/Peter Dazeley

By expanding HSAs to allow participation among Medicare enrollees, more seniors will have the option to reap a potentially lucrative tax break. In fact, if the bill passes, the average household led by someone 65 or older earning roughly $48,000 (whether via a paycheck from a job or retirement income sources) could save $1,800 a year in taxes, or over $40,000 in taxes throughout retirement.

Now it's too soon to predict whether the bill will pass. But one thing's for sure: If you're currently eligible to participate in an HSA, do it. Not only do you get tax savings, but you also get the flexibility to carry funds from year to year and use your money as healthcare expenses arise. Carry an HSA balance long enough, and you might accrue enough money to largely cover the cost of healthcare during your senior years.

It's estimated that the average healthy 65-year-old couple retiring this year will spend $387,644 on healthcare throughout retirement. Having dedicated funds in an HSA to cover that expense will no doubt ease the burden, and if the rules change so that more seniors on Medicare can contribute to HSAs and enjoy the tax savings involved, even better.

This article originally appeared in the Motley Fool.

The Motley Fool has a disclosure policy.