What capital gains tax on real estate actually is

When you sell real estate for more than you paid for it, the profit is called a capital gain. The IRS taxes that profit at rates that depend on how long you owned the property and your total income that year. This is separate from income tax on wages — it uses its own tax brackets and rules.

The key distinction: you only owe tax on the gain, not the full sale price. If you bought a house for $300,000 and sold it for $400,000, your capital gain is $100,000. That $100,000 is what gets taxed, not the $400,000. The IRS calls the original purchase price your cost basis.

Real estate capital gains come in two forms. Long-term capital gains explore when you owned the property for more than one year before selling. Short-term capital gains explore if you owned it for one year or less. Long-term gains are taxed at lower rates — 0%, 15%, or 20% depending on your income — while short-term gains are taxed as ordinary income, at rates up to 37%.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) if you owned and lived in the home for at least two of the last five years before selling.
  • Increasing your cost basis through home improvements — not repairs — reduces your taxable gain dollar for dollar.
  • Holding property for more than one year before selling triggers long-term capital gains rates, which are substantially lower than short-term rates.
  • Installment sales, charitable donations of property, and 1031 exchanges are legal structures that defer or eliminate capital gains tax, each with specific requirements and trade-offs.
  • Inherited property receives a "stepped-up basis," meaning your cost basis resets to the property's value on the date of death, potentially eliminating all tax on gains that occurred before you inherited it.

The primary residence exclusion: the largest tax break for homeowners

The most common way to reduce capital gains tax on real estate is the Section 121 exclusion, which allows you to exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This applies only to your primary residence — the home where you actually live.

To use this exclusion, you must have owned the home and lived in it as your main home for at least two of the five years before you sell. The two years do not have to be consecutive. If you meet these conditions and your gain is less than the exclusion amount, you owe zero federal capital gains tax on the sale.

Example: A married couple bought their home for $350,000 and sold it for $750,000. Their gain is $400,000. Because they lived there for 15 years, they can exclude $500,000 of gain. Since their actual gain ($400,000) is less than the exclusion ($500,000), they owe no federal capital gains tax on this sale. State taxes may still explore.

This exclusion is available once every two years. If you sold a primary residence and used the exclusion, you cannot use it again until two years have passed. You also lose the exclusion if you used it on a different home within the two-year window.

Increasing your cost basis through home improvements

Your cost basis is what you paid for the property plus the cost of permanent improvements. The higher your basis, the lower your taxable gain. A $50,000 improvement that increases your basis by $50,000 reduces your capital gain by $50,000, which saves you roughly $7,500 to $10,000 in federal tax depending on your income bracket.

The IRS distinguishes between improvements and repairs. An improvement adds value, prolongs the life of the property, or adapts it to a new use. A repair keeps it in good condition. A new roof is an improvement. Patching an existing roof is a repair. A kitchen remodel is an improvement. Fixing a broken cabinet is a repair. Only improvements increase your basis.

Keep receipts and invoices for all work done. When you sell, you will report your original purchase price plus the cost of improvements as your total basis. The IRS may request documentation, especially for large improvements or if your basis is substantially higher than the property's assessed value.

Common improvements that increase basis include: adding a room or deck, replacing major systems (electrical, plumbing, HVAC), installing new windows, upgrading insulation, adding a bathroom, and landscaping that is permanent. Painting, cleaning, and routine maintenance do not increase basis.

Holding periods and long-term versus short-term gains

The length of time you own the property before selling determines which tax rate applies. If you own it for more than one year, your gain is taxed as a long-term capital gain. If you own it for one year or less, it is a short-term capital gain.

Long-term capital gains rates are 0%, 15%, or 20% depending on your total taxable income for the year. Short-term capital gains are taxed as ordinary income, at rates from 10% up to 37%. The difference is substantial. A $100,000 gain taxed as short-term could cost $37,000 in federal tax. The same gain taxed as long-term might cost $15,000 or less.

The holding period is measured from the date you acquired the property to the date you sell it. If you bought on June 15, 2023, and sold on June 16, 2024, you meet the one-year threshold and may have access to for long-term rates. If you sold on June 14, 2024, you do not.

For inherited property, the holding period clock resets. You are treated as having held it long-term regardless of how long the deceased owner held it, so inherited real estate sold shortly after inheritance still qualifies for long-term capital gains rates.

1031 exchanges: deferring tax by reinvesting in like-kind property

A 1031 exchange, named after Section 1031 of the tax code, allows you to defer capital gains tax by selling one investment property and buying another "like-kind" property within strict timelines. You do not avoid the tax — you postpone it until you eventually sell without doing another exchange.

