As 2022 draws to a close, you may have unspent money in your health savings account (HSA). An HSA is a savings and investment account that you use to pay for healthcare in conjunction with a high-deductible health plan. But what if your medical expenses were relatively low this year? You may have contributed more than you needed for 2022.

If you're worried about that money going to waste, relax. Here's why you don't need to go on a shopping spree for HSA-eligible expenses before the year ends.

An adult helps a child put money in a piggy bank.

Image source: Getty Images.

What happens to unused HSA funds?

In 2022, you can contribute up to $3,650 to an HSA if you have self-only coverage or $7,300 for family coverage, provided that you have a high-deductible health plan. These amounts increase to $3,850 and $7,750 in 2023. If you're 55 or older, you can kick in an extra $1,000. Employer contributions count toward these limits, so if your company matches part of your contribution, the amount you can save out of pocket will be less.

But here's the beauty of an HSA: That money is yours forever. And an HSA offers triple tax advantages. The money is funded with pretax money. If you invest that money, it grows tax-free. Distributions are tax-free as well, provided that you take them for HSA-eligible expenses. You can keep that money stashed away and use it in a subsequent year if your medical expenses are higher.

And if you don't need the money for healthcare? Once you turn 65, you can withdraw your funds for any reason and avoid the 20% penalty that typically applies for nonmedical distributions. You'll only be on the hook for income taxes. That makes an HSA a good supplementary retirement account if you tend to have low medical expenses.

You could also withdraw the money tax-free at age 65 and use it to pay premiums for Medicare Part B, Part D drug coverage, or Medicare Advantage plans. That could mean you get to hold on to more of your Social Security checks.

Don't confuse an HSA with these accounts

This may seem obvious, but make sure you actually have an HSA. This can get confusing because there are a couple of similar accounts that you can use to pay for healthcare costs that don't allow you to keep the money forever.

A health reimbursement account (HRA) is an account some employers offer that lets you pay for medical expenses. But the account is funded solely by your employer, and your employer owns the funds. Your employer gets to set the rules, and it may not let you roll over the money from year to year. You'll typically forfeit the funds if you leave your job.

A flexible spending account (FSA) is another account that's similar to an HSA. You can use an FSA to save money for healthcare or dependent care on a pretax basis. Some employers contribute as well. But your employer keeps your FSA money if you leave your job, unless you opt for COBRA continuing coverage. 

Usually, you have to use FSA money within the plan year. However, your employer can voluntarily allow one of the following: a two-and-a-half-month grace period to spend FSA money for the plan, or a $610 carryover to the following plan year. 

Because HRA and FSA funds belong to your employer, you can't invest the money in either account. Be sure to check your employer's rules about carrying over funds from year to year. Otherwise, you could be leaving money on the table.

When should you spend your HSA money?

Because you can keep money in an HSA forever, there's no rush to spend that money before the year is over. The best time to spend that money is whenever you need it. If you only have minor medical expenses that you can easily pay for out of pocket, you may want to invest that money and let it grow.

But that money exists first and foremost for healthcare -- and your health is your most valuable asset. Make sure you keep enough cash on hand, either in your HSA or a savings account, so you can afford an unexpected medical bill. If you don't need the money in your HSA for healthcare, that money can fatten your retirement nest egg.