Tax-favored retirement accounts like IRAs and 401(k)s can save you thousands of dollars in taxes over the course of your career, because they offer tax deferral on the income and gains that your investments produce while they're inside the account. However, the IRS doesn't let you get away with tax-deferred growth forever. When you turn 70-1/2, you have to start taking required minimum distributions (RMDs) from traditional IRAs and 401(k) accounts, and you have to pay tax on the amount that you withdraw. However, once you understand RMDs you'll see there's a way to soften the blow.

Let's look more closely at the rules on taking minimum distributions and ways you can make the most of that cash.

Jar labeled "retirement" holding money, next to a calculator.

Image source: Getty Images.

The basics of RMDs

Retirement account owners have to start taking RMDs for the year in which they turn age 70-1/2. Once you reach that age, you have until April 1 of the following year to take the distribution. Subsequently, you must take your RMD by Dec. 31.

The calculation of how much you have to take out depends on your age. In essence, the tax laws force you to take the fraction of your account balance that corresponds to one year's worth of assets compared to your current life expectancy. The IRS provides life expectancy tables to facilitate that calculation.

As a simple example, say you started 2017 with $530,000 in total IRA assets and turned 70-1/2 in mid-January. You'll use the IRS table for age 71, because that's what your age will be at the end of 2017. The corresponding table entry says your life expectancy is 26.5 years. So divide $530,000 by 26.5, and you get a required minimum distribution of $20,000 for 2017. Again, since you just turned 70-1/2 during 2017, you'll have a one-time extension to April 1, 2018, before needing to take your distribution, although you can take it at any time.

Why many investors get upset about RMDs

Required minimum distributions aren't typically a problem for those who actually need to use their retirement account assets in order to meet living expenses. In fact, most people will already have tapped into their IRAs and 401(k)s before reaching age 70-1/2.

However, if you have other sources of retirement income, then you might prefer to stay invested in your IRA as long as you can. And while RMD rules stop you from keeping money in your retirement account, they don't have to stop you from keeping the investments that you like.

The best thing to do with unwanted IRA distributions

The most commonly misunderstood aspect of RMDs is that many people think they can't reinvest the money they receive back into the stock market. It's true that you can't take an RMD from your own retirement account and reinvest it back into another IRA or 401(k). The RMD rules prohibit those attempts to circumvent the system.

However, you can deposit your withdrawn retirement cash into a brokerage account and then invest it in any way you like. The account will be an ordinary taxable account, and you won't benefit from tax deferral the same way that the IRA or 401(k) did. But you will get to keep reaping any capital gains that investment earns you.

To explain further, let's turn back to our previous example. Say that in your $530,000 IRA portfolio, you have a position in a stock that you paid $10,000 for and is now worth $20,000. That happens to be the exact same amount as your RMD, but you think the stock will keep climbing. In that case, you could sell the stock, distribute the $20,000, and then repurchase the stock through a taxable brokerage account. Apart from the fact that it's in a different type of account and won't have the same tax aspects, your portfolio will remain the same.

Things to watch out for

This strategy can work well, but there are some caveats to consider. First, you'll still owe income tax on the $20,000 distribution from your retirement account. If you don't have enough assets outside the retirement account, then you'll have to take some of the RMD and use it to pay taxes. That will prevent you from fully replicating your old position, although you'll be able to take a smaller position if you wish.

Also, there will also be some minor risks with regard to timing. To use the strategy, you'll have to sell retirement account assets, set up the distribution, wait for the money to arrive, transfer it to your brokerage account, and then buy the assets back. You'll pay transaction costs, and you run the risk of missing a rise in the stock during the interim. If you have outside assets you can tap temporarily, then you can avoid this by pre-funding the taxable account beforehand and then making the purchase almost simultaneously with the sale inside the retirement account.

In any case, if your main goal is to stay invested, then you don't have to let RMD rules stop you. By using taxable accounts to your advantage, you can mirror what you were doing in your IRA or 401(k) and still enjoy any gains in the stocks you've chosen.

The Motley Fool has a disclosure policy.