/* Legacy content CSS (original compiled Tailwind v4) - static, loads first */
Real Estate Tax15 min readAugust 2, 2026

Capital Gains Tax on Real Estate: Selling Property Without Losing Your Profit

Complete guide to capital gains tax on real estate. Learn Section 121 exclusion, 1031 exchanges, depreciation recapture, and strategies to minimize tax when selling property.

Capital Gains Tax on Real Estate: Selling Property Without Losing Your Profit

🏠 What Is capital gains tax on real estate?

Capital gains tax on real estate is the tax you owe when you sell a property for more than you paid for it. Unlike stocks, real estate transactions involve larger dollar amounts, more complex calculations, and several special exclusions that can dramatically reduce or even eliminate your tax bill. Whether you are selling your primary residence, a rental property, or a piece of vacant land, the IRS has specific rules that determine how much tax you owe.

Capital Gains Tax on Real Estate: Selling Property Without Losing Your Profit

The calculation starts the same way as with any capital asset: you take the sale price, subtract your cost basis, and the difference is your gain. But with real estate, your cost basis is not just the purchase price. It includes closing costs, improvements you made to the property, and certain legal fees. It also gets reduced by any depreciation you claimed over the years, which can result in a surprisingly large tax bill when you finally sell. Understanding capital gains tax on inherited property is also important if you acquired the property through inheritance, because the step-up in basis rules work very differently.

Real estate is unique among capital assets because the IRS provides several special tax breaks that are not available for stocks, bonds, or other investments. The Section 121 exclusion allows you to exclude up to USD 250,000 of gain on your primary residence, or USD 500,000 if you are married filing jointly. The 1031 exchange allows you to defer taxes entirely on investment property by reinvesting the proceeds into another property. And Opportunity Zone investments can reduce and potentially eliminate capital gains tax on certain real estate gains. These provisions make real estate one of the most tax-advantaged investments available.

πŸ“Š How to Calculate Real Estate Capital Gains

Calculating your capital gain on a real estate sale requires you to determine two numbers: your adjusted cost basis and your net sale proceeds. Your adjusted cost basis starts with the original purchase price and is adjusted upward by improvements and downward by depreciation. Your net sale proceeds are the sale price minus selling costs like real estate commissions, transfer taxes, and closing fees.

Here is a concrete example. Suppose you bought a rental property for USD 300,000 and paid USD 5,000 in closing costs. Over the years, you spent USD 40,000 on a new roof and USD 15,000 on a kitchen renovation. You also claimed USD 80,000 in depreciation over the years you rented it out. Your adjusted cost basis is USD 300,000 plus USD 5,000 plus USD 40,000 plus USD 15,000 minus USD 80,000, which equals USD 280,000. If you sell the property for USD 500,000 and pay USD 30,000 in commissions and closing costs, your net proceeds are USD 470,000. Your capital gain is USD 470,000 minus USD 280,000, which equals USD 190,000.

But that USD 190,000 gain is not all taxed the same way. The USD 80,000 of depreciation you claimed is subject to depreciation recapture at a rate of 25 percent, not the regular capital gains rate. The remaining USD 110,000 is taxed as a long-term capital gain at 0, 15, or 20 percent depending on your income. This two-tier system is why real estate capital gains calculations are more complex than stock gains. For a detailed walkthrough, see our guide on how to calculate capital gains tax step by step.

Capital Gains Tax on Different Property Types

🏑 Section 121 Exclusion: Your Primary Residence Tax Break

The Section 121 exclusion is the most valuable tax break available to homeowners. If you have owned and lived in your home as your primary residence for at least two of the five years before the sale, you can exclude up to USD 250,000 of gain from your taxable income if you are single, or up to USD 500,000 if you are married filing jointly. This exclusion can be used once every two years, which means you could theoretically sell a primary residence every two years and never pay capital gains tax on the gains.

The two-year requirement does not have to be consecutive. You just need to have lived in the home for a total of 24 months out of the 60-month period ending on the date of sale. This means you could rent out your home for up to three years and still qualify for the exclusion, as long as you lived there for at least two years before that. For a deeper dive into the rules, our article on Section 121 exclusion when selling your home covers every detail and exception.

Section 121 Exclusion Savings for Married Couples

