Capital Gains Tax on the Sale of a Rental Property: How Each Part Is Taxed
The gain on a rental sale isn't taxed at one rate. It's split into layers: recapture, unrecaptured section 1250 gain, section 1231 gain and possibly the 3.8% net investment income tax. How each layer is figured, and the rules that change the bill: a former residence, an installment sale, a 1031 exchange.
Sources checked
Capital gains tax on the sale of a rental property is figured in layers, not at one rate. First the gain: the sale price minus selling costs, minus your adjusted basis. Then the split. Depreciation on personal property comes back at ordinary rates, depreciation on the building is taxed at up to 25%, and the appreciation is taxed at 0%, 15% or 20%. The 3.8% net investment income tax can sit on top of all of it.
All of this assumes you held the rental for more than a year. Hold it a year or less and the whole gain is short-term, taxed at ordinary rates. The sale is reported on Form 4797, with the details in IRS Publication 544.
Step 1: how much gain is there?
Gain = amount realized − adjusted basis.
- Amount realized: the sale price minus selling costs such as commissions, title and transfer taxes.
- Adjusted basis: what you paid, including capitalized closing costs, plus capital improvements, minus all depreciation allowed or allowable.
That last phrase matters. Under §1016(a)(2), basis drops by the depreciation you were entitled to, whether or not you claimed it. An owner who never depreciated a rental pays tax on a gain as if they had, without ever getting the deduction. Missed depreciation can usually be recovered with Form 3115 before the sale rather than lost.
Step 2: how the gain is split into layers
From the top of the stack down:
- Section 1245 recapture, ordinary rates. Depreciation on personal property, such as appliances, carpet and furniture, is recaptured as ordinary income up to the gain on those assets (§1245(a)). Bonus depreciation counts.
- Section 1250 additional depreciation, ordinary rates. Depreciation on real property above what straight line would have allowed (§1250(a)–(b)). The 27.5- and 39-year building is depreciated straight line, so it has none. Fifteen-year land improvements usually do, because bonus and the 150% declining balance method both run ahead of straight line.
- Unrecaptured section 1250 gain, up to 25%. The rest of the depreciation on real property, mostly the building’s straight-line deductions (§1(h)(1)(E) and (h)(6)). It is a maximum rate, not a flat one: if your ordinary bracket is lower, the lower rate applies.
- Section 1231 gain, 0%, 15% or 20%. What’s left, which is the appreciation above your original cost, land included. Under §1231, a net gain for the year is taxed like a long-term capital gain and a net loss is ordinary.
One trap in layer 4: §1231(c) looks back five years. If you deducted a net section 1231 loss in any of the five prior years, an equal amount of this year’s 1231 gain is taxed as ordinary income instead.
Cost Seg Smart’s depreciation recapture calculator splits a sale into exactly these layers and prints the federal tax on each.
Step 3: the net investment income tax
The 3.8% net investment income tax under §1411 applies to the lesser of your net investment income or your modified AGI above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). Those thresholds are set in the statute and aren’t indexed for inflation, so more sellers cross them each year.
Gain on a rental is generally net investment income. The exception is property held in a trade or business that isn’t passive for you. The regulations give real estate professionals a safe harbor: participate in the rental for more than 500 hours in the year (or in five of the prior ten years) and the gain is treated as trade or business gain (Treas. Reg. §1.1411-4(g)(7)). Ask your CPA whether yours qualifies before you assume the 3.8% is unavoidable.
Suspended passive losses come off the sidelines
If your rental losses were passive and couldn’t be used, they’ve been carrying forward. Sell your entire interest to an unrelated buyer in a fully taxable sale and those losses are released in the year of sale, against any income (§469(g)). For many owners this offsets a large part of the gain.
A rental that used to be your home: the section 121 exclusion
Section 121 excludes up to $250,000 of gain ($500,000 married filing jointly) if you owned the home and lived in it as your main home for at least two of the five years before the sale. On a former residence, three rules decide how much survives:
- Depreciation is never excluded. Gain equal to depreciation claimed after May 6, 1997 is taxable as unrecaptured section 1250 gain (§121(d)(6)).
- Rental before you lived there reduces it. Periods after 2008 when the home wasn’t your main residence are “nonqualified use,” and the excluded gain shrinks by that share of your ownership (§121(b)(5)).
- Rental after you move out doesn’t. Time after the last day you used the home as your residence, within that five-year window, isn’t nonqualified use. Live there first, rent it later, and sell while you still have two years of use inside the five-year window (typically within three years of moving out, if you lived there exactly two), and you keep the full exclusion apart from the depreciation.
An installment sale
Carrying a note for the buyer lets you report the gain as you’re paid (§453), with two catches:
- Recapture comes first, and all at once. Ordinary-income recapture under §1245 and §1250 is recognized in the year of sale, even if you receive little cash that year (§453(i)).
- The 25% layer is front-loaded. As payments arrive, unrecaptured section 1250 gain is taken into account before the lower-taxed capital gain (Treas. Reg. §1.453-12).
A 1031 exchange
Exchange the rental for like-kind real property and the gain, including recapture, is generally deferred (§1031), with your old basis carrying into the new property. Since 2018 only real property qualifies. Furniture and other personal property in a short-term rental isn’t like-kind, so its share of the price is taxed. Components a cost segregation study classified as section 1245 property can still trigger 1245 recapture in an exchange if the replacement property has less of it (§1245(b)(4); Treas. Reg. §1.1031(a)-3(a)(7)). Bring the allocation to your intermediary and CPA before you close.
Holding until death
Heirs generally take a basis equal to the property’s fair market value at death (§1014), and depreciation recapture does not apply to a transfer at death. The deferred gain and the recapture are both wiped out, which is why many investors exchange rather than sell.
State income tax applies on top in most states, usually at ordinary rates.
This article describes federal tax rules generally and is not tax advice. Your CPA applies them to your facts.
Questions investors ask in forums
Questions people have asked about this topic in public investor and tax forums, answered in plain terms. A forum thread is not tax advice, and neither is this; check your own facts with your CPA.
I rented out my home for a while, then moved back in and lived there. Now I am selling. How does the home sale exclusion apply, do the rental years count as non qualifying use, and is a split based on time correct?
Depreciation claimed after May 6, 1997 is never excluded; it is taxed as unrecaptured section 1250 gain at up to 25 percent. For the rest of the gain, rental years after 2008 that came before you moved back in are nonqualified use, so the excluded gain is reduced by the share of your ownership period that was nonqualified use. A time based split is the right method. Rental time after the last day you lived there, within the five years before the sale, does not count against you.
Asked on BiggerPockets
I lived in my home, rented and depreciated it for two years, then sold. The exclusion covered most of the gain, but the depreciation recapture was taxed at my ordinary rate instead of 25 percent. Did the law change?
No. The rate on unrecaptured section 1250 gain is a maximum of 25 percent, not a flat rate. If your ordinary bracket is lower than that, the gain is taxed at the lower rate, which is how the worksheet computes it. What does not change is that the home sale exclusion never covers depreciation claimed after May 6, 1997, so that part is taxable even when the rest of the gain is excluded.
Asked on BiggerPockets
I rented my home out for about three and a half years, then moved back in briefly before selling. Do I qualify for the full exclusion under the two out of five years rule? And is depreciation recapture a flat 25 percent?
To exclude any gain you need two years of ownership and use as your main home within the five years before the sale. A brief stay after renting does not get there unless enough earlier use falls inside that window. Even if you qualify, rental years after 2008 that came before you moved back in are nonqualified use and reduce the excluded gain. Recapture of building depreciation is taxed at your ordinary rate up to a ceiling of 25 percent, not at a flat 25 percent.
Asked on BiggerPockets
Frequently asked
How is capital gains tax calculated on the sale of a rental property?
Subtract your adjusted basis from the amount realized. The amount realized is the sale price minus selling costs. Adjusted basis is what you paid plus capital improvements, minus all depreciation allowed or allowable. On a rental held more than a year, that gain is then split: section 1245 recapture at ordinary rates, any additional section 1250 depreciation at ordinary rates, unrecaptured section 1250 gain at up to 25%, and the remaining section 1231 gain at long-term capital gain rates of 0%, 15% or 20%. The 3.8% net investment income tax may apply on top.
What is the capital gains tax rate on a rental property?
The appreciation is taxed at long-term capital gain rates of 0%, 15% or 20% depending on taxable income, if you held the property more than a year. The part of the gain equal to building depreciation is taxed at up to 25%, depreciation on personal property such as appliances and furniture at ordinary rates, and high earners may owe the 3.8% net investment income tax on top. A rental held a year or less is taxed entirely at ordinary rates.
Do you pay depreciation recapture if you never claimed depreciation?
Yes. Basis is reduced by depreciation allowed or allowable, whichever is greater, so the gain and the recapture are figured as if you had claimed it. Skipping depreciation only loses the deduction. Missed depreciation can usually be caught up with Form 3115 before the sale.
Does the net investment income tax apply to the sale of a rental property?
Usually. Gain on a rental is net investment income unless the property was held in a trade or business that is not passive for you. A real estate professional who participates in the rental for more than 500 hours a year can qualify under a safe harbor in the regulations. The tax is 3.8% of the lesser of net investment income or modified AGI above $200,000 single, $250,000 joint or $125,000 married filing separately.
Can I use the home sale exclusion on a rental that used to be my home?
Possibly. If you owned and lived in it as your main home for at least two of the five years before the sale, up to $250,000 of gain ($500,000 joint) can be excluded, but never the depreciation claimed after May 6, 1997, and the exclusion is reduced for rental periods after 2008 that came before your last use as a residence. Moving out and renting the home for up to about three years before selling usually keeps the full exclusion apart from the depreciation.
How do I avoid capital gains tax when selling a rental property?
You can defer it rather than avoid it: a 1031 exchange into like-kind real property defers the gain, and an installment sale spreads the capital gain over the years you are paid, though recapture is taxed in the year of sale. Holding until death generally gives heirs a basis stepped up to fair market value. Selling in a lower-income year can reduce the rate on the capital gain layer.
What happens to suspended passive losses when I sell a rental?
When you sell your entire interest in a rental to an unrelated party in a fully taxable sale, the passive losses carried forward from that property are released and can offset nonpassive income that year.
Sources
- 26 U.S.C. § 1231: Property used in the trade or businesslaw.cornell.edu
- 26 U.S.C. § 1245: Personal property recapturelaw.cornell.edu
- 26 U.S.C. § 1250: Real property recapturelaw.cornell.edu
- 26 U.S.C. § 1(h): Capital gains rates, incl. 25% unrecaptured §1250 gainlaw.cornell.edu
- 26 U.S.C. § 1411: Net investment income taxlaw.cornell.edu
- IRS Pub 544: Sales and Other Dispositions of Assetsirs.gov
- IRS Form 4797: Sales of Business Propertyirs.gov
- IRS Pub 527: Residential Rental Propertyirs.gov
- 26 U.S.C. § 469: Passive Activity Losseslaw.cornell.edu
- §1016(a)(2)law.cornell.edu
- Section 121law.cornell.edu
- §453law.cornell.edu
- §1031law.cornell.edu
- §1014law.cornell.edu
Sources are listed so you can check them. Found an error? Email support@costsegsmart.com and we will correct it.


