What capital gains tax is and when you owe it

When you sell a house, investment property, or land for more than you paid for it, the profit is called a capital gain. The IRS taxes that profit as income. The amount you owe depends on how long you owned the property and your total income that year.

If you owned the property for more than one year before selling, it counts as a long-term capital gain, which is taxed at a lower rate than ordinary income—either 0%, 15%, or 20%, depending on your income bracket. If you owned it for one year or less, it's a short-term gain and taxed like regular income, which can be much higher.

The key to reducing what you owe is understanding that you don't have to pay tax on the entire sale price—only on the gain. If you bought a house for $300,000 and sold it for $400,000, your gain is $100,000. That $100,000 is what gets taxed, not the full $400,000.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) if you lived in the home two of the last five years before selling.
  • Holding property for more than one year before selling qualifies it for long-term capital gains rates, which are lower than short-term rates.
  • Keeping detailed records of improvements you made to the property increases your cost basis and reduces your taxable gain.
  • A 1031 exchange lets you defer capital gains tax by reinvesting the sale proceeds into another investment property of equal or greater value within strict timelines.
  • Your filing status and total income that year determine which tax bracket your gains fall into, so timing the sale strategically can matter.

The primary residence exclusion: the biggest break for most homeowners

If you're selling your main home, you may not owe any capital gains tax at all. The IRS allows you to exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly. The only requirement is that you owned and lived in the home for at least two of the five years before you sold it.

This is the most valuable tax break available to homeowners. If your gain is $150,000 and you're single, you owe tax on zero dollars. If your gain is $600,000 and you're married, you owe tax on only $100,000.

You can use this exclusion once every two years. If you sold a home and used the exclusion, you must wait at least two years before you can use it again on another property. The two-year ownership and use test is separate from the two-year waiting period—they don't have to overlap.

Holding property longer to may have access to for long-term capital gains rates

The difference between short-term and long-term capital gains rates is significant. Short-term gains (property held one year or less) are taxed as ordinary income, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your income. Long-term gains are taxed at 0%, 15%, or 20%.

If you're considering selling an investment property or a second home, waiting until you've owned it for more than one year can cut your tax bill substantially. For example, a $50,000 gain taxed as short-term income at the 24% rate costs $12,000. The same gain taxed as long-term at the 15% rate costs $7,500—a $4,500 difference.

The holding period is measured from the date you acquired the property to the date you sell it. If you inherited property, the holding period typically starts fresh on the date of the owner's death, which is another reason inherited real estate often has favorable tax treatment.

Increasing your cost basis through documented improvements

Your cost basis is what you paid for the property plus the cost of any improvements you made. The higher your basis, the lower your gain, and the less tax you owe. Many homeowners leave money on the table by not tracking improvements.

Improvements are permanent upgrades that add value or extend the life of the property. A new roof, kitchen remodel, addition, new HVAC system, or deck all count. Repairs and maintenance do not—painting, fixing a leak, or replacing a broken window don't increase your basis.

Keep receipts, invoices, and photos of any work you had done. If you did the work yourself, document the materials you bought. When you sell, provide your tax preparer with a list of improvements and their costs. If you spent $80,000 on improvements over the years, that reduces your gain by $80,000, which can save thousands in taxes.

Using a 1031 exchange to defer capital gains tax

A 1031 exchange (named after Section 1031 of the tax code) lets you sell an investment property and reinvest the proceeds into another investment property without paying capital gains tax at the time of sale. The tax is deferred, not eliminated—you'll owe it when you eventually sell the second property, unless you do another 1031 exchange.

The rules are strict. You must identify a replacement property within 45 days of closing on the sale, and you must close on that replacement property within 180 days. The replacement property must be of equal or greater value, and it must be held for investment or business use (your primary residence doesn't may have access to). You cannot take any of the sale proceeds yourself—a may have access to intermediary must hold the money and transfer it directly to the seller of the replacement property.

A 1031 exchange is useful if you own rental properties or land and want to consolidate, diversify, or move to a different market without triggering a large tax bill. Many investors chain multiple 1031 exchanges together over decades, continuously deferring taxes. However, the rules are complex, and mistakes can disqualify the exchange. Work with a tax professional or a may have access to intermediary who specializes in 1031 exchanges.

Timing the sale to manage your tax bracket

Your total income in the year you sell affects which long-term capital gains rate applies to your gain. For 2024, the 0% rate applies to single filers with income up to $47,025 and married filers up to $94,050. The 15% rate applies to income above that up to $518,900 (single) or $583,750 (married). Anything above that is taxed at 20%.

If you're close to a bracket threshold, timing matters. If you're a single filer with $45,000 in ordinary income and a $10,000 capital gain, the first $2,025 of gain is taxed at 0% and the remaining $7,975 is taxed at 15%. If you could defer $5,000 of the gain to the next year, you'd save on taxes.

This strategy works best if you have control over when you close the sale. If you're retiring, selling a business, or receiving a large bonus, consider whether selling the property in a lower-income year would reduce your tax. Talk to a tax preparer before you commit to a closing date.

Inherited property and the step-up in basis

If you inherit real estate, the IRS gives you a significant advantage: your cost basis is "stepped up" to the fair market value of the property on the date the owner died. 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, not $100,000.

If you sell the inherited property shortly after inheriting it, you owe capital gains tax only on any increase in value after the death date. If you sell it for $410,000, your gain is only $10,000, not $310,000. This is one of the most valuable tax breaks in the code, and it applies automatically—you don't have to do anything to claim it.

The step-up applies to the date of death, not the date you inherit or the date you sell. If the property increases in value after the owner's death and before you sell, you do owe tax on that increase.

Frequently Asked Questions

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

Not if your gain is under $250,000 (single) or $500,000 (married filing jointly) and you lived in the home for at least two of the five years before selling. If your gain exceeds those amounts, you owe tax only on the excess. This is the primary residence exclusion, and it's automatic—you claim it on your tax return.

What's the difference between capital gains and ordinary income tax rates?

Long-term capital gains are taxed at 0%, 15%, or 20% depending on your income. Ordinary income is taxed at rates from 10% to 37%. Short-term capital gains (property held one year or less) are taxed as ordinary income. Holding property for more than one year qualifies it for the lower long-term rates.

Can I deduct losses if I sell property for less than I paid?

Capital losses on personal residences cannot be deducted. If you sell an investment property or land at a loss, you can use that loss to offset capital gains from other sales. Unused losses can be carried forward to future years, up to $3,000 per year against ordinary income.

What counts as an improvement versus a repair?

Improvements add value or extend the life of the property—a new roof, kitchen remodel, addition, or HVAC system. Repairs maintain the property in its current condition—painting, fixing a leak, or replacing a broken window. Only improvements increase your cost basis. When in doubt, ask your tax preparer.

Can I do a 1031 exchange on my primary home?

No. A 1031 exchange only works for investment or business property. Your primary residence does not may have access to. However, you can use the primary residence exclusion instead, which may eliminate or reduce your tax bill entirely.