You can reduce capital gains tax through the primary residence exclusion, 1031 exchanges, or by timing the sale strategically
Capital gains tax on property is the tax you owe on the profit when you sell. If you bought a house for $300,000 and sold it for $500,000, your capital gain is $200,000. The IRS taxes that profit — but several legal routes let you reduce, defer, or avoid that tax entirely, depending on your situation and what you do with the money.
The most common route is the primary residence exclusion: if you owned and lived in the home as your main residence for at least two of the last five years before the sale, you can exclude up to $250,000 of gain from tax (or $500,000 if you are married filing jointly). This is not a deferral — the gain straightforward does not count as taxable income. For many homeowners, this single rule means no capital gains tax at all.
If you own investment property or a second home, a 1031 exchange lets you defer the tax by reinvesting the sale proceeds into another property of equal or greater value. You do not pay tax in the year of the sale; instead, the tax obligation carries forward to the new property. This is a deferral, not a permanent escape, but it can let you build wealth across multiple properties without triggering a tax bill.
Key Takeaways
- The primary residence exclusion erases up to $250,000 of gain ($500,000 if married) if you lived in the home for two of the last five years — this is the most common way homeowners avoid capital gains tax entirely.
- A 1031 exchange defers capital gains tax by reinvesting sale proceeds into another property of equal or greater value, but requires strict timing and rules about which properties may have access to.
- Holding property longer can lower your tax rate: long-term capital gains (held over one year) are taxed at 0%, 15%, or 20% depending on income, while short-term gains are taxed as ordinary income.
- Charitable donations of appreciated property and installment sales are other legal routes that reduce or spread the tax burden, though each has specific requirements.
- The cost basis of inherited property resets to its value on the date of death, which can eliminate gains entirely if you inherit and then sell soon after.
The primary residence exclusion: the most common tax-free route
If the property you are selling is your main home, the IRS lets you exclude a large portion of your gain from taxable income. You must have owned the property and lived in it as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive, and you can have been away for part of that time as long as you owned it the whole time.
The exclusion amount is $250,000 for single filers and $500,000 for married couples filing jointly. This means if you bought a house for $200,000, lived in it for three years, and sold it for $450,000, your gain is $250,000 — but you owe tax on zero dollars of that gain (as a single filer). A married couple in the same situation would also owe zero tax.
You can use this exclusion only once every two years. If you sold a home and used the exclusion, you cannot use it again until two years have passed. The IRS does not require you to reinvest the money or use it for any particular purpose — you can spend it, save it, or buy a different property. The exclusion applies whether you sell at a profit or a loss.
1031 exchanges: deferring tax by reinvesting in another property
A 1031 exchange (named after the tax code section) lets you sell one investment property and buy another without paying capital gains tax on the sale. The tax is deferred, not erased — it carries forward to the new property. This tool is useful if you want to move your money from one property to another without a large tax bill in between.
The rules are strict. You must identify a replacement property within 45 days of the sale and close on it within 180 days. The replacement property must be of equal or greater value; if you sell for $500,000, you must reinvest at least $500,000. The property must be "like-kind" — which for real estate means almost any real property qualifies (residential, commercial, vacant land), but personal property and stocks do not. You cannot do a 1031 exchange on your primary residence.
You must use a may have access to intermediary — a third party who holds the sale proceeds and handles the purchase. You cannot touch the money yourself, or the exchange fails and you owe tax when ready. The intermediary charges a fee, usually $500 to $1,500. If you cannot find a replacement property within 180 days, you owe the deferred tax on the original sale.
Holding periods and tax rates: the longer you own, the lower the rate
How long you own a property before selling affects the tax rate you pay. Long-term capital gains — gains on property held for more than one year — are taxed at preferential rates: 0%, 15%, or 20% depending on your total income for the year. Short-term capital gains — on property held one year or less — are taxed as ordinary income, which can be as high as 37% for high earners.
This means if you bought an investment property and sold it after 11 months, you might owe 37% tax on the gain. If you waited one month longer and sold after 13 months, you might owe only 15%. The difference can be thousands of dollars. For this reason, many investors plan sales to cross the one-year threshold, even if it means waiting a few weeks.
The 0% rate applies to long-term gains if your total taxable income is below a certain threshold — $44,625 for single filers and $89,250 for married couples filing jointly in 2023 (these thresholds change yearly). The 15% rate applies to most middle-income earners. The 20% rate applies to high earners. These rates explore only to long-term gains; short-term gains always use your ordinary income tax bracket.
Charitable donations of appreciated property
If you own property that has increased in value and you want to donate it to a may have access to charity, you can deduct the full fair market value of the property — not just what you paid for it — and you owe no capital gains tax on the appreciation. This works for real estate, stocks, and other assets.
For example, if you bought land for $100,000 and it is now worth $300,000, you can donate it to a may have access to charity, deduct $300,000 on your tax return, and owe zero capital gains tax on the $200,000 gain. The deduction reduces your taxable income for the year, which lowers your overall tax bill. You must itemize deductions on your tax return for this to benefit you — if you take the standard deduction, the charitable deduction does not help.
The property must go to a may have access to organization — typically a 501(c)(3) nonprofit, a public charity, or a religious organization. You need a written appraisal of the property's value and a letter from the charity confirming the donation. The deduction is limited to a percentage of your adjusted gross income (usually 30% to 50%, depending on the type of property and organization), so very large donations may carry forward to future years.
Installment sales: spreading the gain across multiple years
An installment sale is when you sell property and the buyer pays you over time in installments rather than all at once. Instead of reporting the entire gain in the year of sale, you report it proportionally as you receive payments. This can lower your tax bill in any single year by spreading the gain across multiple tax years.
For example, if you sell a property for $500,000 with a $100,000 gain, and the buyer pays you $100,000 per year over five years, you report $20,000 of gain each year instead of $100,000 in year one. This can keep you in a lower tax bracket each year and may reduce the total tax you owe, especially if your income varies year to year.
You must receive at least one payment in a year after the sale year for it to may have access to as an installment sale. You charge the buyer interest on the unpaid balance — the IRS sets a minimum rate each month. The buyer must sign a promissory note, and you should record a mortgage or deed of trust against the property as security. If the buyer defaults, you can foreclose and keep payments received so far.
Inherited property: the stepped-up basis advantage
When you inherit property, the IRS resets its cost basis to its fair market value on the date of the owner's death. This is called a stepped-up basis. If your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis becomes $400,000. If you sell it when ready for $400,000, you owe zero capital gains tax because there is no gain.
This is one of the largest tax advantages in the code. It applies to all inherited property — real estate, stocks, bonds, and other assets. You do not have to do anything to claim it; it happens automatically. The stepped-up basis applies only to property inherited at death, not to property received as a gift during someone's lifetime (gifts carry the original owner's basis forward).
The stepped-up basis applies to the entire property value as of the date of death, regardless of how long the original owner held it or how much they paid. If you inherit a rental property worth $1 million and sell it a month later for $1 million, you owe zero capital gains tax. If you hold it for five years and sell it for $1.2 million, you owe tax only on the $200,000 gain that occurred after you inherited it.
Timing the sale to manage your tax bracket
The year you sell a property affects your total taxable income for that year, which determines your tax bracket and the rate you pay on capital gains. If you are close to a tax bracket threshold, timing the sale to a different year can save you money.
For example, if your income is $100,000 and you are considering selling a property with a $50,000 long-term gain, selling this year would bring your total income to $150,000. If that pushes you from the 15% capital gains bracket into the 20% bracket, you would owe an extra $2,500 in tax. If you wait until next year when your income is lower, you might stay in the 15% bracket and save that money.
This strategy works best if you have control over the timing — if you are not forced to sell by circumstance. You can also use other deductions or losses to offset the gain. If you have investment losses in the same year, you can use them to reduce your capital gain. If you have no other income that year, you might fall into the 0% capital gains bracket entirely.
Frequently Asked Questions
Do I have to live in a house for two full years to use the primary residence exclusion?
No. You must have owned and lived in the home for at least two of the five years before the sale, but those two years do not have to be consecutive. You can have been away for part of that time as long as you owned the property the whole time. Some absences (military service, work assignment) may extend the important date.
What happens if I sell my primary residence and make more than $250,000 profit?
You exclude the first $250,000 of gain ($500,000 if married filing jointly) and pay capital gains tax on the amount above that. If you made a $400,000 gain as a single filer, you would owe tax on $150,000 of that gain at the long-term capital gains rate.
Can I do a 1031 exchange on my primary residence?
No. A 1031 exchange applies only to investment property and business property. If you are selling your primary residence, use the primary residence exclusion instead — it is usually a better deal because you do not have to reinvest the money.
If I inherit a house and sell it right away, do I owe capital gains tax?
Usually no. Your cost basis steps up to the property's value on the date of death, so if you sell it for that same value when ready, you have no gain and owe no tax. If the value increases between the date of death and the sale, you owe tax only on that increase.
Can I use the primary residence exclusion more than once?
You can use it once every two years. If you sold a home and used the exclusion, you must wait two years before using it again on a different home. The two-year period is measured from the date of the previous sale.