When you sell a home that was converted to a rental, your gain doesn’t get taxed at a single rate. It splits into up to three pieces: depreciation recapture taxed at up to 25%, a share tied to the years you rented the property taxed at long-term capital gains rates of 0%, 15%, or 20%, and whatever remains that may qualify for the Section 121 principal-residence exclusion of up to $250,000 (or $500,000 if married filing jointly). A 3.8% net investment income surtax can apply on top at higher incomes. The tax on selling a home that was converted to a rental depends on how those pieces line up, and the calculation starts with your basis and your depreciation history, not the sale price.
Figuring Your Total Gain
Gain isn’t sale price minus purchase price. The IRS starts with your “amount realized,” which is the sale price minus selling costs like real estate commissions, advertising, legal fees, title insurance, and any loan charges you agreed to pay for the buyer.1Internal Revenue Service. Publication 523 (2025), Selling Your Home On a $500,000 sale with $35,000 in commissions and closing costs, the amount realized is $465,000.
From that, you subtract your adjusted basis: original purchase price plus settlement charges at purchase, plus capital improvements made over the years, minus all depreciation claimed while the home was rented. The difference is your total gain.
Depreciation Reduces Your Basis Whether You Claimed It or Not
Residential rental property is depreciated on a straight-line basis over 27.5 years under MACRS.2Internal Revenue Service. Publication 946 (2025), How To Depreciate Property Each rental year, you deduct a slice of the building’s value (not the land). Over ten years of renting, that’s roughly 36.4% of the building’s depreciable basis.
The trap: the IRS reduces your basis at sale by the depreciation “allowed or allowable,” whichever is greater.2Internal Revenue Service. Publication 946 (2025), How To Depreciate Property If you rented for eight years but never claimed depreciation, the IRS still subtracts eight years of allowable depreciation from your basis. You lose the annual deduction and take the larger gain anyway. If you’ve been skipping depreciation, amending prior returns before you sell is worth a serious look.
The Section 121 Exclusion and Its Limits for Converted Homes
If you owned the home and used it as your principal residence for at least two of the five years before the sale, up to $250,000 of gain can be excluded from tax, or $500,000 on a joint return.3Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence Both spouses must meet the use test for the full joint amount; only one needs to meet the ownership test.
Two rules keep converted-rental sellers from using the full exclusion.
Non-Qualified Use Cuts Down What You Can Exclude
Any time after December 31, 2008, that the property was not your principal residence is a “non-qualified use period.”3Office of the Law Revision Counsel. 26 USC 121 Exclusion of Gain From Sale of Principal Residence Gain allocated to those periods can’t be excluded. The formula: total non-qualified use time divided by total ownership time. Ten years of ownership with the last four as a rental produces a 40% non-excludable share of the gain that’s left after depreciation recapture is removed.
Narrow exceptions apply. Temporary absences of up to two years total for job changes, health reasons, or unforeseeable circumstances don’t count. Up to ten years of qualified extended military duty, Foreign Service duty, or intelligence community assignments are also excluded from the non-qualified count.4Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence
Depreciation Recapture Is Never Excluded
Gain equal to the depreciation you claimed (or should have claimed) is carved out before the Section 121 exclusion applies. If you took $40,000 in depreciation, that $40,000 is taxable at up to 25% no matter how much exclusion room you have left.
The Three Buckets, With Numbers
Once total gain is set, it divides into up to three pieces:
- Depreciation recapture, called unrecaptured Section 1250 gain, equal to depreciation allowed or allowable. Taxed at a maximum federal rate of 25%.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses
- The non-excludable share of the remaining gain, allocated to non-qualified use. Taxed at long-term capital gains rates of 0%, 15%, or 20% depending on taxable income.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses
- The excluded share, up to $250,000 or $500,000. Owes no federal tax.
A Worked Example
Suppose you bought a home for $300,000, lived in it five years, then rented it for five years before selling. No capital improvements. During the rental years you claimed $30,000 in depreciation. After selling costs, your amount realized is $500,000.
Adjusted basis: $300,000 minus $30,000 depreciation, or $270,000. Total gain: $500,000 minus $270,000, or $230,000.
Carve out depreciation recapture first. That’s $30,000 of unrecaptured Section 1250 gain, taxed at up to 25%. Remaining gain: $200,000.
Now the non-qualified use ratio. Ten years of ownership, five as a rental, so 5/10 = 50%. Half of the $200,000, or $100,000, is non-excludable capital gain taxed at long-term rates. The other $100,000 falls under Section 121 and owes nothing.
Final picture on $230,000 of gain: $100,000 excluded, $30,000 at up to 25%, $100,000 at your long-term capital gains rate.
The 3.8% Net Investment Income Tax
A separate 3.8% surtax on net investment income can apply if your modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately).6Internal Revenue Service. Topic No. 559, Net Investment Income Tax These thresholds aren’t indexed for inflation.
The surtax hits the lesser of your net investment income or the amount MAGI exceeds the threshold. Gain excluded under Section 121 isn’t net investment income, but every dollar of taxable gain from the sale is.7Internal Revenue Service. Questions and Answers on the Net Investment Income Tax A joint filer with $300,000 MAGI and $130,000 of taxable gain owes 3.8% on $50,000 (the amount over the $250,000 threshold), or $1,900. This one catches a lot of sellers who budgeted only for capital gains rates.
Suspended Passive Losses Get Released
Here’s the offsetting news. If rental losses were suspended under the passive activity rules during the years you rented the home, selling the property in a fully taxable transaction releases all of those suspended losses at once.8Office of the Law Revision Counsel. 26 U.S. Code 469 – Passive Activity Losses and Credits Limited They become non-passive and offset ordinary income without the usual limits.
That won’t cancel the capital gain directly, but it reduces overall taxable income for the year, which can pull some of the gain into a lower bracket. Before selling, check prior returns or ask your preparer for your cumulative suspended loss balance. Owners at higher incomes often have years of stacked-up losses waiting to be freed.
If the Home Lost Value Before You Converted It
Converting a home to a rental triggers a dual basis rule. For gain, your basis stays at original cost plus improvements. For depreciation during the rental years and for measuring any loss at sale, your basis is the lower of original adjusted basis or fair market value on the conversion date.9Internal Revenue Service. Publication 527 (2025), Residential Rental Property The rule stops you from deducting a decline in value that happened while the property was still your home.
An awkward outcome: if the sale price lands between the higher gain basis and the lower loss basis, the IRS recognizes neither gain nor loss. Say the fair market value at conversion was $280,000, original cost was $320,000, and you sell for $300,000. No gain (price is below the $320,000 gain basis), no deductible loss (price is above the $280,000 loss basis). You can sell at an economic loss and have nothing to deduct.
If the sale is a true loss below the loss basis, the deduction is generally an ordinary loss under Section 1231 because the property was held for business or investment, which means it offsets regular income without the $3,000 annual cap that applies to capital losses.10Internal Revenue Service. 2025 Instructions for Form 4797
Deferring the Tax With a 1031 Exchange
Instead of paying tax at sale, you can defer the entire gain, including depreciation recapture, by rolling proceeds into another investment or business property through a like-kind exchange under Section 1031. The replacement must be held for investment or business use.11Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
Deadlines are strict. You have 45 days from closing to identify the replacement property in writing, and you must close on it within 180 days of the sale or by the due date (with extensions) of that year’s tax return, whichever comes first.11Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031 Late-year closings often lose the full 180 days because of that “whichever comes first.”
You can’t touch the sale proceeds. A qualified intermediary must hold the funds between sale and purchase. Your real estate agent, attorney, or accountant, or anyone who worked for you in those roles within the prior two years, is disqualified from acting as the intermediary.11Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031 Taking control of the cash, even briefly, can disqualify the exchange and make the full gain immediately taxable.
Combining Section 121 With a 1031 Exchange
You don’t have to pick between the two. If the property was your primary residence before it became a rental, and you still meet the two-out-of-five-year use test at sale, you can apply Section 121 to the personal-use portion of the gain and defer the rest through a 1031 exchange. The exclusion goes first; the exchange handles what’s left. Both sets of rules have to be met independently, and converting the replacement rental to personal use too quickly can undo the deferral, so plan to hold it as a rental for at least two years to show real investment intent.
Where the Sale Goes on Your Return
A rental held longer than a year is Section 1231 property, reported on Form 4797, Sales of Business Property, Part I. The net gain or loss flows to Schedule D.12Internal Revenue Service. 2025 Instructions for Form 8949 The unrecaptured Section 1250 gain is computed on the Unrecaptured Section 1250 Gain Worksheet in the Schedule D instructions and entered on Schedule D, line 19, where the 25% maximum rate applies.13Internal Revenue Service. 2025 Instructions for Schedule D (Form 1040) The Section 121 excluded portion isn’t reported on these forms; you subtract it before entering the taxable amounts. If the 3.8% surtax applies, add Form 8960.