Capital gains tax on real estate is the tax you owe on the profit when you sell a property for more than you paid for it

When you sell a house, rental property, or land, the IRS taxes the difference between what you paid (your basis) and what you sold it for (your sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your total income for the year. Most people pay either 0%, 15%, or 20% on long-term gains — property you held for more than one year. Short-term gains — property held one year or less — are taxed as ordinary income at your regular tax bracket, which can be much higher.

Real estate is treated differently from stocks or bonds because you can exclude some or all of the gain if you lived in the home as your primary residence. You can also reduce your taxable gain by deducting certain costs you paid to sell the property, like real estate commissions and closing costs.

Key Takeaways

  • Capital gains tax applies to the profit on a real estate sale, calculated as the sale price minus your original purchase price and certain improvements you made.
  • Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
  • You can exclude up to $250,000 of gain ($500,000 if married filing jointly) if you lived in the home as your primary residence for at least two of the last five years.
  • Selling costs like real estate commissions, title insurance, and attorney fees reduce your taxable gain and should be documented carefully.
  • You report capital gains on Schedule D (Form 1040) and may owe estimated taxes if the gain is large.

How the IRS calculates your capital gain

Start with your basis — what you originally paid for the property. This includes the purchase price plus certain costs: closing costs, title insurance, attorney fees, and the cost of major improvements like a new roof, foundation work, or an addition. Do not include maintenance costs like painting or repairs, even if you did them right before selling.

Next, calculate your amount realized — what you received from the sale. This is the sale price minus selling costs. Selling costs include the real estate agent commission (typically 5% to 6%), title insurance for the buyer, attorney fees, and transfer taxes. These reduce what you actually keep.

Your capital gain is: Amount Realized minus Basis. If you bought a house for $300,000, spent $50,000 on a new kitchen and roof, and sold it for $500,000 after paying $30,000 in selling costs, your gain is $500,000 − $30,000 − $350,000 = $120,000.

The primary residence exclusion and who qualifies

If you lived in the home as your main home for at least two of the five years before you sold it, you can exclude $250,000 of the gain from tax (or $500,000 if you are married filing jointly). This is one of the largest tax breaks available to homeowners and applies whether you are selling your first home or your tenth.

The two years do not have to be consecutive. If you owned the home for five years but lived there for only the first two years, you still may have access to. If you lived there for three years, you still may have access to — you only need two. However, if you sold a home and used this exclusion within the last two years, you cannot use it again on another home sale until two years have passed.

Using the example above: you have a $120,000 gain. As a single filer, you exclude $250,000, so your taxable gain is zero. You owe no capital gains tax. If you were married filing jointly and had a $600,000 gain, you would exclude $500,000 and owe tax on $100,000.

Long-term versus short-term capital gains rates

How long you owned the property determines your tax rate. Long-term capital gains — property you held for more than one year — are taxed at preferential rates: 0%, 15%, or 20%. Which rate you pay depends on your taxable income and filing status. The IRS adjusts these income thresholds every year.

Short-term capital gains — property you held for one year or less — are taxed as ordinary income at your regular tax bracket. If you are in the 24% tax bracket, short-term gains are taxed at 24%. This is why holding a rental property or investment property for longer than one year usually saves you money.

For 2024, the long-term rates are 0%, 15%, or 20%. A single filer pays 0% on long-term gains up to $47,025 of taxable income, 15% from $47,025 to $518,900, and 20% above that. These numbers change yearly and are higher for married filers. Check the IRS website or your tax software for the current year's thresholds.

What costs reduce your taxable gain

You can subtract certain expenses from your sale price to lower your capital gain. These fall into two categories: costs you paid to improve the property (added to your basis) and costs you paid to sell it (subtracted from your sale price).

Improvements that increase basis: A new roof, foundation repair, room addition, new HVAC system, new windows, deck, or kitchen renovation. These add permanent value to the home. Keep receipts and invoices for all work done.

Selling costs that reduce proceeds: Real estate agent commission, title insurance for the buyer, attorney fees, transfer taxes, recording fees, and inspection fees paid by you. These are subtracted from your sale price before calculating gain.

Costs that do not reduce gain: Painting, landscaping, minor repairs, cleaning, staging, and property taxes. These are maintenance, not improvements, and do not reduce your taxable gain.

Reporting capital gains on your tax return

You report real estate capital gains on Schedule D (Form 1040), which is filed with your federal tax return. Part I of Schedule D is for short-term gains; Part II is for long-term gains. You list the property, the date you bought it, the date you sold it, your basis, your sale price, and your gain or loss.

After you complete Schedule D, the total long-term gain transfers to line 7 of your Form 1040. If you have a large gain and did not pay estimated taxes during the year, you may owe an underpayment penalty. The IRS expects you to pay tax as you earn income, not just at tax time.

If you sold your primary residence and are excluding gain under the primary residence rule, you still file Schedule D but note the exclusion. Your tax software will walk you through this. Keep a copy of your closing statement, proof of improvements, and documentation of selling costs for at least three years.

Special situations: inherited property and like-kind exchanges

If you inherited real estate, your basis is "stepped up" to the fair market value on the date of the owner's death, not what the original owner paid. This means if your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it a month later for $410,000, your gain is only $10,000, not $310,000. This is a significant tax benefit for heirs.

A like-kind exchange (also called a 1031 exchange) allows you to defer capital gains tax if you sell real estate and reinvest the proceeds in another property of equal or greater value within strict timelines. This is complex and requires working with a may have access to intermediary. The gain is not erased — it is deferred until you eventually sell without doing another exchange.

Frequently Asked Questions

Do I owe capital gains tax if I sell my primary home at a loss?

No. Capital losses on personal residences cannot be deducted. However, if you have other capital gains from stocks or investments that year, you cannot use the home loss to offset them. You straightforward report no gain on Schedule D.

What if I rented out part of my home or used it as a home office?

You may not may have access to for the full primary residence exclusion. The IRS requires you to have lived in the home as your main home for two of the five years before sale. If you rented it out for part of that time, you may owe tax on the portion of gain attributable to the rental period. Consult a tax professional if this applies to you.

Can I deduct the cost of a real estate agent if I am selling investment property?

Yes. For rental or investment property, the agent commission and all selling costs reduce your amount realized and lower your taxable gain. These are not deducted separately — they are subtracted from your sale price when calculating gain on Schedule D.

Do state and local taxes explore to capital gains on real estate?

Yes. Most states tax capital gains, though the rate and rules vary. Some states have no capital gains tax; others tax it as ordinary income or at a flat rate. Check your state's tax authority website or ask a tax professional about your state's rules.

What if I sell the property before I have owned it for one year?

The gain is taxed as short-term capital gain at your ordinary income tax rate, which is usually higher than the long-term rate. If you are in the 32% tax bracket, short-term gains are taxed at 32%, not 15% or 20%. This is why holding property longer usually saves money on taxes.