A big retirement account with possibly taxable gains is a nice problem to have. This calculator will tell you which assets to sell.
What is the best way to pay for it?
getty

You’re retired with a taxable brokerage account and a tax-deferred IRA as your main sources of income. Which should be the first to be cashed in?
For many people, the answer is straightforward: First, deplete your taxable assets. If you plan to require both heaps to support your living expenditures from now until you become 100, this rule applies.
The solution is more tricky for certain retirees who have a lot of giving in their plans. Those who are lucky enough to fall into this category must do some math. I have a spreadsheet on hand that will perform the work for you. It specifies which assets should be depleted first.
Let’s start with some basic assumptions before we get into the calculations.
The first is that you are at least 59-1/2 years old, therefore there are no penalties for raiding your IRA.
Next, you’ve already withdrawn the statutory minimum distribution from your retirement savings if you’re 72 or older.
The final assumption is that any loss positions in the taxable account have been sold long ago. Regardless of your age or retirement goals, you should constantly be aware of harvesting losses. What you’re left with are winning positions that may be subject to capital gains taxes.
ADDITIONAL INFORMATION FOR YOU
If you were confident that you would eventually sell all of your taxable assets to fund your own spending in retirement, the best strategy would be to use them up first, starting with the ones that have appreciated the least. You’d keep the IRA’s tax shelter as long as possible.
This appears to be contradictory, given that equities held outside of an IRA are taxed at a lower rate, whereas IRA withdrawals are taxed at a higher rate. But that’s how compounding and tax sheltering arithmetic operate. See Chapter 3 of the Guide To Income For Early Retirees for further information.
But what if you’re unsure whether or not you’ll use a taxable asset for yourself?
Take, for example, Harry, a taxpayer who wishes to spend $100,000 on a boat. He might take money from his IRA or sell shares he bought for $80 years ago for $100 a share. He’ll have to pay capital gains tax if he sells the stock. If he keeps it, he estimates there’s a 50-50 chance he’ll avoid paying capital gains tax.
That bypass can occur in one of three ways. One possibility is that Harry will donate the stock to charity. Another option is to gift it to a low-income relative who pays no tax on long-term gains. The third option is for him to leave it in his will and have his heirs cash it in.
The question becomes more intriguing at this point. Is avoiding capital gains worth invading the IRA? The answer is contingent on tax rates, the stock’s cost basis, and the likelihood of avoiding capital gains.

Forbes uses a Google spreadsheet to determine the best plan.
Download my calculator to follow along. Make a copy of this Google spreadsheet and experiment with it. (To gain access, you must be using Google Chrome.)
I’ve assigned Harry to the 24 percent federal tax bracket, which corresponds to joint returns with adjusted gross income of $200,000 to $350,000. His state income tax rate is 6%. On dividends and long gains, he qualifies for the 15% rate. He won’t have to pay the 3.8 percent surcharge on investment income if his adjusted gross income is less than $250,000.
He must either sell $104,000 of stock or withdraw $143,000 from his IRA to pay for the boat. He selects one of the options.
Time moves on. There is a second cash-out at some point later—12 years later, using the default numbers in the calculator spreadsheet.
If Harry cashed out his shares at the start, he or his heir is left with an IRA that has grown to $257,000 in year 12 and is good for $180,000 in after-tax spending money.
If Harry had spent his IRA money on the yacht instead of the stock, the stock would have appreciated in value. It would have only yielded $164,000 on liquidation if there had been no option to avoid capital gains tax. Dividends are taxed along the way, and the appreciation on the original shares from their $80 purchase, as well as the appreciation on shares acquired with reinvested dividends, is taxed at the end.
In this situation, the decision to keep the IRA rather than the stock is a clear winner, saving $16,000.
Harry, on the other hand, might be able to avoid the capital gain in the end. Perhaps he donates the stock to charity or intends to keep it once he passes away. In that situation, the stock preservation approach would put Harry ahead, but only by a modest margin.
A dice roll is possible with the calculator. With a 50% chance of the capital gain being evaded, Harry decides that preserving the IRA is the preferable option.
Fill in the blanks in your copy of the spreadsheet with your own assumptions. You can alter tax rates, the time it takes for a second cash-out, and other factors. The arithmetic will very certainly lead you to the decision to sell taxable shares to cover today’s living expenditures.
However, there are some situations where it makes sense to keep the stock. That can happen if both of these conditions are met: the stock in question has a low cost basis, and you have a reasonable expectation that you or your heirs would avoid paying capital gains tax.
Follow these procedures while using this calculator to plot your moves:
—Start with your most expensive stock positions when making decisions.

Spend no time debating whether or not to sell bonds in a taxable account. Before jeopardizing an IRA, they should always be sacrificed. If you have an excessive allocation to equities as a result of this, make the necessary adjustments within the IRA.

Don’t take money out of your IRA just because you think your tax rate will rise in the future. If you find yourself in this situation, consider a Roth conversion, in which you pay taxes now to make a portion of your IRA tax-free for the rest of your life. Sell enough taxable assets to cover the cost of the yacht as well as the conversion tax.

Watch out for a Democratic proposal to deny wealthy families a capital gain bypass on bequests and donations. (At this time, there is no threat of eliminating the exemption on appreciated property donated to charity.) It’s possible that you’ll have to reduce your chances of profiting from the bypass.
Change the numbers in the yellow cells in the calculator to see what happens. The cost basis of the appreciated shares you may be selling may cause the biggest swings in your results. The length of the holding period and the expected stock market return are less critical factors.
The amount of a withdrawal you’ll need for your yacht is determined by the federal tax rate on ordinary income, which includes IRA distributions. However, it has no bearing on the wisdom of keeping the IRA. If you’re still stumped, I propose Guide To Income For Early Retirees. That essay shows how an IRA is better regarded as a shrinking asset that is totally tax-free, rather than a tax-deferred asset.
My calculator assumes that your spouse or other heir will be in the same tax bracket as you for the sake of simplicity. It doesn’t allow for changes in your bracket over time, but if one is inevitable, use these guidelines:
—Don’t raid the IRA if your bracket is going to shrink.
—Do a partial Roth conversion now if your bracket is anticipated to rise./nRead More