NEW YORK (CNN/Money) -
Next spring my wife and I plan to sell a duplex we own at a profit. I also own a bunch of loser stocks. Can I sell the stocks and take capital losses and use them to offset the gains from the duplex?
-- Jeff Rivard, Mequon, Wisconsin
The quick answer is yes, of course you can. But anytime you come to the intersection of real estate and the old tax code, things are rarely as simple as a plain old yes or no.
And in the case of real estate, the question of offsetting gains or losses against gains or losses in stocks or other securities depends on several factors, one of the most important being whether we're talking about investment property or your residence.
Selling a residential property
Let's take the case of a residential property first since it's simpler. When you sell a residence for a profit, you automatically qualify for a gain exclusion of $500,000 for married couples and $250,000 for singles. There are a few conditions you've got to meet -- click here to see what they are -- but basically you don't have to pay tax on any gain at or below the $500,000 or $250,000 ceiling.
If you're fortunate enough to have a bigger gain, the amount above the ceiling would be subject to capital gains rates of no higher than 20 percent, although you could use losses in stocks or other securities to reduce or eliminate that gain.
If you sell your residence for a loss -- I know in these days of soaring real estate prices that may seem unthinkable, but, hey, it happens -- you're out of luck. You can't use apply that loss against gains in securities.
Selling investment property
Now, let's move on to investment property, or property you buy as an investment and rent out to tenants. Again, if you sell at a profit, you can offset your gain against a loss on the sale of stocks or other securities. But unlike the case with a home, if you have a loss in the property, you can use that loss to offset gains in securities.
You've got to be careful about how you calculate your gain or loss, however. Let's say you bought a duplex for $200,000 ten years ago and sold it for $400,000 this year. And since this is an investment property, let's assume you took depreciation deductions -- essentially a deduction for wear and tear on the property -- of $50,000 during the time you held the duplex.
Your gain in this case is not $200,000, or the difference between the $200,000 purchase price and the $400,000 sale price. Your gain is $250,000. That's because you've got to add back the depreciation deductions you took.
In tax circles, this little adjustment is known as depreciation "recapture," and essentially it's the government's way of making sure you don't take advantage of depreciation deductions twice.
So your gain in our little example is $250,000: $50,000 of which is depreciation recapture taxed at a special 25 percent rate, while the other $200,000 is a long-term capital gain taxed at capital gains rates of no higher than 20 percent.
If your "loser stocks" have handed you losses of $250,000 or more, then that loss can offset your entire $250,000 gain.
But what if your stocks have lost less than $250,000? Well, in that case you would apply the loss first against your "recapture" gain to wipe out as much as possible of this higher tax liability, and then you would apply whatever is left to the portion of the gain taxed at lower capital gains rates. This would give your losses the biggest bang for their buck.
Check with your tax adviser first
Of course, with your property being a duplex and all, I suppose it's also possible that you could live in one part of the building and rent out the other part, making it a hybrid residence-investment property. If that's the case, then the residential tax rules govern the residential portion of the property and the investment property rules apply to the investment portion.
What I've given you here is a general overview of the rules that apply to your situation. Given the many intricacies and niggling exceptions embedded in our wonderful tax code, I strongly suggest that you consult a tax adviser before you start selling securities in anticipation of your real estate gain or, at the very least, that you check out what the IRS has to say on this topic, which, when you click here, you'll find is quite a lot.
Walter Updegrave is a senior editor at MONEY Magazine and is the author of "Investing for the Financially Challenged." He can be seen regularly Monday mornings at 8:40 am on CNNfn.