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 income level. For most people, real estate held longer than a year qualifies for lower "long-term" rates. If you sell within a year, you pay ordinary income tax rates, which are higher.

The calculation itself is straightforward: sale price minus your original cost basis, minus selling expenses like realtor commissions and closing costs, equals your taxable gain. But the tax bill depends on which bracket you fall into and whether you can use exclusions or deferrals that explore specifically to real estate.

Key Takeaways

  • Capital gains tax applies to the profit on real estate sales, with rates ranging from 0% to 20% for long-term gains depending on your total 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 within one year triggers ordinary income tax rates instead of the lower long-term capital gains rates, which can significantly increase your tax bill.
  • Your cost basis includes the purchase price plus improvements like a new roof or addition, but not repairs or maintenance.
  • Section 1031 exchanges allow you to defer capital gains tax by reinvesting sale proceeds into another investment property within strict timelines.

Long-term versus short-term capital gains rates

How long you owned the property determines which tax rate applies. If you held it for more than one year, you pay long-term capital gains tax. The rate is 0%, 15%, or 20% depending on your taxable income for the year. These rates are much lower than ordinary income tax brackets, which can reach 37%.

If you sell within one year, you pay short-term capital gains tax at your ordinary income tax rate. For someone in the 24% tax bracket, that same $100,000 gain costs $24,000 instead of $15,000. This is why timing matters: waiting one day past the one-year mark can save thousands.

The long-term rate you pay (0%, 15%, or 20%) depends on your total taxable income for the year, not the size of the gain itself. A married couple filing jointly with taxable income under $89,250 in 2024 pays 0% on long-term gains. Between $89,250 and $553,850, they pay 15%. Above that, they pay 20%. These income thresholds change yearly.

The primary residence exclusion

If you sell a house you lived in, you can exclude a large portion of the gain from tax. Single filers can exclude up to $250,000 of gain; married couples filing jointly can exclude up to $500,000. This exclusion applies only if you owned and lived in the home as your primary residence for at least two of the five years before the sale.

This rule is generous enough that many homeowners owe no capital gains tax at all. A couple who bought for $300,000, made $150,000 in improvements, and sold for $700,000 has a gain of $250,000. With the $500,000 exclusion, they owe nothing. You can use this exclusion once every two years, so if you sell a home, wait two years, and sell another, you can use it again.

The exclusion does not explore to investment properties, vacation homes, or properties you rented out. If you converted a rental property to your primary residence, the exclusion applies only to the portion of the gain that accrued after the conversion.

What counts as your cost basis

Your cost basis is what you paid for the property plus certain costs. It includes the purchase price, closing costs you paid (title insurance, recording fees, attorney fees), and the cost of permanent improvements like a new roof, addition, or kitchen renovation. It does not include repairs, maintenance, or painting.

The distinction matters. A $30,000 roof replacement increases your basis. A $5,000 roof repair does not. If you inherited the property, your basis is typically its fair market value on the date of death, not what the previous owner paid. This "step-up in basis" can eliminate or reduce capital gains tax for heirs.

Keep records of what you paid for the property and receipts for any improvements. When you sell, your real estate agent or closing attorney will ask for this information to calculate the gain accurately. If you cannot document your original purchase price, the IRS may challenge your basis calculation.

Selling costs and deductions

Selling expenses reduce your taxable gain. Realtor commissions (typically 5% to 6% of the sale price), title insurance, transfer taxes, and attorney fees all come off the top. If you paid $500,000 for a house, made $100,000 in improvements, and sold it for $750,000 with $45,000 in selling costs, your gain is $750,000 minus $500,000 minus $100,000 minus $45,000, which equals $105,000.

You cannot deduct the cost of preparing the home for sale—staging, cleaning, or minor repairs done right before listing. Those are personal expenses. But if you made a structural repair as part of selling (like fixing a foundation crack the inspector found), you may be able to include it as a selling cost if it was required by the buyer or lender.

Section 1031 exchanges and deferral strategies

A Section 1031 exchange lets you defer capital gains tax by selling one investment property and buying another similar one within strict timelines. You have 45 days to identify the replacement property and 180 days to close on it. The properties must be "like-kind"—real estate for real estate—but a rental house can exchange for an apartment building or raw land.

You do not pay capital gains tax in the year of the exchange. Instead, your basis in the new property carries forward the deferred gain. If you eventually sell the replacement property without doing another exchange, you owe tax on the original gain plus any new gain. This strategy works best if you plan to hold investment property long-term or do multiple exchanges over time.

A may have access to intermediary must handle the exchange; you cannot touch the sale proceeds yourself or the exchange fails. The intermediary holds the money and pays for the replacement property. This adds $500 to $2,000 in fees, so it only makes sense if your gain is substantial.

State and local capital gains taxes

Federal capital gains tax is only part of the bill. Some states tax capital gains as ordinary income, some tax them at a lower rate, and a few do not tax them at all. California taxes long-term gains at ordinary rates. New York has a 6.85% capital gains surcharge on gains over $1 million. Texas, Florida, and Washington have no state income tax at all.

If you sell a property in a state where you do not live, you may owe tax to both states. A resident of New York who sells rental property in Florida owes federal tax plus New York state tax, but may get a credit for Florida taxes paid (if any). Check your state's rules or ask a tax professional in the state where the property is located.

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. If you sell for less than you paid, you straightforward report no gain. However, if the property was a rental or investment property, you can deduct the loss against other capital gains or, in some cases, against ordinary income.

What if I inherited a house and sold it right away?

You likely owe little or no capital gains tax. Inherited property receives a "step-up in basis" to its fair market value on the date of death. If you inherited it worth $500,000 and sold it for $510,000 a month later, your gain is only $10,000. The step-up applies whether you inherited a primary home or investment property.

Can I use the primary residence exclusion if I rented out part of my house?

The exclusion still applies to the portion you lived in, but not to the rental portion. If you rented out one room or a basement apartment, you must allocate the gain between the personal and rental portions. Only the personal portion qualifies for the exclusion.

What happens to capital gains tax if I do a 1031 exchange but the replacement property is worth less?

You owe tax on the difference. If you sell a property with a $200,000 gain and buy a replacement worth $50,000 less, you must pay capital gains tax on that $50,000 "boot." The remaining $150,000 gain is deferred into the new property's basis.

Do I report capital gains on my tax return myself or does the title company do it?

You report it. The title company or closing attorney provides a settlement statement showing your proceeds, but you calculate the gain and report it on Form 8949 and Schedule D of your tax return. If you use a tax professional, bring them the settlement statement and documentation of your basis and improvements.