You cannot avoid capital gains tax entirely, but you can reduce what you owe through specific strategies that the IRS recognizes
Capital gains tax is what you pay on the profit when you sell property for more than you paid for it. You cannot eliminate this tax, but the law allows you to shrink your taxable gain through several concrete methods: using the primary residence exclusion, timing your sale to use losses elsewhere, holding the property longer to may have access to for lower tax rates, or donating appreciated property to charity instead of selling it. The strategy that works depends on how long you have owned the property, whether it is your home, and your overall income picture that year.
The most common and largest reduction comes from the primary residence exclusion. If you owned and lived in your home for at least two of the last five years before you sell, you can exclude up to $250,000 of gain from tax if you are single, or $500,000 if you are married filing jointly. This means if you bought your house for $300,000 and sell it for $700,000, and you may have access to, your taxable gain is $400,000 minus $250,000 (or $500,000 if married), leaving $150,000 (or $0) subject to tax. This exclusion is available once every two years.
Key Takeaways
- The primary residence exclusion lets you exclude up to $250,000 (single) or $500,000 (married) of profit from your home sale if you lived there two of the last five years.
- Long-term capital gains rates are lower than short-term rates; you may have access to for long-term rates if you held the property for more than one year before selling.
- You can use investment losses to offset gains in the same year, and carry forward unused losses to future years.
- Donating appreciated property to a may have access to charity lets you avoid the capital gains tax entirely while taking a charitable deduction for the full fair market value.
- Installment sales, 1031 exchanges, and opportunity zones are specialized strategies that defer or redirect gains rather than eliminate them.
How holding periods affect your tax rate
The IRS taxes capital gains at two different rates depending on how long you owned the property. Short-term capital gains — profit on property you held for one year or less — are taxed as ordinary income at your regular tax rate, which can be as high as 37 percent. Long-term capital gains — profit on property you held for more than one year — are taxed at preferential rates of 0 percent, 15 percent, or 20 percent, depending on your income level.
This difference is substantial. If you are in the 37 percent tax bracket and have a $100,000 gain, short-term treatment costs you $37,000 in federal tax. Long-term treatment at the 20 percent rate costs $20,000. The strategy here is simple: if you are planning to sell, waiting past the one-year mark to hold the property long-term can cut your federal tax bill significantly. This does not eliminate the tax, but it reduces it materially.
Your income level that year determines which long-term rate applies to you. For 2024, the 0 percent rate applies to single filers with taxable income up to $47,025, and married filers up to $94,050. The 15 percent rate applies to income above those thresholds up to $518,900 (single) or $583,750 (married). Income above those amounts is taxed at 20 percent. These income thresholds change yearly.
Using investment losses to offset gains
If you own other investments — stocks, bonds, rental properties, or other real estate — and some have lost value, you can sell those losers to create a capital loss. That loss can then offset capital gains from your property sale in the same year, reducing your taxable gain dollar-for-dollar. This strategy is called tax-loss harvesting.
For example, if you sell a rental property for a $50,000 gain and you also sell stocks that lost $30,000, your net capital gain for the year is $20,000, and that is what you pay tax on. If your losses exceed your gains in a year — say you have $50,000 in losses and only $20,000 in gains — you can use $20,000 to wipe out the gain, and carry the remaining $30,000 loss forward to future years. You can deduct up to $3,000 of unused losses against ordinary income each year, and carry forward the rest indefinitely.
This requires you to own investments that have declined in value, and it requires you to act before you sell the property. Once you have already sold and locked in the gain, you cannot retroactively create losses to offset it in that same tax year.
Donating appreciated property instead of selling
If you own property that has appreciated significantly and you want to support a charity, you can donate the property directly to a may have access to charitable organization instead of selling it. You avoid the capital gains tax entirely, and you receive a tax deduction for the fair market value of the property on the date you donate it.
This works best when the property has a large unrealized gain. If you bought land for $100,000 and it is now worth $400,000, donating it to a may have access to charity means you pay zero capital gains tax on the $300,000 gain. You also deduct $400,000 from your income that year (subject to limitations based on your adjusted gross income). The charity receives the property and can sell it or use it for their mission.
The property must go to a may have access to charitable organization — typically a 501(c)(3) nonprofit, a public charity, or a private foundation that meets IRS standards. You will need a may have access to appraisal of the property, and you must file Form 8283 with your tax return. The deduction is limited to a percentage of your adjusted gross income, usually 30 percent for real property donations, though unused deductions can carry forward five years.
1031 exchanges and opportunity zones
A 1031 exchange (named after the tax code section) lets you sell one investment property and buy another similar property without paying capital gains tax on the sale, as long as you follow strict timing and identification rules. You do not eliminate the tax; you defer it until you eventually sell the replacement property without doing another exchange.
The rules are rigid. You must identify the replacement property within 45 days of selling the original property, and you must close on it 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 home does not may have access to). You cannot touch the sale proceeds yourself; they must go to a may have access to intermediary who holds the money and transfers it to the seller of the replacement property.
Opportunity zones are another deferral tool. If you have capital gains from any source, you can invest them in a may have access to opportunity fund before the end of the year you realized the gain. You defer paying tax on those gains until 2026 or when you sell the fund investment, whichever comes first. If you hold the fund investment for at least ten years, you can exclude the gains earned inside the fund from tax. This is complex and requires the fund to invest in designated economically distressed areas.
Installment sales and timing strategies
An installment sale spreads the gain across multiple years instead of recognizing it all in the year you sell. You sell the property and the buyer pays you over time in installments. You report the gain proportionally as you receive each payment, which can keep you in a lower tax bracket each year instead of pushing you into a higher one with a large single-year gain.
For example, if you sell a property for $500,000 and the buyer pays you $100,000 per year over five years, you report one-fifth of your gain each year. If your gain is $200,000, you report $40,000 of gain each year. This can result in lower overall tax if it keeps you in the 15 percent long-term capital gains bracket instead of pushing you into the 20 percent bracket.
You can also time the sale to a year when your income is lower — for instance, if you are retiring and expect lower income in a particular year, selling that year may result in a lower tax rate on the gain. This requires planning ahead and coordination with your tax preparer, but it is a legitimate strategy.
State and local capital gains taxes
Federal capital gains tax is only part of the picture. Some states also tax capital gains. California, New York, Oregon, and several others impose state income tax on capital gains at rates ranging from 5 percent to over 13 percent. A few states — Washington, Tennessee, and others — have recently enacted capital gains taxes on investment income, though some are being challenged legally.
If you live in a state with capital gains tax and are considering moving, timing your move relative to your property sale can matter. If you sell while you are still a resident of a high-tax state, you owe that state's tax. If you establish residency in a no-tax or low-tax state before you sell, you may owe less. This requires genuine relocation — simply claiming residency elsewhere while you still live in the original state will not work, and the state can audit you to verify where you actually lived.
Frequently Asked Questions
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 in 2022, you cannot use it again until 2024. If you own multiple homes, you can only use the exclusion on one property per two-year period — the one you designate as your primary residence.
What if I inherited the property — does that change the capital gains tax?
Yes. Inherited property receives a "step-up in basis," meaning your cost basis is the fair market value on the date the person died, not what they originally paid. If you inherit a house worth $500,000 and sell it shortly after for $500,000, you have zero gain and owe no capital gains tax, even though the original owner may have bought it for $200,000.
Do I owe capital gains tax if I sell at a loss?
No. If you sell property for less than you paid for it, you have a capital loss, not a gain. You can use that loss to offset other gains or up to $3,000 of ordinary income per year, and carry forward unused losses indefinitely.
What if I rent out the property — does the primary residence exclusion still apply?
No. The exclusion only applies if you owned and lived in the home as your primary residence for at least two of the last five years before you sell. If you converted it to a rental property, you lose the exclusion on the portion of the gain that accrued after you moved out, though you may still may have access to for the exclusion on gains from the years you lived there.
Can I deduct the cost of improvements I made to reduce my gain?
Yes. Capital improvements — major renovations, additions, or upgrades that add value — increase your cost basis. If you bought a house for $300,000 and spent $50,000 on a new roof and kitchen, your basis is $350,000. If you sell for $500,000, your gain is $150,000 instead of $200,000. Keep receipts and documentation of all improvements.