There are some situations where the exclusion does not apply or is reduced. If you used part of your home for business, you may need to allocate the exclusion between the business portion and the residential portion. If you moved out and rented the property for more than three years before selling, you lose the exclusion entirely. And if you are subject to the expatriate tax, you may not qualify for the exclusion at all. Always check the specific rules for your situation before assuming you qualify.

πŸ”„ Depreciation Recapture: The Hidden Tax on Rental Property

Depreciation recapture is one of the most misunderstood aspects of real estate taxation. When you own a rental property, the IRS allows you to deduct a portion of the property's value each year as depreciation. This deduction reduces your taxable rental income year after year, which is a significant tax benefit. But when you sell the property, the IRS wants that benefit back. They do this through depreciation recapture, which taxes the total amount of depreciation you claimed at a flat rate of 25 percent.

This applies regardless of whether you actually claimed the depreciation on your tax return. The IRS uses a concept called allowed or allowable depreciation, which means if you could have claimed depreciation but did not, you still have to pay recapture tax on it when you sell. This catches many landlords off guard, especially those who were not aware they should have been claiming depreciation all along. Our comprehensive guide on depreciation recapture tax when selling investment property explains how to calculate and plan for this often-overlooked tax.

The recapture tax only applies to the portion of your gain that is attributable to depreciation. If your total gain is USD 200,000 and you claimed USD 80,000 in depreciation, the first USD 80,000 is taxed at 25 percent (USD 20,000) and the remaining USD 120,000 is taxed at the long-term capital gains rate. This is why it is important to understand both components of your real estate gain before you sell.

πŸ” 1031 Exchange: Deferring Capital Gains Tax on Investment Property

A 1031 exchange allows you to sell an investment property and defer the capital gains tax by reinvesting the proceeds into another investment property of equal or greater value. The name comes from Section 1031 of the Internal Revenue Code, which provides this tax deferral mechanism. This is not a tax elimination strategy; it is a tax deferral strategy. You will eventually owe the tax when you sell the replacement property, unless you do another 1031 exchange or hold the property until death, at which point your heirs receive a step-up in basis.

The rules for a valid 1031 exchange are strict. You must identify the replacement property within 45 days of selling the old property, and you must close on the replacement property within 180 days. The replacement property must be of like kind, which in real estate terms means any real property held for investment or business use qualifies. You can exchange a rental house for an apartment building, a commercial property for raw land, or vice versa. The key is that both properties must be held for investment or business purposes, not for personal use.

You also need to use a qualified intermediary to handle the exchange. The intermediary holds the proceeds from the sale and uses them to purchase the replacement property, ensuring that you never have constructive receipt of the funds. If you touch the money at any point, the entire exchange is disqualified and you owe tax on the full gain. For a detailed walkthrough of the process, read our guide on 1031 exchange rules to defer capital gains tax which covers every deadline, requirement, and pitfall.

πŸ—οΈ capital gains tax on rental property Sales

Selling a rental property triggers a more complex tax situation than selling your primary residence because you do not qualify for the Section 121 exclusion. The entire gain is taxable, and the depreciation recapture rules apply. This means rental property owners often face a higher effective tax rate on their gains than homeowners do.

The tax on a rental property sale is split into two components. The depreciation recapture portion is taxed at 25 percent, and the remaining gain is taxed at the long-term capital gains rate of 0, 15, or 20 percent. On top of that, you may owe the 3.8 percent net investment income tax if your income exceeds the threshold. For a single filer with USD 200,000 in rental property gains who claimed USD 80,000 in depreciation, the total federal tax could be around USD 48,000, not including state taxes. Our article on capital gains tax on rental property sales goes into much more detail on the calculations and planning strategies.

πŸ›‘οΈ Strategies to Minimize Real Estate Capital Gains Tax

There are several proven strategies for reducing the capital gains tax you owe when selling real estate. The most obvious is to qualify for the Section 121 exclusion by living in the property for two of the five years before the sale. If you are close to the two-year mark, it may be worth waiting to sell. If you have already moved out, you have a three-year window to sell before you lose the exclusion.

Steps to Minimize Real Estate Capital Gains Tax

