There's a concept in retirement planning called tax diversification. The idea is that by contributing to various tax-advantaged accounts, you can gain better control over your taxes both today and in retirement.

There are several different retirement accounts you may be able to use, and each has its own unique tax treatments and withdrawal rules. Using just three retirement savings accounts -- a traditional 401(k), a Roth IRA, and a health savings account -- can provide a very flexible set of assets in retirement.

Couple relaxing on the beach at sunset.

Image source: Getty Images.

1. Traditional 401(k) and/or IRA

Many people have access to a 401(k) at work. The big draw of the 401(k) is the employer match. That's money your employer will add to your account just for saving in the 401(k) plan. There's no better return on investment than that!

Contributions to a traditional 401(k) are tax deferred. That means you don't pay income taxes on that money today, but you'll pay income taxes on your withdrawals. You also won't pay any taxes on dividends or capital gains.

The contribution limits on a 401(k) are huge. Employees can defer up to $20,500 of their paycheck in 2022. The employer contribution goes on top of that. Then some plans allow employees to max out the 401(k) with non-Roth after-tax contributions, with a total contribution limit of $58,000. If you're 50 or older, you can contribute an extra $6,500.

I've lumped in a traditional IRA here, because most people will benefit from eventually rolling over their 401(k) to an IRA. IRAs offer more investment choices than most 401(k) plans, and most providers don't charge any fees.

2. Roth IRA

A Roth account works the opposite way of a traditional retirement account. Instead of deferring taxes until retirement, you pay taxes in the year you make a contribution. In exchange, you won't have to pay any taxes on your distributions in retirement.

The Roth IRA is particularly useful as a supplement to a 401(k) if you exceed the income limits for contributing to a traditional IRA. That would be $78,000 in adjusted income for an individual or $129,000 for a married couple.

It's also useful if you're able to make after-tax contributions to your 401(k) and perform an in-service withdrawal to a Roth IRA. That's called the mega-backdoor Roth.

The limit for direct contributions to a Roth IRA is $6,000 per year. There's an additional $1,000 catch-up contribution limit for those 50 and older.

3. Health savings account

Health savings accounts (HSAs) are designed to help people with high-deductible health plans pay for medical care. HSA contributions are exempt from taxes in the year they're made. If you make the contribution directly through your payroll, you can avoid FICA tax as well (although it reduces your Social Security wages). When you use the funds to pay for qualified medical expenses, the withdrawals don't incur any taxes, either.

But there's no rule that you have to withdraw funds at the time of a medical expense. You can hold onto your receipts for years, allowing your money to grow in the HSA, before you decide to make the withdrawal. Then you can withdraw funds tax-free in retirement.

If you don't have any qualified medical expenses, you can start withdrawing funds at age 65 without penalty, but you'll have to pay income tax on the distribution.

Putting it all together

The beauty of holding all of these accounts is that you can exercise more control over your taxes in retirement.

For example, if you build a giant nest egg in a 401(k), you can make systematic Roth IRA conversions early in retirement. The benefit is by lowering your traditional 401(k) or IRA balance, you'll reduce your required minimum distributions later in retirement. And when you start collecting Social Security, you'll be able to draw more from your Roth account, which won't impact the taxability of your benefits.

Ideally, you'll eventually have enough money in your Roth and HSA accounts in retirement that you can exercise full control over just how much you'll pay in taxes during retirement. And while you might not be able to pay $0 in taxes on your retirement accounts, you can keep your tax burden substantially lower by taking advantage of different accounts.