Saving for retirement is important, and the federal government has been kind enough to provide methods to build up retirement savings in ways that give you big tax breaks. Investment vehicles like IRAs and employer-sponsored retirement plans like 401(k)s are available and come with important perks, including tax-deferred growth while money remains in the account.

However, with most of these vehicles, you have to choose between saving on your taxes now and saving on them later. Contributing to a traditional IRA gives you a tax deduction now, but you have to pay taxes on withdrawals in retirement. A Roth IRA avoids tax in retirement, but at the cost of giving up that initial tax deduction on contributions.

But there's a third savings method that gives you the best of both worlds, letting you save on your taxes both now and later. Most people don't even think of health savings accounts as having anything to do with retirement, but with their tax benefits and the huge costs of healthcare in your retired years, thinking of HSAs as a long-term investment is a smart move.

Alarm clock, piles of coins, and jar labeled Retirement on a table in front of bushes.

Image source: Getty Images.

What is a health savings account?

Health savings accounts are tax-favored accounts designed to help you set money aside for medical expenses. Once you set up an HSA with a financial institution, you can either have money paid directly to medical professionals or make withdrawals to reimburse money that you've already paid for qualified expenses.

However, in order to open an HSA, you have to have primary insurance coverage that qualifies as a high deductible health plan. HDHPs require you to pay a higher amount annually as a deductible than an ordinary health plan would require, and they have specified maximum limits on deductibles and total out-of-pocket expenses due under the plan. HSA deductibles in 2019 must be at least $1,350 for coverage that includes only yourself individually, or $2,700 for family health insurance policies. Maximum out-of-pocket amounts for the year are $6,750 and $13,500, respectively.

The big tax benefits of HSAs

HSAs are unique in that they give you tax benefits both when you contribute and when you use the money. Money you put into the account is deductible on your tax return now, with limits of $3,500 for self-only coverage or $7,000 for family coverage in 2019. As an added bonus, your employer can also add money to your HSA, and it's not treated as taxable income.

Later on, when you need the money to cover medical expenses, you get another tax break. Withdrawals from HSAs aren't taxable as long as they're used for qualified costs. That includes not only the money you put in but also any income and gains that your investments produced while they were in the account. Given that qualified medical expenses include just about anything you can think of -- from doctor visits and prescription drug costs to hospital stays and nursing home costs -- it's rare for people to have much trouble finding ways to spend their HSA assets in retirement.

The two big challenges with HSAs -- and how to overcome them

With their benefits, you'd think HSAs would be more popular, but there are a couple of problems. The bigger one is that many employers don't offer health insurance plans that qualify as HDHPs, thereby closing off access to an HSA. However, more employers are looking at HSA options now, and lobbying your employer to join them could produce cost savings both for you and on what your employer spends for health insurance.

Also, even once you have coverage, opening an HSA at a financial institution isn't as easy as opening an IRA. Even top-name brokers and other institutions often don't offer HSAs at all, and some of those that do limit participation to employees of companies that are their clients for employee benefit plan administration. It's not impossible to find a good HSA investment, but it can take more work than you'd expect.

With their benefits, though, a little extra work to open a health savings account is worth it. With the opportunity to save on taxes both now and later, HSAs deserve your attention, and you'll want to take advantage of their favorable provisions if you can.