Capital Gains Tax on Real Estate Sales: Rates, Exclusions, and 1031s

The capital gains tax on real estate sales is a federal tax on the profit when you sell property for more than your adjusted cost. Rates run from 0 percent to 23.8 percent depending on how long you owned the property, your income, and whether it was your home or an investment. Most homeowners selling a primary residence owe nothing because federal law excludes up to $250,000 of profit for single filers and $500,000 for married couples filing jointly. Investment property is a different story: you face regular capital gains rates plus a separate depreciation recapture tax that can reach 25 percent.

Figuring Your Actual Gain

Your gain is not your sale price. It is the difference between what you net from the sale and your adjusted basis in the property, and every dollar you can legitimately add to that basis is a dollar the IRS cannot tax.

Start with your original purchase price plus the settlement fees you paid when you bought. Add the cost of capital improvements over the years. The IRS treats permanent upgrades that increase value, extend the property’s life, or adapt it to a new use as improvements: a new roof, a finished basement, an added deck. Ordinary repairs like painting, patching drywall, or fixing a faucet do not count.1Internal Revenue Service. Publication 523 – Selling Your Home – Section: Improvements

On the other side of the ledger, subtract selling costs from your gross proceeds before you calculate the gain. Real estate commissions, legal fees, recording fees, title insurance, and transfer taxes all come off the top.2Internal Revenue Service. Publication 523 – Selling Your Home – Section: Expenses of Sale

The formula: net sale price (gross proceeds minus selling costs) minus adjusted basis (purchase price plus improvements) equals your capital gain or loss.

Keep every receipt, contractor invoice, and closing statement. If the IRS questions your numbers, the burden of proof is on you.

The Primary Residence Exclusion

Federal law lets you exclude up to $250,000 of profit from the sale of your main home if you are single, or up to $500,000 if you are married filing jointly.3Office of the Law Revision Counsel. 26 US Code 121 – Exclusion of Gain From Sale of Principal Residence Because the median home sale profit falls well below these numbers, the exclusion wipes out the tax entirely for most families.

To qualify, you must pass two tests during the five-year period ending on the date of sale:

  • Ownership test: you owned the home for at least two of those five years.
  • Use test: you lived in the home as your primary residence for at least two of those five years. The months do not need to be consecutive.

You can only claim the full exclusion once every two years. If you already used it on another home within the prior two years, you are not eligible for the full benefit again.3Office of the Law Revision Counsel. 26 US Code 121 – Exclusion of Gain From Sale of Principal Residence

Partial Exclusion for an Early Sale

If you sell before hitting the two-year marks, you may still qualify for a prorated exclusion when the sale was driven by a job relocation, a health condition, or an unforeseeable event such as a natural disaster, divorce, or job loss. For a work-related move, the new workplace generally needs to be at least 50 miles farther from the home than your old workplace was. Health-related moves include relocations to obtain medical care for yourself or a family member.4Internal Revenue Service. Publication 523 – Selling Your Home – Section: Partial Exclusion of Gain The exclusion is prorated based on the fraction of the two-year requirement you completed.

Surviving Spouse

A widow or widower can still claim the full $500,000 joint exclusion if they sell within two years of the spouse’s death, have not remarried by the closing date, and meet the ownership and use requirements (the deceased spouse’s time in the home counts).5Internal Revenue Service. Publication 523 – Selling Your Home – Section: Exclusion Amount After that two-year window, the surviving spouse drops to the $250,000 cap.

Short-Term Versus Long-Term Rates

How long you owned the property before selling determines which rate schedule applies, and the difference is substantial.

Property held for one year or less produces a short-term gain, taxed as ordinary income at your marginal rate, which can reach 37 percent for 2026.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses7Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 Flipping a property quickly carries a real cost.

Property held for more than one year qualifies for the preferential long-term capital gains rates of 0, 15, or 20 percent.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses Your rate depends on your total taxable income and filing status. For 2026:8Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates

  • 0 percent applies to taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household).
  • 15 percent applies above those amounts up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household).
  • 20 percent applies to taxable income above the 15-percent thresholds.

Most homeowners and middle-income investors land at 15 percent. The 0 percent rate is realistic for retirees or anyone in a lower-income year, which is worth factoring into the timing of a sale if you have flexibility.

The 3.8 Percent Net Investment Income Tax

Higher earners face an additional 3.8 percent surtax on top of the regular rate. The net investment income tax (NIIT) applies when modified adjusted gross income exceeds $200,000 for single filers, $250,000 for married couples filing jointly, or $125,000 for married filing separately.9Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax

The 3.8 percent applies to the lesser of your net investment income or the amount by which your income exceeds the threshold. A married couple with $300,000 in modified adjusted gross income and a $100,000 capital gain pays the surtax on $50,000, not the full gain. Combined with the 20 percent long-term rate, the effective federal ceiling on real estate gains reaches 23.8 percent. These thresholds are not indexed to inflation, so more taxpayers cross them each year.

