Planning for retirement helps ensure that you don't encounter financial issues during your later years. It's smart to set up a retirement budget to see what your recurring living expenses will look like, and whether your savings will cover them. But some expenses are easier to estimate than others, and if you misjudge what healthcare will cost, you could wind up in serious financial trouble.

The latest estimate isn't pretty

It's virtually impossible to pinpoint exactly how much you'll spend on healthcare during retirement, as injuries and illnesses will largely dictate your costs. But it helps to have a ballpark estimate, and Healthcare Services, a cost-projection software provider, just released a pretty shocking figure: A healthy 65-year-old couple retiring this year will spend $387,644 in today's dollars on healthcare throughout retirement. This number accounts for costs such as Medicare premiums; deductibles; prescription drugs; supplemental insurance (Medigap); and services not covered by Medicare, like dental, hearing, and vision.

Older man with surprised expression adjusting glasses

Image source: Getty Images.

There are a few things you should note about this estimate. First, it's meant to cover a healthy couple. If you have medical issues going into retirement, your costs could be even more substantial.

And this projection assumes an average life expectancy of 87 for males, and 89 for females; if you live longer, your total costs are likely to come in higher.

Finally, that $387,644 doesn't include long-term care, such as nursing homes and assisted living, so you'll need a backup plan (like long-term care insurance) to account for those.

Furthermore, the older you get, the more money you can expect to spend on healthcare on an annual basis. The average senior couple will spend $12,286 during their first year of retirement on Medicare premium costs and other out-of-pocket expenses. But at age 85, that yearly spend will have climbed to $34,268 (again, excluding long-term care).

All this boils down to one important takeaway: Healthcare in retirement will most likely cost you more than you expect. And if you don't save accordingly, you're apt to struggle later on.

How to save for healthcare

There are a number of tax-advantaged savings accounts designed to help you sock away money for retirement. For example, you can contribute to a 401(k) through work, or an IRA, and set aside money for any purpose. But if you're looking to save specifically for healthcare, you'd be wise to consider a health savings account, or HSA.

Not everyone qualifies for an HSA, but if you have a high-deductible health insurance plan -- defined, for the current year, as $1,350 for single coverage or $2,700 for family coverage -- you can fund an HSA and then invest that money for added growth. Unlike flexible spending accounts, HSAs don't make you spend down your plan balance each year. The whole point of an HSA is to accumulate funds in your account over time so you can pay for healthcare when retirement rolls around.

Currently, you can contribute up to $3,500 a year to an HSA as an individual, or up to $7,000 a year if you have family coverage. If you're 55 or older, you get a $1,000 catch-up on top of whichever limit applies to you.

The best part: HSA contributions go in tax-free, grow tax-free, and can be withdrawn tax-free provided they're used to pay for qualified healthcare expenses.

It's important to get a handle on what healthcare will cost in retirement, and then save for it adequately. By contributing to an HSA, you'll have funds earmarked for medical expenses, and that could make a huge difference during your golden years. If you don't qualify for an HSA, boost your IRA or 401(k) contributions to help tackle your senior healthcare costs as they arise.