There are a variety of accounts available to most investors to save for retirement. You can opt for a traditional 401(k) or IRA, Roth versions of those accounts, or stick with a regular taxable brokerage account. You might even use a tax-free HSA to save for retirement.

If you're planning for the long run, which retirement planners necessarily are, it's best to have money spread across all of those accounts instead of piled into one. Doing so will provide the most flexibility for your savings while providing the greatest opportunity to keep your taxes low in retirement.

Eggs in a nest.

Image source: Getty Images.

Control your income

If you can avoid paying more in taxes than you need to in retirement, you can withdraw a smaller portion of your portfolio or spend more of your savings every year. In order to avoid taxes, you need to be able to control your taxable income as much as possible.

All withdrawals from a traditional (pre-tax) IRA or 401(k) are counted toward your income. But withdrawals from a Roth (tax-free) account don't count at all. Likewise, withdrawals from an HSA (tax-free) for qualified medical expenses don't count. Furthermore, only the gains on investments in taxable accounts impact your adjusted gross income.

By combining withdrawals from pre-tax and tax-free accounts, you'll practically be able to decide what your taxable income is in retirement. You could keep your taxable income at $0 by only making withdrawals from your pre-tax accounts up to the level of your deductions.

You may also be able to tap capital gains in your taxable account with zero tax liability by staying under the threshold for the 0% capital gains tax rate. For 2022, that cap is a taxable income of $41,675 for individuals and $83,350 for couples filing jointly. Remember, those are gains on top of the principal investment, so you could potentially withdraw a lot from your taxable account without triggering any tax bills.

If you have room to take capital gains at a 0% tax rate, it's a no-brainer to do so. Even if you don't need the funds for your budget, by selling and repurchasing shares immediately, you can raise the cost basis of your investments, reducing your potential taxable gains in future years. This is a strategy called tax-gain harvesting.

Making the most of each account

If you have a diversified portfolio of stocks, bonds, and other assets, you can take advantage of your various accounts.

Since a Roth account requires you to pay taxes on your contributions or conversions, but withdrawals are tax-free, it's best suited for investments with the greatest potential for growth. Stocks, especially growth stocks, will be right at home in a Roth account.

If you have dividend payers or bonds that pay interest regularly, you may get the most out of keeping them in a pre-tax retirement account. Since all taxes are deferred in those accounts, you won't see a tax bill on those dividend and interest payments every year, and you can keep more of your money invested.

And if you have tax-advantaged investments like REITs or MLPs, you can keep them in a taxable account (although they'd be fine in a retirement account as well). Municipal bonds, which can be tax-free, are great choices for a taxable account as well.

The accounts in which you hold each type of asset can have a significant impact on your after-tax portfolio value in retirement.

By holding assets across all types of accounts, you can maximize your savings and the amount of those savings you get to keep in retirement.