You can lower or eliminate long-term capital gains tax on a property sale by using the Section 121 exclusion on a primary residence, increasing your cost basis with documented improvements and purchase costs, deferring gain through a 1031 like-kind exchange on investment property, spreading the gain across years with an installment sale, or relying on the stepped-up basis if you inherited the property. Which lever fits depends on what kind of property you sold, how long you held it, and what you plan to do with the money.
One threshold matters before any strategy: you need to have owned the property for more than one year to get long-term rates at all. Sell inside 12 months and the gain is taxed as ordinary income, which can run as high as 37%.1Internal Revenue Service. Capital Gains, Losses, and Sale of Home Long-term gains sit in 0%, 15%, or 20% federal brackets depending on your taxable income, with most sellers landing at 15%.2Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates
Use the Section 121 Primary Residence Exclusion
If the property was your main home, this is the largest single tax break available. You can exclude up to $250,000 of gain from federal income tax, or up to $500,000 if you’re married filing jointly.3Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence For most homeowners, that erases the tax bill entirely.
To qualify, you must have owned and lived in the home as your principal residence for at least two of the five years before the sale. Those 24 months don’t have to be consecutive.4Internal Revenue Service. Topic No. 701, Sale of Your Home For a joint filer claiming the full $500,000, both spouses must meet the use requirement, but only one has to meet the ownership requirement.3Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
You generally can’t use the exclusion if you already claimed it on another home sale in the prior two years. A partial exclusion is available if you had to move early because of a job change, health reasons, or certain unforeseen circumstances.4Internal Revenue Service. Topic No. 701, Sale of Your Home Gain that falls within the exclusion isn’t reported as income at all, which also keeps it out of the 3.8% surtax discussed below.
Raise Your Cost Basis
Your taxable gain is the sale price minus your cost basis. The higher your basis, the smaller the gain. Two categories of spending push your basis up.
Purchase and Sale Costs
Several fees paid at closing when you bought the property add to your basis: title search fees, recording fees, survey fees, transfer or stamp taxes, and legal fees tied to the purchase.5Internal Revenue Service. Publication 523, Selling Your Home Mortgage-related costs like loan origination and appraisal fees generally don’t. On the sale side, broker commissions and seller-paid transfer taxes reduce the amount realized, which has the same effect as raising basis.
Capital Improvements
Spending that adds value, extends the property’s useful life, or adapts it for a new use gets added to basis. A new roof, an added bathroom, central air, a fence, a kitchen remodel: all count. Painting a room, fixing a leaky faucet, or swapping broken hardware do not. Those are repairs.5Internal Revenue Service. Publication 523, Selling Your Home
There’s one useful wrinkle. Repair work done as part of a larger renovation can be treated as an improvement. Replacing a single broken window is a repair; replacing every window in the house during a remodel counts as an improvement.5Internal Revenue Service. Publication 523, Selling Your Home Keep receipts, invoices, and permits for every project. They may sit in a drawer for years and then directly lower what you owe.
Defer the Gain With a 1031 Exchange
Selling a rental, a commercial building, or other real estate held for business or investment? A 1031 like-kind exchange lets you defer the entire capital gains tax by rolling the proceeds into another qualifying property.6Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment The tax is deferred, not eliminated, but investors can chain exchanges over decades and never pay during their lifetime.
The rules that trip people up:
- Both properties must be held for productive use in a business or for investment. Primary residences and vacation homes don’t qualify.7Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
- Since 2018, only real estate qualifies. A rental house for vacant land is fine; real estate for equipment is not.7Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
- U.S. real estate is not like-kind to foreign real estate.6Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment
- Property held primarily for sale (flippers’ inventory) doesn’t qualify.6Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment
Two deadlines run from the date you sell the old property. You have 45 days to identify potential replacement properties in writing, and 180 days to close on the replacement (or the due date of that year’s tax return, whichever comes first). Miss either and the full gain becomes taxable. Neither deadline can be extended for hardship.7Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
You also cannot touch the sale proceeds. An independent qualified intermediary holds the funds between the two closings. If the money passes through your hands at any point, the IRS won’t recognize the exchange.
Reinvest less than the full net sale amount, or take on less debt than you had before, and the shortfall is called boot. Boot is taxable. To defer the entire gain, put all of the net proceeds into the replacement property and carry at least as much debt as you did on the old one.
Spread the Gain With an Installment Sale
An installment sale lets you report the gain across the years you receive payments instead of all at once. It works when the buyer pays you over time, as in seller-financed deals or land contracts.8Internal Revenue Service. Publication 537, Installment Sales
The IRS calculates a gross profit percentage by dividing your total gain by the contract price. That percentage is then applied to each payment. If your gross profit percentage is 40%, then 40% of each payment counts as capital gain that year.8Internal Revenue Service. Publication 537, Installment Sales The interest portion of each payment is taxed separately as ordinary income.
The payoff is bracket management. A $300,000 gain recognized in one year could push you into the 20% capital gains bracket. Spread across five or ten years, each year’s slice might stay in the 15% bracket, or even the 0% bracket if your other income is low enough. Installment income is reported on Form 6252.9Internal Revenue Service. About Form 6252, Installment Sale Income You can also elect out of the installment method and report everything in the year of sale if that produces a better result.
Inherited Property: The Stepped-Up Basis
If you inherited the property, the taxable gain is usually far smaller than you’d expect. Federal law sets the cost basis of inherited property at its fair market value on the date the previous owner died, not what they originally paid.10Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent
Say your parent bought a house in 1985 for $80,000 and it was worth $400,000 the day they died. Your basis is $400,000. Sell it for $430,000 and the taxable gain is $30,000, not $350,000. The step-up works in reverse too: if the property lost value before the owner’s death, basis steps down to that lower amount.
One important boundary. The step-up applies to property passed by will, trust, or intestacy. Property gifted during the owner’s lifetime takes the donor’s original basis, which is why inherited property is generally more tax-efficient to sell than gifted property.
Watch Out for Depreciation Recapture
If you rented the property or otherwise used it to produce income, you claimed (or were entitled to claim) depreciation each year. When you sell, the IRS wants that benefit back. The portion of your gain attributable to depreciation is taxed at a maximum rate of 25% as unrecaptured Section 1250 gain.11Internal Revenue Service. Topic No. 409, Capital Gains and Losses
This catches sellers who assumed the whole gain would qualify for the 15% rate. And skipping depreciation on your returns doesn’t help: the IRS still reduces your basis by the amount you were allowed to deduct, whether you claimed it or not.12Internal Revenue Service. Property (Basis, Sale of Home, Etc.) 5 The only clean way to defer depreciation recapture on investment property is a 1031 exchange.
The 3.8% Net Investment Income Tax
Higher earners face an extra 3.8% surtax on capital gains from property. The net investment income tax kicks in when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers, and those thresholds aren’t indexed for inflation.13Internal Revenue Service. Questions and Answers on the Net Investment Income Tax
The 3.8% applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. Gain from selling investment real estate, including a second home, counts. Gain excluded under Section 121 on a primary residence is removed before the NIIT calculation runs.13Internal Revenue Service. Questions and Answers on the Net Investment Income Tax A married couple with a $450,000 gain on their home owes no NIIT on that sale at any income level, because the $500,000 exclusion covers it.
For investment property, the combined federal rate can reach 23.8% on the capital gains portion and 28.8% on the depreciation recapture portion. Installment sales and 1031 exchanges help manage this by either spreading MAGI across years or deferring the gain outright.
Layering Strategies
These tools stack. A homeowner might use the Section 121 exclusion on the first $500,000 of gain and structure any excess as an installment sale to keep the remainder in a lower bracket. Someone who converted a former rental into their home could split the gain between Section 121 (for the residential years) and a 1031 exchange (for the investment years), though that allocation calls for careful planning. An heir who inherits investment property gets the stepped-up basis first, then can still use a 1031 exchange for whatever gain remains. Each strategy addresses a different piece of the equation — basis, rate, timing, or exclusion — so combining them multiplies the savings.