When it comes to investing money for your golden years, it's hard to beat the 401(k). These popular investment vehicles encourage us to set more aside by supplying us with tax breaks, and often, matching contributions from our employers. But exactly how the tax benefits work has nuances you may not have considered, because a 401(k) can simultaneously be both a traditional and a Roth. Motley Fool Answers listener Elise asks, "How does that work?" In this segment from the July mailbag show, hosts Alison Southwick and Robert Brokamp, along with special guest Ross Anderson, a certified financial planner at Motley Fool Wealth Management -- a sister company of The Motley Fool -- explain.

To catch full episodes of all The Motley Fool's free podcasts, check out our podcast center. A full transcript follows the video.

This video was recorded on July 30, 2019.

Alison Southwick: The next question comes from Elise. "Can you please explain the logistics of how a 401(k) can be both a traditional and a Roth? IRAs can only be one or the other, so how does the 401(k) work? Is it true that all your contributions go in one place and are just broken out on paper or can you invest in some things with your pre-tax money and other things with Roth money? And what happens when you leave the company and roll over the money to an IRA?"

Robert Brokamp: Elise is absolutely right in that when it comes to the 401(k), it's not an all-or-nothing decision. You can make both traditional and Roth contributions. Furthermore, even if you just choose to make Roth contributions but you get a match, the match is going to be traditional and when you take that money out in retirement, you're going to be taxed on it.

How does a 401(k) account for these two buckets of money? Well, the answer is it depends on your plan, so you should contact the administrator of your plan directly. However, for most if not all plans, it's handled proportionately and to use Elise's words, it's really broken out on paper. You don't have two separate accounts, like a Roth account and a traditional. It's really just an accounting thing that's just coded in the account.

Let's consider an example. Let's say you contribute $1,000 a month to your 401(k) and you decide that 50% should be traditional and 50% should be Roth and, furthermore, you're choosing to put half of it in a stock fund and half in a bond fund. You usually cannot say, "I want my Roth money to go into the stock fund and the traditional to go into the bond." It's going to be split proportionately.

Furthermore, when you pull up your account online, chances are it's not going to break it out right there. It's just going to show you your overall balance and you're going to have to dig a little bit, to find out exactly what is Roth and what is traditional. Just as an example, for The Fool 401(k), to figure out how your account breaks down between Roth and traditional, you have to click on View Account, then Account Activity, and Search Options, and then Source as in what's the source of the funds. So you do have to do some digging, but it really is just on paper. They don't have two separate accounts.

When you leave the company and you roll it over, then you can separate it. You can roll the Roth portion into a Roth IRA and the traditional portion into a traditional IRA. In fact, that's the way you have to do it and that's one of the benefits of it, because then you can let the Roth keep growing for as long as you want because there are no RMDs -- required minimum distributions -- on a Roth.