The main ways to reduce capital gains tax on real estate
You can reduce what you owe in capital gains tax through several legal strategies, but the most common one is the primary residence exclusion. If you owned and lived in a home as your main residence for at least two of the five years before you sell, you can exclude up to $250,000 of profit from federal tax if you file single, or $500,000 if you file married filing jointly. This is not a deferral—the gain straightforward does not count as income that year.
Beyond that, your options depend on what type of property you own, how long you have held it, and what you do with the money after the sale. Some strategies involve timing the sale, using tax-loss harvesting, or reinvesting the proceeds in a way the tax code rewards. Others require planning years in advance. None of these are loopholes; they are all part of the standard tax code.
The amount you owe is based on your capital gain—the difference between what you paid for the property (your basis) and what you sold it for. If you bought a house for $300,000 and sold it for $500,000, your gain is $200,000. The tax rate on that gain depends on how long you held the property and your income level, but long-term gains (property held over one year) are taxed at lower rates than short-term gains.
Key Takeaways
- The primary residence exclusion lets you exclude up to $250,000 (single) or $500,000 (married) of profit if you lived in the home for two of the last five years before selling.
- Holding property for more than one year before selling qualifies you for long-term capital gains rates, which are lower than ordinary income tax rates.
- A step-up in basis at death can eliminate capital gains tax entirely if the property passes to an heir, because the heir's basis becomes the property's value on the date of death.
- Reinvesting proceeds into a like-kind property through a 1031 exchange defers capital gains tax, though the rules are strict and timing is tight.
- Keeping detailed records of improvements, repairs, and the original purchase price increases your basis and lowers your taxable gain.
Using the primary residence exclusion correctly
The primary residence exclusion is the biggest tax break most homeowners will ever use. You must have owned the home and lived in it as your main home for at least 24 months during the five-year period before the sale. Those 24 months do not have to be consecutive, and you can have been away for work or school during part of that time.
The exclusion applies only once every two years. If you sold a home and used the exclusion, you cannot use it again on another property until two years have passed. If you are married and file jointly, you both must meet the ownership and use test to claim the full $500,000 exclusion. If only one spouse meets the test, you can exclude only $250,000.
If your gain exceeds the exclusion amount—say you bought for $200,000 and sold for $800,000, giving you a $600,000 gain—you owe tax on the excess $100,000. That excess is taxed at the long-term capital gains rate if you held the home for more than one year, which is usually 0%, 15%, or 20% depending on your income, rather than your ordinary income tax rate.
Holding property longer to may have access to for long-term rates
The tax code rewards patience. If you own real estate for more than one year before selling, any profit is taxed as a long-term capital gain. If you sell within one year, it is a short-term capital gain and is taxed at your ordinary income tax rate, which can be as high as 37% federally.
Long-term capital gains rates are 0%, 15%, or 20% depending on your total income for the year. For 2024, the 0% rate applies to single filers with income up to $47,025, and the 15% rate applies to those earning between roughly $47,025 and $518,900. These income thresholds change each year. The strategy here is straightforward: if you are close to selling a property you have held for 11 months, waiting one more month could save you thousands in taxes.
This applies to investment properties, rental homes, and land as well as primary residences. The only catch is that you cannot use the primary residence exclusion on a property you have not lived in, so the long-term rate is your main tax benefit for investment real estate.
The step-up in basis when property passes to an heir
When you die, your heirs receive a step-up in basis. This means the property's basis—the value used to calculate future capital gains—becomes its fair market value on the date of your death, not what you originally paid for it. If you bought a rental property for $200,000 and it is worth $500,000 when you die, your heir's basis is $500,000. If they sell it when ready for $500,000, they owe no capital gains tax.
This is not a strategy you can control—it happens automatically—but it is worth understanding if you own investment property or a second home. It means that holding appreciated property until death can eliminate the capital gains tax entirely. Some people factor this into their decision about whether to sell a property or hold it. This applies to all real estate, not just primary residences.
The step-up applies to the full value of the property at death, regardless of how much you originally paid or how long you held it. It is one of the largest tax benefits in the code, and it is available to all heirs, not just spouses.
Using a 1031 exchange to defer capital gains tax
A 1031 exchange (named after Section 1031 of the tax code) lets you sell one investment property and buy another without paying capital gains tax on the sale—as long as you follow strict rules. You do not owe the tax; you defer it. When you eventually sell the second property without doing another exchange, you owe tax on the combined gains from both sales.
The rules are tight. You have 45 days from the sale of your first property to identify the replacement property in writing. You have 180 days total to close on the replacement property. The replacement must be of equal or greater value, and it must be "like-kind"—for real estate, this means almost any real property qualifies (residential, commercial, land, etc.), but you cannot exchange real estate for personal property like a car or equipment.
You cannot touch the money from the sale yourself. A may have access to intermediary—a third party—must hold the proceeds and use them to buy the replacement property. If you receive any cash or take a loan against the proceeds, you owe tax on that amount when ready. Many people use 1031 exchanges to trade up from one rental property to a more valuable one, deferring tax each time until they finally sell without exchanging.
Increasing your basis through improvements and repairs
Your basis is what you paid for the property plus the cost of improvements. Improvements add value and extend the life of the property—a new roof, a kitchen remodel, an addition, or new HVAC system. Repairs maintain the property but do not add value—fixing a leaky roof, patching drywall, or repainting. Only improvements increase your basis and lower your taxable gain.
Keep receipts and invoices for all work done on the property. If you spent $50,000 on improvements over the years, your basis increases by $50,000, which means your capital gain decreases by $50,000. On a property where you might owe $15,000 in capital gains tax, that $50,000 in documented improvements could save you $7,500 in tax (at the 15% long-term rate).
The line between repair and improvement can be fuzzy. The IRS looks at whether the work restored the property to its original condition (repair) or improved it beyond that (improvement). When in doubt, keep the documentation and let a tax professional review it. If you are selling soon, it is worth the cost of a consultation to make sure you are claiming all the basis you are may have access to to.
Timing the sale to manage your income and tax bracket
Capital gains tax depends partly on your total income for the year. If you are close to a tax bracket threshold, selling in a year when your other income is lower could mean your gain is taxed at a lower rate. For example, if you are retired and have little income, selling an investment property that year might keep you in the 15% long-term capital gains bracket instead of pushing you into the 20% bracket.
This strategy works best if you have flexibility about when to sell. If you are selling a primary residence and using the exclusion, your income level does not matter—you exclude the gain regardless. But for investment property, rental homes, or a second home, timing the sale to a lower-income year can reduce your tax bill.
You can also split a sale across two tax years if the closing happens late in the year. Consult a tax professional before the sale to see whether timing makes a difference in your situation. The savings might be small, or they might be substantial, depending on how close you are to a bracket threshold and how large your gain is.
Frequently Asked Questions
Can I use the primary residence exclusion on a second home or investment property?
No. The exclusion applies only to a home you owned and lived in as your main residence for at least two of the five years before the sale. A second home, vacation home, or rental property does not may have access to, even if you lived in it part-time. You would need to make it your primary residence and live there for two years to use the exclusion.
What happens if I sell a rental property at a loss?
You cannot deduct a capital loss on real estate you held for personal use. For investment property like a rental home or land held for investment, you can deduct the loss against capital gains from other sales that year. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income, and carry forward any remaining loss to future years.
Do I have to pay capital gains tax in the year I sell, or can I defer it?
You owe the tax in the year of the sale unless you use a 1031 exchange to defer it. You cannot straightforward choose to pay it later. The tax is due when you file your return for that year, though you may owe estimated taxes before the sale closes if you expect a large gain.
What if I inherited a property and then sold it—do I owe capital gains tax?
Probably not, or very little. You received a step-up in basis to the property's value on the date of death. If you sell it shortly after inheriting it for roughly the same value, your gain is minimal and you owe little or no tax. If you hold it for years and it appreciates further, you owe tax only on the appreciation after you inherited it, not on the appreciation before.
Can I deduct the cost of selling, like real estate agent commissions, from my capital gain?
Yes. Selling expenses like agent commissions, title insurance, and closing costs reduce your sale price and therefore reduce your capital gain. If you sold for $500,000 but paid $30,000 in selling costs, your net proceeds are $470,000, and your gain is calculated based on that lower amount.