Capital Gains Tax on Real Estate: Home vs Rental
Selling real estate can generate a large taxable gain — but how much you owe to the federal government depends heavily on one question: was it your home or an investment property?
The difference between a primary residence and a rental property in the eyes of the IRS can be worth hundreds of thousands of dollars in tax savings. Understanding the rules before you sell gives you time to plan. Use the Real Estate Capital Gains Tax Calculator to model your specific scenario.
How to Calculate Your Basis
Before you can determine your capital gain, you need to establish your cost basis — what you effectively paid for the property, adjusted for certain costs and improvements.
Cost Basis = Purchase Price + Buying Closing Costs + Capital Improvements
Buying closing costs that add to basis include title insurance, attorney fees, recording fees, transfer taxes, and survey costs. Prepaid interest (points used to reduce your rate) may or may not be added to basis depending on how they were treated at the time — consult IRS Publication 523 for specifics.
Capital improvements are expenditures that add value, extend the property's useful life, or adapt it to a new use. A new roof, an added bathroom, a finished basement, or a central air system all add to basis. Routine repairs and maintenance — painting, fixing a leak, replacing a broken appliance — do not.
Adjusted sale proceeds subtract the costs of selling from your gross sale price:
Adjusted Proceeds = Sale Price − Selling Costs
Selling costs typically include real estate commissions (5–6%), title and escrow fees, transfer taxes, attorney fees, and seller concessions. On a $450,000 sale with 6% in selling costs, your adjusted proceeds are $423,000.
Capital Gain = Adjusted Proceeds − Cost Basis
If your adjusted proceeds exceed your cost basis, you have a gain. If they're less, you have a loss — and real estate losses on personal residences are generally not deductible (rental property losses follow different rules).
The Primary Residence Exclusion (Section 121)
Section 121 of the tax code allows homeowners to exclude a substantial gain from federal income tax when they sell their primary home. It's the most valuable tax break most Americans will ever use.
The Exclusion Amounts
- Single filer: Exclude up to $250,000 of gain
- Married Filing Jointly: Exclude up to $500,000 of gain
These amounts have not been indexed for inflation since 1997, which means they cover less of typical home appreciation than they once did — especially in high-cost markets.
The 2-of-5 Year Test
To qualify, you must have both owned and used the home as your primary residence for at least 2 of the 5 years immediately preceding the sale. The two years don't need to be consecutive, and the periods of ownership and use can overlap.
A common planning move: if you've been renting out a former primary residence, you have a window to move back in and re-establish the 2-year use test before selling.
Partial Exclusions
If you fail the full 2-year test, you may still qualify for a partial exclusion if the sale was due to a qualifying unforeseen circumstance: a change in employment, a health condition, or other events deemed qualifying by the IRS (divorce, death of a co-owner, natural disaster, etc.). The partial exclusion is prorated based on your qualifying time relative to 24 months.
Use the Real Estate Capital Gains Tax Calculator to see what happens when you enter partial primary residence years.
Rental Properties: A Different Story
Rental properties are treated as investments, not personal residences, and come with a different (and often less favorable) tax treatment.
No Section 121 Exclusion
The Section 121 exclusion is only available for your principal residence. If you sell a rental property you've never lived in, the full gain is taxable (subject to long-term rates if held over a year, or ordinary income rates if held a year or less).
Depreciation Recapture
This is a surprise cost many first-time investors don't anticipate. When you own rental property, you can deduct depreciation each year (typically over 27.5 years for residential real estate). When you sell, the IRS recaptures that depreciation — taxing it at a special rate of up to 25%, even if the rest of your gain qualifies for the 0% or 15% long-term rate.
Example: You bought a rental for $300,000, allocated $250,000 to the building (depreciable), and held it for 10 years. Annual depreciation is approximately $9,090. After 10 years, you've taken $90,900 in depreciation deductions. When you sell, that $90,900 is taxable at up to 25%, regardless of your overall income level.
Depreciation recapture can add thousands to your tax bill. The Real Estate Capital Gains Tax Calculator focuses on federal LTCG rates and doesn't separately calculate depreciation recapture — consult a tax professional for a full rental property analysis.
Short-Term vs Long-Term: A Big Difference
How long you hold a property before selling dramatically affects your tax rate.
Short-term gains (property held 12 months or less) are taxed at ordinary income rates — the same rates applied to your salary. Depending on your income, this can be as high as 37%.
Long-term gains (held more than 12 months) qualify for preferential rates:
| Income Level | Long-Term Rate |
|---|---|
| Low | 0% |
| Middle | 15% |
| High | 20% |
The 0% bracket is available to single filers with total taxable income under approximately $48,350 and married filers under approximately $96,700. Many retirees with modest income can sell appreciated property entirely tax-free by timing the sale for a lower-income year.
Why holding over a year matters: Suppose you bought a property for $300,000 and sold it for $420,000 after 11 months. Your $120,000 gain at a 24% ordinary rate costs $28,800. Wait one more month, and the same gain at 15% costs just $18,000 — a $10,800 difference.
Deferral Strategies: 1031 and Opportunity Zones
Paying the tax isn't your only option. Two strategies allow real estate investors to defer — or potentially eliminate — capital gains tax.
1031 Exchange
Under IRC Section 1031, you can defer all capital gains tax by reinvesting your proceeds into a like-kind replacement property. The rules:
- Identify replacement property within 45 days of your sale closing
- Close on the replacement within 180 days
- All proceeds must flow through a qualified intermediary — you cannot receive the cash directly
- The replacement property must be of equal or greater value to defer 100% of the gain
The tax isn't forgiven — it's deferred into the basis of the new property. But many investors use "swap till you drop" strategies: repeat 1031 exchanges over decades, then pass the property to heirs at a stepped-up basis, eliminating the deferred gain entirely.
Qualified Opportunity Zones
Investing your capital gain into a Qualified Opportunity Fund (QOF) within 180 days of the sale can defer the original gain and — if the investment is held for 10+ years — potentially eliminate all tax on appreciation inside the fund. The QOZ program has been extended and modified, and its full benefits depend on current legislation and proper fund structuring.
Conclusion
Selling real estate triggers a tax event that can range from zero (primary residence exclusion fully covers your gain) to tens of thousands of dollars (rental property held short-term). The most important planning steps are:
- Calculate your basis accurately — don't forget improvements
- Know your holding period — short-term vs long-term is often worth waiting for
- Check your Section 121 eligibility — even partial eligibility can save thousands
- Model deferral strategies before closing — 1031 and QOZ require advance planning
Run your numbers now with the Real Estate Capital Gains Tax Calculator to see your estimated federal tax, effective rate, and how different scenarios compare.
Related tools: Investment Property Mortgage Calculator | 1031 Exchange Tax Calculator
Principal Residence Exemption: Sell Your Home Tax-Free in Canada
A complete guide to the Canadian principal residence exemption. Covers the exemption formula, the +1 rule, designation rules, partial exemptions, flipped property, and Schedule 3 reporting.
DTI for Real Estate Investors: How Much Can You Borrow
Learn how debt-to-income ratio works for real estate investors, how lenders count rental income, and how to calculate your maximum borrowing power.
