As a simplified example, let’s say that you bought a property for $100,000 and paid $5,000 in various legal fees and other acquisition expenses. Then, you sell it a few years later for $130,000, and pay $6,000 in real estate commissions and other selling costs. Your capital gain would be the net proceeds from the sale, or $124,000, minus your total cost basis, or $105,000. So instead of a $30,000 capital gain, you’d have a $19,000 gain for tax purposes.
A couple more notes on cost basis:
- If you inherit an asset, the cost basis is reset to the fair market value at the time of the original owner’s death. If your parent paid $10 per share for a stock investment that is worth $80 at the time of death, the latter number would be your new cost basis (this concept is known as step-up in basis).
- If you make substantial value-adding improvements to a property, they can add to your cost basis. In other words, if you buy a property for $200,000 and spend $50,000 on a major kitchen and bathroom renovation, your cost basis could be the total of the two. However, maintenance expenses and repair costs are generally not considered to be part of the cost basis.
Taxes on the sale of your main home
If you sell your home at a profit, you probably don’t need to worry about paying capital gains tax on the sale unless you sell the home for a lot more than you paid for it.
Specifically, there’s a capital gains tax exclusion for the sale of your main home. Known as the primary residence exclusion, this allows home sellers to exclude as much as $250,000 of capital gains from the sale of a main home (but not a vacation home or investment property). Married couples who file joint tax returns can use the exclusion for each spouse, meaning that as much as $500,000 in profit from the sale of a primary residence can be excluded from income.
In order to qualify for the exclusion, there are two conditions that must be met:
- You must have owned the home for at least two out of the five years before the sale.
- You must have used the home as your main home for at least two of the five years before the sale.
It’s important to mention that these don’t necessarily need to happen at the same time. As an example, if you had lived in a home for two years while paying rent, but then you purchased the home and sold it two years later, it could qualify. You also cannot use the primary residence exclusion if you used it to exclude a gain from another home during the two-year period before the sale took place.
Selling an investment property can be a little more complicated
Obviously, the primary residence exclusion doesn’t apply to investment properties, but these can have significantly more complex tax situations when you sell. There are two types of tax you might need to pay on the sale of an investment property -- capital gains tax and depreciation recapture.
Capital gains tax
We’ve already looked at an overview of how capital gains tax works, so this is the easier part to explain. Simply put, there is no exclusion for capital gains on an investment property like there is for a primary residence.
When you sell an investment property, your net profit is subject to capital gains tax. If you owned the property for over a year, you’ll pay the lower long-term capital gains tax rates, and if you owned it for one year or less, your profits will be taxed as ordinary income.
Here’s where investment property taxation gets a little more complicated. One of the biggest tax benefits of investing in real estate (from an income perspective) is the ability to deduct the property’s depreciation each year.
Think of depreciation as a business tax write-off, except that it happens gradually over a period of years instead of being taken all at once. For example, if you buy a piece of business equipment for $20,000 with a useful lifespan of five years, you could deduct one-fifth of its cost each year for five years (the depreciation rules for business assets can be far more complicated, but you get the idea).
Real estate held for investment can also be depreciated over time. The "useful life span" for real estate is defined by the IRS as 27.5 years for residential property and 39 years for commercial property. In other words, you can divide your cost basis by the appropriate lifespan and deduct this amount every year until the entire cost basis has been deducted.
For example, if you acquire a residential investment property with a cost basis of $200,000, you can take a depreciation deduction of $7,273 each year, which can be used to lower your taxable rental income (more on that later).
During the year you buy the property and the year you sell it, your depreciation expense is prorated based on the month in which you buy (or sell) the property. And you must stop claiming a depreciation expense after your cumulative depreciation expense adds up to your cost basis in the building. If your cost basis in an investment property is $200,000, the total depreciation you claim over time cannot exceed this amount.
The downside is that when you sell the investment property, the IRS wants this tax benefit repaid. So if you claimed $40,000 in depreciation while you owned an investment property, you’ll have an additional $40,000 in taxable income upon the sale of the property, in addition to any capital gain. What’s more, because depreciation is used to offset rental income (a form of ordinary income), depreciation recapture is taxed as ordinary income, not at the favorable long-term capital gains rates.
An example of an investment property sale
To put this together, let’s say that you own an investment property that you purchased for $200,000, inclusive of acquisition costs. After holding the property for five years, you’ve claimed $36,365 in depreciation.
After five years, you sell the property for net proceeds of $250,000. This gives you a capital gain of $50,000 on the sale, which will be taxed at your appropriate long-term capital gains rate. You’ll also owe depreciation recapture on $36,365, which will be taxed at your ordinary income rate.
As you can see, taxes on the sale of an investment property can add up quickly. Fortunately for long-term investors, there is a way to avoid paying both capital gains and depreciation recapture tax on the profitable sale of an investment property.
This is known as a 1031 exchange, which essentially means that if you sell one investment property, but use the proceeds to acquire another, you can defer paying taxes on the sale. There are quite a few rules and caveats of 1031 exchanges, so be sure to check out our guide to 1031 exchanges to learn more, but here are some of the key criteria that need to be satisfied for a successful 1031 exchange:
- The exchange must be completed within 180 days. From the date you sell your investment property, you have 45 days to formally identify potential replacement properties, and a total of 180 days to close on the purchase of a new property or properties.
- You can sell more than one property as part of a 1031 exchange, and you can acquire more than one property. The number of properties you sell and acquire doesn’t necessarily need to be the same.
- In order to defer all of your taxes, the replacement property or properties must be acquired for at least as much as the original property sold for. And you’ll need to carry at least as much debt on the replacement property as you had on the property you sold. For example, if you sell a property for $500,000 with a $300,000 mortgage balance, your new property or properties must meet or exceed both of these figures to defer your taxes.
- You can choose to complete a partial 1031 exchange. If you acquire a replacement property for a lower purchase price, or with less debt, than the original property, you simply pay capital gains and depreciation recapture on the difference.
How is rental income taxed?
So far we’ve looked at how you’re taxed on the sale of real estate, but what about if you use your investment properties to generate rental income?