When you're envisioning retirement, chances are you imagine spending your money on trips around the world or spoiling your grandkids.

But while that may be the dream, it's not the reality for millions of retirees. Instead, much of their retirement nest egg is spent on an unavoidable expense that isn't nearly as much fun. 

That expense: healthcare costs. Sadly, far too few people plan for it, and failing to do so could be a major mistake. 

Doctor talking with older male patient.

Image source: Getty Images.

Most Americans don't factor healthcare into their retirement goals, and that's a big problem

Although Medicare covers some healthcare costs for seniors, the gaps in this popular program are huge. That means retirees can expect large out-of-pocket expenses.

A recent report from the Employee Benefit Research Institute (EBRI) found a senior couple could need as much $325,000 to have a 90% chance of covering their out-of-pocket costs including Medicare premiums and prescription drugs. 

Most people planning for retirement don't know that or haven't prepared for it. A different EBRI study found less than a third of Americans have planned for covering healthcare costs in retirement.

If you don't take into account this huge expense, you could end up quickly draining your nest egg. 

How to save for retirement healthcare costs 

Saving for the healthcare you need in retirement isn't something that can wait. You need to begin preparing for your future medical needs as early as possible. 

The best way is a health savings account (HSA). These special tax-advantaged accounts enable you to invest with pre-tax dollars and make tax-free withdrawals (as long as the money is used for qualifying medical care). By contrast, retirement savings accounts, such as 401(k)s and IRAs, don't offer tax breaks on both ends. You either get to invest with pre-tax dollars but pay taxes on withdrawals in traditional retirement accounts or invest with after-tax money and benefit from tax-free withdrawals in Roths. 

Unfortunately, not everyone can save in an HSA because these accounts are only open to people with qualifying high-deductible health plans. If you aren't eligible, you'll have to save more in your other accounts to fund your future care.

To make sure you have enough, you could use your 401(k) to save for other retirement costs and open a dedicated IRA earmarked for medical needs. That way, you ensure you can cover healthcare without quickly draining the account you need to provide for your other expenses. 

Don't leave yourself unprepared for your future medical needs

Spending hundreds of thousands of dollars on healthcare throughout retirement isn't something anyone wants to do. But if that's your reality, the last things you need are financial issues compounding your health concerns.

By saving for medical care throughout your career, you can be prepared so your nest egg will cover any medical services you need.