When you sell real estate at a profit, the federal government taxes the gain at 0%, 15%, or 20% if you owned the property longer than a year, and at ordinary income rates up to 37% if you owned it a year or less. If the property was your main home, you can exclude up to $250,000 of that profit as a single filer or $500,000 as a married couple filing jointly. Rental properties trigger a separate depreciation recapture tax of up to 25%, and high earners pay an extra 3.8% surtax on top of their regular rate. The capital gains tax on real estate is calculated on your profit after basis and selling costs, not the sale price, so what you can document matters as much as what you sold for.
How Your Taxable Gain Is Calculated
Your gain is the amount realized minus your adjusted basis. Amount realized is the sale price minus selling expenses. Adjusted basis is what you paid for the property, plus qualifying improvements, minus any depreciation you claimed or should have claimed.
Basis begins with the purchase price plus certain closing costs: title insurance, recording fees, survey fees, and transfer taxes. Mortgage-related costs (loan origination fees, lender-required appraisals, mortgage insurance premiums) do not count. Over the years you owned the property, capital improvements add to basis. The IRS treats an expenditure as an improvement if it creates a betterment to the property, restores a major component, or adapts the property to a new use. A new roof, an added bedroom, a full HVAC replacement, or a new deck qualify. Routine maintenance like patching drywall or repainting does not.1Internal Revenue Service. Tangible Property Final Regulations
Keep every invoice. A documented $40,000 kitchen remodel cuts your taxable gain by $40,000. Without receipts, that reduction disappears in an audit.
Selling expenses come off the sale price before the gain calculation. The real estate agent’s commission is usually the biggest one, followed by legal fees, title search fees, escrow and settlement fees, advertising, transfer taxes, and any recording fees the seller pays.2Internal Revenue Service. Publication 523 – Selling Your Home Prep work like carpet cleaning or landscaping to make the home show better does not count as a selling expense.
Federal Rates on the Gain
The rate depends on how long you owned the property. One year is the dividing line.
Property held for a year or less produces short-term capital gain, taxed at your ordinary income rate. For 2026 those rates run from 10% to 37%.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses Short-term treatment mostly hits house flippers.
Property held longer than a year gets long-term rates of 0%, 15%, or 20% based on your taxable income. For 2026, the 0% rate applies up to $49,450 for single filers, $98,900 for joint filers, and $66,200 for heads of household. The 15% rate covers income up to $545,500 single, $613,700 joint, and $579,600 head of household. Above those ceilings, the rate is 20%.4Internal Revenue Service. Rev. Proc. 2025-32 Most sellers land in the 15% bracket.
The 3.8% Surtax for Higher Earners
The Net Investment Income Tax adds 3.8% on top of the capital gains rate when your modified adjusted gross income exceeds $200,000 single, $250,000 joint, or $125,000 married filing separately. The surtax applies to the lesser of your net investment income or the amount you exceed the threshold.5Internal Revenue Service. Questions and Answers on the Net Investment Income Tax A joint-filing couple with $300,000 in modified AGI and a $100,000 gain would pay the 3.8% surtax on $50,000 (the amount over $250,000). Combined with the 15% long-term rate, their federal rate on that slice is 18.8%.
The Primary Residence Exclusion
The single biggest tax break on a home sale is the Section 121 exclusion. If the property was your main home, you can exclude up to $250,000 of gain as a single filer or $500,000 as a joint filer. To qualify, you need to pass both an ownership test and a use test during the five-year period ending on the sale date:
- Ownership: you owned the home for at least 24 months (730 days) during that five-year window.
- Use: you lived in the home as your primary residence for at least 24 months during that same window.
The 24 months do not have to run back-to-back. You could live there a year, move out for two years, return for another year, and still qualify.2Internal Revenue Service. Publication 523 – Selling Your Home Any gain above the exclusion is taxable at the long-term rates.6Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
You generally cannot claim the exclusion more than once every two years. For a couple to claim the full $500,000, both spouses must meet the use test, at least one must meet the ownership test, and neither can have used the exclusion on a different home in the prior two years.
If the IRS questions whether the property really was your main home, utility bills, voter registration, and mail delivery records serve as evidence. The test is where you actually lived, not where you intended to live.
Partial Exclusion If You Sell Early
Selling before hitting two years does not automatically wipe out the exclusion. If the sale was driven primarily by a work-related move (new job at least 50 miles farther from the home than your prior workplace), a health-related move (medical care for you or a family member, or a doctor-recommended relocation), or an unforeseeable event (destruction of the home, condemnation, unemployment eligibility, divorce, multiple births from the same pregnancy, and others), a prorated exclusion applies.2Internal Revenue Service. Publication 523 – Selling Your Home
Take the shorter of your ownership or use period, divide by 24 months, and multiply by $250,000 or $500,000. Fifteen months of use before a qualifying job relocation gives a single filer 15 ÷ 24 × $250,000 = $156,250 of excluded gain.
Surviving Spouses
A surviving spouse who has not remarried can claim the full $500,000 exclusion on a sale within two years of the spouse’s death, and can count the deceased spouse’s ownership and use time toward the tests. After the two-year window closes, the exclusion drops to the $250,000 single-filer amount.
Divorce
When a home transfers between spouses or ex-spouses in a divorce, the receiving spouse inherits the transferor’s ownership period. You still have to meet the use test on your own by actually living in the home for two of the five years before the sale.6Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Depreciation Recapture on Rentals and Business Use
If you rented the property or used part of it for business and took depreciation deductions, the IRS pulls some of that benefit back at sale. Depreciation you claimed is recaptured and taxed at a maximum federal rate of 25%, no matter what your regular capital gains bracket is. This is called unrecaptured Section 1250 gain.3Internal Revenue Service. Topic No. 409, Capital Gains and Losses
The trap: even if you never actually claimed depreciation on your returns, the IRS treats it as taken. Skipping depreciation on a rental for years does not spare you recapture. Your basis is reduced by the depreciation you should have claimed regardless of whether you did.
The 25% rate is a ceiling. If your ordinary rate is lower, you pay the lower rate. Higher-income sellers may also owe the 3.8% NIIT on the recapture portion.
Inherited Real Estate
When you inherit real estate, your basis is not what the deceased paid. It resets to the property’s fair market value on the date of death.7Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A parent who bought a house in 1985 for $80,000 leaves you a $450,000 basis if that is what it was worth at their death. Sell for $460,000 and your taxable gain is $10,000, not $380,000.
This step-up applies automatically whether you live in the property or not. To also use the Section 121 exclusion, though, you would need to move in and meet the same two-year ownership and use tests. Simply inheriting and selling does not qualify for the exclusion.
1031 Exchanges for Investment Property
Section 1031 lets you defer the entire gain on investment or business real estate by rolling proceeds into a replacement property of like kind. The tax is not forgiven, only postponed until you eventually sell without another exchange. Investors sometimes chain exchanges for decades, and a step-up in basis at death can wipe out the deferred gain entirely.8Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment
The deadlines are strict. You must identify replacement properties in writing within 45 days of the sale and close within 180 days (or by your tax return due date including extensions, if sooner). Missing the 45-day identification window by a single day makes the full gain taxable.9Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031
A qualified intermediary must hold the sale proceeds. If you touch the cash, even briefly, the exchange fails on constructive receipt grounds. The intermediary cannot be your attorney, accountant, or agent. Both properties must be held for investment or business use. A 1031 exchange cannot be used on your personal residence, and does not apply to property held primarily for resale.
Foreign Sellers and FIRPTA
If you are a foreign national or nonresident alien selling U.S. real estate, the buyer is required to withhold 15% of the total sale price at closing and send it to the IRS.10Internal Revenue Service. FIRPTA Withholding This is a prepayment, not the final tax. You file a U.S. return for the year and claim a refund if the actual tax owed is less. If the buyer fails to withhold, the buyer becomes personally liable for the tax.
State Tax and Transfer Taxes
Federal tax is only part of the bill. Most states also tax capital gains, generally at their ordinary income rates. State rates run from 0% in states with no income tax to over 13% in the highest-tax states, and about eight states impose no capital gains tax at all. The combined federal and state rate on a real estate gain can top 30% for high earners in high-tax states.
Some jurisdictions also charge a real estate transfer tax at closing, ranging from nothing to several percent of the sale price. Transfer taxes paid by the seller are deductible as a selling expense, which reduces the federal gain.
Paying the Tax Before You File
If a sale leaves you owing $1,000 or more after withholding and refundable credits, you may need to make an estimated tax payment before your return is due. Waiting until April can trigger underpayment penalties.11Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.
You can avoid the penalty if your total payments cover at least 90% of the current year’s tax or 100% of last year’s tax (110% if your prior-year AGI exceeded $150,000).12Internal Revenue Service. Topic No. 306, Penalty for Underpayment of Estimated Tax If you have wages, bumping your W-4 withholding for the rest of the year is often easier than sending a separate estimated payment.
Installment Sales
When the buyer pays you over several years instead of at closing, you recognize gain proportionally as payments arrive. Reporting the gain in slices can keep you in lower brackets than recognizing it all in one year.13Internal Revenue Service. Topic No. 705, Installment Sales Installment reporting is the default any time at least one payment comes after the year of sale, reported on Form 6252. You can elect out to recognize the full gain upfront, but that election is generally irrevocable once filed. Depreciation recapture is an exception: it is fully taxable in the year of sale regardless of when payments come.
Reporting the Sale
Your closing agent will typically issue Form 1099-S reporting the gross sale proceeds to you and the IRS.14Internal Revenue Service. Instructions for Form 1099-S Even if the Section 121 exclusion wipes out your gain, if you received a 1099-S you still need to report the sale.
Three forms handle most sales. Form 8949 lists the property, acquisition date, sale date, sale price, and adjusted basis.15Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets Schedule D summarizes all your capital gains and losses for the year, pulling totals from Form 8949. Form 6252 is required only for installment sales that span multiple tax years.
Filing runs on the normal January-through-April schedule for the year after the sale. Filing late while owing tax adds a failure-to-file penalty plus interest on the balance.