Capital Gains Tax on Real Estate Calculator
Estimate taxable gain, home-sale exclusion, depreciation recapture, federal long-term capital gains tax, and potential net investment income tax for a property sale. This calculator is designed for educational planning and gives a practical estimate based on common U.S. rules.
How to calculate capital gains tax on real estate
When you sell real estate for more than your adjusted basis, the difference can create a capital gain. For many property owners, the hardest part is not the tax rate itself. The real challenge is determining the correct gain amount after accounting for purchase price, capital improvements, selling costs, depreciation, and any home-sale exclusion that may apply. If you want to calculate capital gains tax on real estate with confidence, you need a methodical process that separates the economic profit from the taxable profit recognized by the IRS.
This calculator gives you a practical estimate using common federal rules in the United States. It can be useful whether you are selling a primary residence, a rental property, or a second home. It also highlights an important distinction: a homeowner may qualify for the Section 121 home-sale exclusion, while an investor usually does not. On top of that, rental property owners may have depreciation recapture, which is often taxed differently from the rest of the gain.
For official guidance, consult the IRS Topic No. 701 on sale of your home, the IRS Publication 523, and educational materials from institutions such as University of Minnesota Extension for broader tax-planning concepts. These sources provide the legal framework, while this page helps you build a usable estimate.
The basic formula behind real estate capital gains
At a high level, the calculation follows this sequence:
- Start with the sale price.
- Subtract eligible selling costs to arrive at net proceeds.
- Determine adjusted basis by starting with the original purchase price, then adding capital improvements and subtracting depreciation claimed.
- Subtract adjusted basis from net proceeds to get total gain.
- If the property is a qualifying primary residence, subtract any available home-sale exclusion.
- Separate depreciation recapture from the remaining gain for tax-rate purposes.
- Apply the estimated long-term capital gains rate, and if applicable, the estimated 25% federal rate on depreciation recapture.
That sequence explains why two homeowners who sell for the same price can end up with very different tax bills. One may have a high adjusted basis because of extensive improvements and significant closing costs. Another may have claimed years of rental depreciation, which lowers basis and increases taxable gain. A third may qualify for the exclusion and owe nothing at the federal level.
What counts toward your adjusted basis
Your adjusted basis generally begins with your purchase price, but it does not stay fixed forever. It changes over time. You may add the cost of qualifying capital improvements such as a room addition, a kitchen remodel, a new roof, or a major HVAC replacement if those expenses improve the property, prolong its life, or adapt it to new uses. Routine repairs like patching a small leak or repainting a room usually do not increase basis.
Basis can also be reduced. Depreciation is the most common reduction for rental or business-use property. If you rented out the home and claimed depreciation, the IRS generally expects that amount to reduce basis even if your recordkeeping was not perfect. That matters because depreciation often comes back into the tax picture as recapture when the property is sold.
Primary residence exclusion: one of the most valuable tax breaks
If you are selling your main home, federal law may allow you to exclude up to $250,000 of gain if you are single or up to $500,000 if you are married filing jointly, provided you meet the ownership and use tests. In general, you must have owned the home and used it as your main home for at least two years during the five-year period ending on the date of sale. The two years do not need to be continuous.
This exclusion is a major reason many homeowners pay little or no federal capital gains tax after selling a principal residence. However, not every gain qualifies. Depreciation claimed after May 6, 1997 for business or rental use generally cannot be excluded under the home-sale exclusion rules. That portion may still be taxed as recapture.
| Filing status | Maximum Section 121 exclusion | Typical qualifying requirement | Important limitation |
|---|---|---|---|
| Single | $250,000 | Owned and lived in the home at least 2 of the last 5 years | Cannot exclude depreciation recapture |
| Married filing jointly | $500,000 | Generally both spouses meet use test and one meets ownership test | Cannot exclude depreciation recapture |
| Head of household | $250,000 | Uses the single-taxpayer exclusion framework in many common cases | Cannot exclude depreciation recapture |
| Married filing separately | $250,000 | Individual qualification rules matter closely | Cannot exclude depreciation recapture |
Federal long-term capital gains tax rates and income thresholds
After determining the taxable portion of the gain, the next step is estimating the rate. Long-term gains usually apply when the property has been held for more than one year. The federal long-term capital gains rates are commonly 0%, 15%, or 20%, depending on filing status and taxable income. Many taxpayers fall into the 15% bracket, but high-income households may be pushed into the 20% bracket. Some taxpayers may also owe the 3.8% Net Investment Income Tax, often called NIIT, if income exceeds specific thresholds.
The calculator on this page uses simplified threshold logic to provide an estimate. Because tax brackets can change over time, you should verify the current year thresholds before filing. That said, using a reasonable estimate while planning a sale can still help you decide when to sell, whether to bunch income into a different year, and whether to defer a disposition.
| Federal tax concept | Common rate or threshold reference | Why it matters to property sellers | Planning takeaway |
|---|---|---|---|
| Long-term capital gains | 0%, 15%, or 20% depending on taxable income | Applies to gain on property held more than one year | Income management can change your effective tax cost |
| Depreciation recapture | Up to 25% federally | Common on rental and mixed-use real estate | Do not assume the full gain gets the lower capital gains rate |
| Net Investment Income Tax | 3.8% above common MAGI thresholds such as $200,000 single and $250,000 married filing jointly | Can increase total tax on investment property sales | High-income sellers should model NIIT separately |
| Home-sale exclusion | $250,000 single or $500,000 married filing jointly | Can eliminate a large portion of gain on a principal residence | Residency history and timing are critical |
Step-by-step example
Suppose you bought a home for $300,000, later spent $40,000 on qualifying improvements, and sold it for $550,000. Assume selling costs were $35,000. If you never used it as a rental and claimed no depreciation, your adjusted basis would be $340,000. Your net sale proceeds would be $515,000. Your total gain would therefore be $175,000.
If the property was your primary residence and you meet the ownership and use tests, the federal exclusion may shelter the entire $175,000 gain. In that case, your estimated federal capital gains tax would be $0. If the same property were instead a second home, no primary residence exclusion would apply, and the gain would likely be taxed using the long-term capital gains rate based on your taxable income.
Now consider a rental property. If you claimed $30,000 of depreciation over the years, your adjusted basis drops further, increasing total gain. In many cases, up to $30,000 may be subject to depreciation recapture at a rate up to 25%, while the remaining long-term gain is taxed separately at 0%, 15%, or 20%. This is why rental sales can produce a noticeably larger tax bill than a similar sale of a main home.
Common mistakes when trying to calculate capital gains tax on real estate
- Ignoring selling costs. Broker commissions and other transaction costs can significantly reduce gain.
- Confusing repairs with improvements. Only qualifying capital improvements generally increase basis.
- Forgetting depreciation. Rental owners often underestimate how much depreciation reduces basis.
- Assuming the full gain is excluded. The primary residence exclusion does not usually remove depreciation recapture.
- Missing the residency timing rules. Living in a home briefly near the time of sale is not always enough.
- Forgetting state taxes. Many states tax capital gains, and the state bill can materially change your net proceeds.
- Using gross income instead of taxable income. Federal long-term capital gains rate estimates rely on income thresholds that are often compared with taxable income or modified income concepts.
Special situations that can change the result
Inherited property
Inherited real estate often receives a step-up in basis to fair market value at the decedent’s date of death, subject to applicable rules. That can greatly reduce gain if the property is sold soon after inheritance. If you are calculating tax on an inherited house, do not simply use the original purchase price paid decades ago by the prior owner.
Gifted property
Gift basis rules are more complex. In many cases, the recipient takes over the donor’s basis, which can create a larger gain than expected. This is one area where careful documentation is essential.
Like-kind exchange history
If the property was involved in a prior Section 1031 exchange, your carryover basis may produce a gain that looks surprisingly high. You need the complete basis chain, not just the amount you invested in the latest acquisition.
Mixed-use property
Some owners live in one portion of a property and rent out another. Others convert a former residence into a rental before sale. In these cases, basis, depreciation, allocation, and exclusion calculations can become more technical. The estimate from an online calculator is still useful, but professional review becomes more important.
How to reduce real estate capital gains tax legally
- Keep detailed records. Maintain receipts, settlement statements, invoices, and depreciation schedules.
- Maximize basis correctly. Include qualifying improvements and capitalized acquisition or disposition costs where allowed.
- Time the sale strategically. Waiting until you cross the one-year holding period may convert short-term gain into long-term gain.
- Evaluate the home-sale exclusion. If the property can qualify as your principal residence under the rules, the tax savings may be substantial.
- Manage taxable income. Lower income in the year of sale can sometimes reduce the long-term capital gains rate or NIIT impact.
- Explore deferral tools. Investors may consider a 1031 exchange where eligible, although rules and deadlines are strict.
Why this calculator is useful for planning
A good estimate can help you answer practical questions before you list the property. How much cash will you likely net after federal tax? Is a sale this year better than next year? Would renovating before sale improve your after-tax outcome, or would it simply increase cost without enough return? Should you reserve a larger amount for taxes because depreciation recapture is involved? These are planning questions, not just filing questions, and they can influence negotiations, pricing, and timing.
This calculator is especially helpful because it separates the building blocks of the tax outcome. Instead of showing only one final number, it displays your adjusted basis, net proceeds, total gain, exclusion amount, recapture tax estimate, long-term capital gains estimate, and total estimated federal tax. That makes it easier to see what is driving your result.
Final takeaway
To calculate capital gains tax on real estate accurately, begin with the correct basis, subtract valid selling costs, identify whether the property is a primary residence or investment property, and then apply the right tax treatment to each component of gain. The process is simple in concept but detail-heavy in practice. Even a small basis adjustment or missed exclusion can change your tax by thousands of dollars.
Use the calculator above to build a working estimate, then compare your assumptions against official IRS guidance and your own settlement documents. If the sale involves depreciation, mixed use, inheritance, gifting, or a prior exchange, consider speaking with a qualified tax advisor before closing. Good planning before the sale is almost always more valuable than trying to fix surprises afterward.