Outside of housing and maybe transportation costs, healthcare will likely be your largest retirement expense. It's unfortunate, but doctor visits become more frequent, and more health problems tend to pop up as you age. Before reaching retirement age, understanding the likelihood of increased healthcare costs and planning accordingly is very important.

According to Fidelity, the average couple retiring at age 65 in 2022 will need roughly $315,000 saved after taxes to cover retirement healthcare expenses. Even for people able to save $1 million for retirement, $315,000 after taxes is a good portion of total savings. One way to help prepare for this is to take advantage of a health savings account (HSA) if you're eligible. 

Person jogging outside.

Image source: Getty Images.

Using an HSA for healthcare expenses

If you're enrolled in a high-deductible health plan (HDHP), you're eligible to contribute to an HSA, which is designed to help you save and invest pre-tax money to use for eligible medical, dental, and vision expenses. Not only does saving pre-tax money (or deducting contributions) lower your taxable income for the year, but the money in your HSA grows and compounds with tax-free withdrawals if used for eligible health expenses.

For 2022, the most you can contribute to an HSA is $3,650 if you're enrolled in a health insurance plan by yourself and $7,300 if you're enrolled in a family plan. People 55 and older can add an extra $1,000 to their annual contributions. If you're going to be spending money on medical expenses -- and you likely will -- you might as well save for them and get a tax break in the process.

With enough time, your HSA can carry the load

Imagine you're enrolled in an HDHP by yourself and contribute $300 monthly to an HSA, investing it in an index fund that returns, on average, 8% annually over 25 years. Over that time, you would have personally invested $90,000, but the investment would be worth over $263,100. If you have more time and can do it for 30 years at those returns, it would be worth over $407,800.

And since it's in an HSA, the money would be tax-free, compared to a regular brokerage account where you'd owe capital gains taxes on any profits made. That could potentially cost tens of thousands of dollars over time.

If you're enrolled in an HDHP family plan and able to contribute $600 monthly, you could surpass the estimated retirement healthcare costs in 20 years with 8% average annual returns. The one thing you want to be cautious of, however, is having too much of your HSA invested in stocks while you're close to retirement. The goal should always be to grow your money as much as possible while you're younger because you have time to bounce back from market downfalls, but as you get closer to when it's time to actually use your money, you don't want a scenario where stocks -- and your HSA value -- plunge with little time to recover before you need the money.

Using an HSA is a win-win situation: you'll get the present benefit of the tax break and the future benefit of money that's had time to grow and compound tax-free. Take advantage of it if you can.