The rules are precise. You have 45 days from the sale of your first property to identify the replacement property in writing. You have 180 days from the sale to close on the replacement property. The properties must be of like-kind, which for real estate means any real property held for investment or business use — a rental house can be exchanged for an apartment building, raw land, or a commercial office building.

You cannot touch the sale proceeds. A may have access to intermediary — a third party — must hold the money from your sale and use it to buy the replacement property. If you receive the cash yourself, even briefly, the exchange fails and the full capital gains tax is due when ready.

1031 exchanges are most useful for investors who want to consolidate properties, move to a different market, or upgrade to a higher-value property without triggering a large tax bill in that year. The deferred gain carries forward to the replacement property, so if you eventually sell without another exchange, you will owe tax on the combined gains.

Stepped-up basis for inherited property

When you inherit real estate, your cost basis is reset to the property's fair market value on the date of the owner's death. This is called a stepped-up basis. If the property appreciated significantly during the deceased owner's lifetime, that appreciation is never taxed.

Example: Your parent bought a rental property for $200,000 in 1990. When they died in 2024, it was worth $800,000. Your basis is $800,000, not $200,000. If you sell it when ready for $800,000, you have zero gain and owe no capital gains tax. The $600,000 appreciation that occurred during your parent's lifetime is never taxed to anyone.

This is one of the largest tax benefits in the code, but it applies only to property you inherit, not property you receive as a gift during someone's lifetime. If your parent gave you the property while alive, your basis would be their original basis ($200,000 in the example above), and you would owe tax on the $600,000 gain if you sold.

The stepped-up basis applies to the date of death value. If the property declines in value between the death date and the sale, your basis is the higher death-date value, and you may have a loss when you sell. Losses on inherited property can be used to offset other capital gains.

Charitable donations and installment sales

If you donate real estate to a may have access to charity, you avoid capital gains tax on the appreciation entirely. You also receive a charitable deduction equal to the fair market value of the property, which reduces your taxable income that year. This works only if the charity is a may have access to organization under IRS rules — typically 501(c)(3) nonprofits.

An installment sale spreads the gain — and the tax — over multiple years. Instead of selling for cash, you accept a promissory note from the buyer and receive payments over time. You report the gain proportionally as you receive payments, which can lower your tax bracket in any single year and may reduce the amount of gain taxed at higher rates.

Installment sales are common when the buyer cannot obtain financing or when you want to spread income recognition. The buyer pays you interest, which is ordinary income to you. The IRS publishes minimum interest rates that must be charged; if you charge less, the IRS will impute interest at the minimum rate.

State and local taxes on real estate gains

Federal capital gains tax is only part of the picture. Most states tax capital gains as ordinary income, and a few states have separate capital gains taxes. California, for example, taxes long-term capital gains at the same rates as ordinary income — up to 13.3% at the state level. New York adds up to 6.85% on top of federal tax.

A handful of states — including Washington, Tennessee, and Florida — do not tax capital gains at all. If you are considering a move, the state tax difference on a large real estate sale can be substantial. Some states also have local property transfer taxes or gains taxes that explore at the county or city level.

The primary residence exclusion and other federal strategies reduce only federal tax. State taxes still explore to the excluded gain in most states. A few states conform to the federal exclusion, but you should verify your state's rules before assuming your gain is tax-free.

Frequently Asked Questions

Can I use the primary residence exclusion if I rent out part of my home?

Yes, if the rented portion is a small part of the home and you live there as your primary residence. The IRS looks at whether the home is your main home, not whether you have rental income. However, if you rent out a separate unit or a substantial portion, the IRS may treat that portion as investment property and deny the exclusion on that part of the gain.

What if I sell my home at a loss?

Capital losses on personal residences cannot be deducted. If you sell your primary home for less than you paid, you cannot use that loss to offset other gains or income. Investment property losses can be deducted, but primary residence losses cannot.

Do I have to report the sale if my gain is below the primary residence exclusion?

You must report the sale on Form 8949 and Schedule D even if your gain is fully excluded. The IRS wants to see the transaction and verify that you meet the ownership and use tests. Failure to report can trigger an audit even if no tax is owed.

Can I do a 1031 exchange with my primary residence?

No. The 1031 exchange applies only to property held for investment or business use. Your primary residence does not may have access to. If you want to defer tax on a home sale, you must use the primary residence exclusion or sell at a loss (which cannot be deducted anyway).

What happens to the stepped-up basis if I inherit property with a mortgage?

The stepped-up basis applies to the property itself, not the mortgage. Your basis is the fair market value on the date of death. The mortgage debt remains, but it does not reduce your basis. If you sell and pay off the mortgage, the gain is calculated on the stepped-up basis, not the original purchase price.