If you aren't planning for increased medical bills during your retirement, you may be in for a rude awakening. The average 65-year-old household will pay $67,260 in out-of-pocket medical expenses during the rest of their lifetimes, according to a study conducted by the Center for Retirement Research at Boston College.

That's what you'll have to pay even after paying your Medicare and any supplemental health insurance premiums. And if you're unfortunate enough to be in the top 10% of medical spenders, you'll have to come up with about $138,000 to cover your medical expenses.

If you plan for it, though, there can be a great way to cover those medical expenses in retirement.

A person in a white coat and stethoscope holding a piggy bank.

Image source: Getty Images.

This superpower of saving in an HSA

An HSA, or health savings account, is a special account available to individuals enrolled in certain high-deductible health insurance plans. The idea is that people on these plans need to save for their infrequent medical expenses, which may be substantial since they have very high deductibles. The government provides a tax incentive for them to save with the HSA.

Any contributions into an HSA are tax deductible in the year they're made. Furthermore, if you withdraw funds for qualified medical expenses, you won't pay any taxes on those either. And any interest or growth in the account goes untaxed as well. As a bonus, if you're able to contribute to your HSA through wage deductions at work, you can save on FICA tax as well.

HSAs are commonly used to pay for big medical expenses as they're incurred. But that doesn't have to be the case. If you can afford to pay for a medical expense with funds outside your HSA, you can leave the money there and withdraw it against that expense, tax and penalty free, at any point in the future.

You can invest the money in an HSA. If your current HSA provider doesn't have a brokerage option, you can move it to one that does. The longer you leave money in your HSA, the more time it has to grow with no tax liability. That's the superpower of using an HSA.

Planning for retirement medical expenses

HSA-eligible plans aren't for everyone. First, you have to be able to afford the high deductible. If you can't afford to cover the deductible when you have a medical emergency, you'll need a different insurance plan.

Second, the HSA-eligible plan has to be worth it for you. If you have regular medical expenses that a different insurance plan will cover, you may want to use that plan instead of a high-deductible plan.

But many people are healthy with no big medical expenses in their 20s and early 30s. That makes those years the perfect time to build a big HSA nest egg.

Someone who maxes out their HSA from age 26 (when they're pushed off their parents' insurance plan) to 35 will be in a great position to cover their medical expenses in retirement.

The contribution limit for an HSA in 2022 is $3,650. If a person diligently puts that money into an HSA at the start of every year starting from age 26 for the next 10 years, they'll have contributed $36,500 in total. (The IRS adjusts the contribution limit for inflation every year, but we'll ignore that.)

If that person earns an average of 5% on their contributions, they'll have about $46,000 by the time they turn 36. And if they continue to earn 5% on that account, they'll hit age 65 with nearly $200,000 in an HSA.

That should be enough to cover the vast majority of retirees' medical expenses. And if you've saved your receipts from all the medical expenses you incurred along the way, you can withdraw funds completely tax free based on those previous expenses and use them for other living expenses.

Of course, if you're already past 35, that doesn't mean you can't make the most of an HSA if you still have access to one. You'll still be able to make the most of the tax advantages offered by the account, even if you don't have enough to cover all your medical expenses in retirement. Just be sure you save enough outside your HSA to cover the increased medical expenses you can expect in retirement.