A key carve-out: profit from selling your primary home that falls within the Section 121 exclusion is not treated as net investment income. The NIIT reaches only the gain that actually shows up as taxable income on your return.

Depreciation Recapture on Rentals and Other Investment Property

Selling investment property brings a tax layer that does not exist for a personal residence. If you deducted depreciation on the building each year (and the IRS assumes you did, even if you forgot to claim it), the portion of your gain attributable to those deductions is taxed at a maximum federal rate of 25 percent rather than the regular long-term capital gains rates.6Internal Revenue Service. Topic No. 409, Capital Gains and Losses

An example. You bought a rental for $300,000, with $240,000 allocated to the building and $60,000 to land (land is not depreciable). Over ten years, you claimed $87,273 in depreciation using the standard 27.5-year schedule for residential rental property. Your adjusted basis is now $212,727. Sell for $400,000 and your total gain is $187,273. Of that, $87,273 is “unrecaptured Section 1250 gain” taxed at up to 25 percent, and the remaining $100,000 is taxed at your regular long-term capital gains rate of 0, 15, or 20 percent.10Internal Revenue Service. Publication 544 – Sales and Other Dispositions of Assets

Landlords who never claimed depreciation deductions still owe recapture tax on the depreciation they were entitled to take. The IRS does not give you credit for skipping a deduction you were allowed. This catches some sellers off guard.

Deferring the Tax With a 1031 Exchange

A like-kind exchange under Section 1031 lets you sell investment or business real estate and defer the entire capital gains tax by reinvesting the proceeds into another qualifying property. The replacement property must also be held for investment or business use. Your personal residence does not qualify.11Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment

“Like-kind” is broader than it sounds. An apartment building can be exchanged for vacant land, a warehouse, or a strip mall. The properties just need to be real property within the United States held for investment or business purposes.12Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031

The deadlines are strict and cannot be extended for hardship:

  • 45-day identification window: you must identify potential replacement properties in writing within 45 calendar days of closing on the property you sold.
  • 180-day completion deadline: you must close on the replacement property within 180 calendar days of the original sale, or by the due date of your tax return for that year (including extensions), whichever comes first.

Miss either deadline and the entire gain becomes taxable. Most exchanges use a qualified intermediary to hold the proceeds, because touching the cash yourself disqualifies the exchange. The tax is deferred, not eliminated. Your basis in the new property carries over from the old one, so the bill follows you until you sell without exchanging (or pass the property to heirs, who receive a stepped-up basis).11Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment

Basis Rules for Inherited and Gifted Property

If you did not buy the property on the open market, your starting basis follows different rules, and the gap between them is enormous.

When you inherit real estate, your basis resets to the fair market value on the date the previous owner died.13Office of the Law Revision Counsel. 26 US Code 1014 – Basis of Property Acquired From a Decedent If your parent bought a house in 1985 for $80,000 and it was worth $400,000 when they died, your basis is $400,000. Sell it soon after for $410,000, and your taxable gain is $10,000. The decades of appreciation during your parent’s lifetime are wiped clean for capital gains purposes.

Gifts work the opposite way. When someone gives you real estate while still living, you take over the donor’s original basis.14Office of the Law Revision Counsel. 26 US Code 1015 – Basis of Property Acquired by Gifts and Transfers in Trust Same facts: your parent gifts you the $80,000 house now worth $400,000. Your basis is $80,000. Sell for $410,000 and you owe tax on $330,000 of gain. Families who understand the difference between inheriting and receiving a gift can save tens of thousands.

Reporting the Sale

Even when no tax is owed, the IRS expects to see the transaction on your return. The closing agent or title company files Form 1099-S reporting the gross proceeds to you and the IRS.15Internal Revenue Service. Instructions for Form 1099-S – Proceeds From Real Estate Transactions You report the details on Form 8949, entering the acquisition date, sale date, proceeds, and cost basis.16Internal Revenue Service. Instructions for Form 8949 Totals flow to Schedule D of your Form 1040.

Homeowners who qualify for the full Section 121 exclusion and whose gain falls entirely within the excluded amount may not need to report the sale at all, provided no Form 1099-S was issued. If a 1099-S was issued, report the sale on Form 8949 and claim the exclusion there so the IRS can see why no tax is owed.

If the buyer pays you over multiple years through seller financing, you report the gain as you receive the payments. Use Form 6252 to calculate the taxable portion of each installment.17Internal Revenue Service. About Form 6252, Installment Sale Income Spreading the gain across several years can keep you in a lower bracket.

Do Not Forget State Tax

Federal is only part of the picture. Most states tax capital gains as ordinary income, so your real estate profit may face state tax at rates that vary widely. A handful of states impose no income tax at all; others apply top rates above 10 percent. A few states offer preferential treatment for long-term gains or partial exclusions, but that is the exception. Factor your state’s rate into any projection before deciding when, or whether, to sell.