For investment properties, the 1031 exchange is the gold standard for tax deferral. If you do not want to manage another property, you can exchange into a Delaware Statutory Trust, which allows you to own a fractional interest in institutional-grade real estate without the management responsibilities. Opportunity Zone investments are another option. By investing your gain into a Qualified Opportunity Fund, you can defer the tax on the original gain and potentially exclude up to 100 percent of the gain on the new investment if you hold it for at least 10 years.

Other strategies include the installment sale, which spreads the gain over multiple years and may keep you in a lower tax bracket. Charitable remainder trusts allow you to donate the property to a trust, receive income for life, and avoid capital gains tax on the sale by the trust. And for properties with significant appreciation, a like-kind exchange followed by converting the replacement property to a primary residence can combine the benefits of both the 1031 exchange and the Section 121 exclusion. Learn more about capital gains tax deferral strategies that work for real estate investors.

πŸ—ΊοΈ State Taxes on Real Estate Capital Gains

Do not forget that most states also tax capital gains on real estate sales. States like California, New York, and Hawaii have some of the highest combined tax rates in the country. A California resident selling a rental property with a USD 300,000 gain could owe over USD 60,000 in state tax alone on top of the federal tax. Meanwhile, residents of states with no income tax like Texas, Florida, and Washington only pay the federal rate.

Some states also have their own version of the Section 121 exclusion or 1031 exchange rules, which may differ from the federal rules. For example, some states do not conform to the federal 1031 exchange provisions and may tax the gain even if it is deferred for federal purposes. Always check your state's specific rules or consult a local tax professional. Our guide on state capital gains tax rates across the country provides a state-by-state comparison.

βœ… Key Takeaways for Real Estate Sellers

Selling real estate is one of the largest financial transactions most people will ever make, and the tax consequences can be significant. The key is to plan ahead. Know your cost basis, understand the depreciation recapture rules, and explore every available exclusion and deferral strategy before you list the property. The difference between a well-planned sale and a poorly planned one can be tens of thousands of dollars in taxes.

If you are selling your primary residence, make sure you qualify for the Section 121 exclusion. If you are selling an investment property, consider a 1031 exchange or Opportunity Zone investment. If you have significant depreciation recapture, plan for the 25 percent tax rate on that portion of your gain. And always, always factor in your state tax rate, which can add a substantial amount to your total bill. For a comprehensive overview of all capital gains tax topics, including capital gains tax on rental property sales and capital gains tax on vacant land and raw land sales, explore our full library of guides.

Fact-Checked & Reviewed

This article was written by David Chen (JD, LLM in Taxation (New York University)) and reviewed for accuracy by Sarah Mitchell (CPA, MST (Master of Science in Taxation)). Published by Wasim Akram, Founder & Lead Researcher at TaxGainsCalc. All tax rates, thresholds, and rules referenced are based on IRS publications and current tax law as of the date published. Tax laws change frequently β€” always consult a qualified tax professional for advice specific to your situation.

DC
Written by
David Chen

Tax Attorney & Legal Editor

David Chen is a tax attorney with a Juris Doctor and a Master of Laws in Taxation from New York University School of Law. With over 10 years of legal practice, he specializes in 1031 exchanges, capital gains tax law, and IRS dispute resolution. David...

JD, LLM in Taxation (New York University)LinkedInView full profile
SM
Reviewed by
Sarah Mitchell

Certified Public Accountant (CPA)

Sarah Mitchell is a Certified Public Accountant with over 15 years of experience in individual and business taxation. She holds a Master of Science in Taxation from Golden Gate University and specializes in capital gains tax planning, investment tax ...

CPA, MST (Master of Science in Taxation)LinkedInView full profile
Wasim Akram
Published by
Wasim Akram

Founder & Lead Researcher, TaxGainsCalc

Wasim Akram is an independent web publisher and digital entrepreneur based in India. Since 2018, he has been building custom CMS platforms, WordPress plugins, niche websites, and AI-powered digital products with over 8 years of real-world experience....

capital gains tax real estateselling property taxSection 121 exclusion1031 exchange real estatedepreciation recapture propertyreal estate capital gains 2026

Disclaimer: This article is for informational purposes only and does not constitute tax, legal, or financial advice. Tax laws and regulations change frequently, and the information presented here may not reflect the most current updates. You should consult with a qualified CPA, tax attorney, or financial advisor before making any tax-related decisions. TaxGainsCalc is not responsible for any actions taken based on the information provided in this article.

Continue Reading