Please ensure Javascript is enabled for purposes of website accessibility

HSA vs. 401(k): Compare and Contrast

You don't have to choose one or the other.

By Kailey Hagen – Updated Jan 9, 2023 at 8:07PM

Saving for retirement is only half the battle -- you also have to pick the right accounts. A 401(k) is specifically designed for retirement savings, whereas a health savings account (HSA) is intended for medical savings, although it has appealing perks for retirement savers as well. Below, we'll look at some of the pros and cons of each type of account so you can decide which one is best for you.

An infographic comparing the similarities and differences between HSA and 401(k) plans.
Image source: The Motley Fool.

How a 401(k) works

A 401(k) is a common type of employer-sponsored retirement plan. You elect to defer a portion of each paycheck, and your employer transfers these funds automatically into your 401(k). In some cases, your company may even match your contributions.

In 2023, you may contribute up to $22,500 to a 401(k), or $30,000 if you're 50 or older. In 2022, these amounts are $20,500 and $27,000, respectively. Often you're limited to only a few investment options preselected by your employer. Sometimes the 401(k) may incur high fees that eat into your profits, although this isn't always the case.

Most 401(k)s are tax-deferred, which means your contributions reduce your taxable income for the year, but you pay income taxes on your withdrawals later. Roth 401(k)s are becoming more popular, and these work the opposite way -- you pay taxes on your contributions, but then you get tax-free withdrawals.

You may borrow money from your 401(k) and roll your account over into a new 401(k) or an IRA if your plan allows it. Some plans permit rollovers only if you're no longer employed at the company. While you can't directly transfer funds from a 401(k) to an HSA, you can do so indirectly by first transferring your 401(k) funds to an IRA and from there moving them to an HSA.

You're allowed to roll over only up to your annual HSA limit (discussed below), and you can do an IRA-to-HSA rollover only one time in your life. You must be eligible for an HSA at the time of the rollover and remain eligible for at least 12 months afterward.

How an HSA works

Health savings accounts (HSAs) were primarily designed to help people cover their medical expenses, but they're well-suited for retirement savings, too. To open an HSA, you must have a high-deductible health insurance plan. In 2023, that's defined as one with a deductible of $1,500 or more for an individual ($1,400 in 2022), or $3,000 or more for a family ($2,800 in 2022).

Some employers offer HSAs as an employee benefit. In this case, the account works similarly to your 401(k): You elect to defer a percentage of your income, which comes directly out of your paycheck. If your company doesn't offer an HSA, but you have a qualifying health plan, you can still open and contribute to an HSA yourself.

In 2023, individuals may contribute up to $3,850 ($3,650 in 2022), whereas families may contribute up to $7,750 ($7,300 in 2022). Adults 55 and older may make an extra $1,000 in catch-up contributions. Some companies even offer an HSA match, but these are less common than 401(k) matches.

A basic HSA is essentially like a savings account. You put money in, and it earns a small amount of interest annually. However, an increasing number of HSAs enable you to invest your funds just like 401(k)s. This can help you increase your savings much faster. If you open an HSA on your own, you'll have greater control over your investment options and how much you're paying in fees.

HSA contributions reduce your taxable income for the year, just like tax-deferred 401(k) contributions. But if you use the money for medical expenses, you don't pay taxes on your withdrawals at all. You can also make non-medical withdrawals, but you'll pay a 20% penalty plus taxes if you do so before age 65. After 65, non-medical withdrawals carry no penalty, but you still owe taxes on them. 

You cannot borrow money from an HSA or transfer it to any account other than another HSA. And while you're allowed to continue using your HSA funds after you no longer have a qualifying health insurance plan, you may no longer make new contributions to the account.

Related Retirement Topics

You don't have to choose

Great news: It's possible to contribute to both a 401(k) and an HSA in the same year. If you max one out, you can switch to the other type of account. But where should you start?

If you're getting a company 401(k) match, you should definitely contribute at least enough to your 401(k) to get the full match before putting money anywhere else.

Also consider how you intend to use the funds. If you want money you can tap at any time for medical emergencies, an HSA is a better choice. You can make hardship withdrawals from a 401(k) for medical expenses, but you'll have to pay taxes on them. On the other hand, if you're just saving for retirement or you want the freedom to transfer your funds to an IRA later, a 401(k) could be a better choice.

Finally, consider which account will give you the most tax benefits. An HSA is taxed in essentially the same way as a 401(k), except it also includes tax-free medical withdrawals, so in that sense, the HSA wins. But if you believe paying taxes up front with a Roth 401(k) will save you more money overall than paying taxes later in retirement, you may prefer to start with your Roth 401(k) and switch to an HSA after you've maxed out your 401(k).

Of course, your circumstances might limit you to one account or another. If your company doesn't offer both types, each offers great benefits.

Both accounts have their pros and cons, but everyone's situation is different and yours could vary from year to year. By reviewing the information above, you should be able to determine which makes the most sense for you right now.

The Motley Fool has a disclosure policy.

Invest Smarter with The Motley Fool

Join Over Half a Million Premium Members Receiving…

  • New Stock Picks Each Month
  • Detailed Analysis of Companies
  • Model Portfolios
  • Live Streaming During Market Hours
  • And Much More
Get Started Now

Related Articles

Motley Fool Returns

Motley Fool Stock Advisor

Market-beating stocks from our award-winning analyst team.

Stock Advisor Returns
S&P 500 Returns

Calculated by average return of all stock recommendations since inception of the Stock Advisor service in February of 2002. Returns as of 03/24/2023.

Discounted offers are only available to new members. Stock Advisor list price is $199 per year.

Premium Investing Services

Invest better with The Motley Fool. Get stock recommendations, portfolio guidance, and more from The Motley Fool's premium services.