You cannot avoid capital gains tax entirely, but several legal strategies can reduce what you owe

Capital gains tax on property is owed when you sell a home or investment property for more than you paid for it. The difference between your purchase price (plus improvements) and your sale price is your gain, and that gain is taxable income. However, the tax code includes specific exemptions and strategies that can lower your tax bill or eliminate it entirely — but they have strict rules about who qualifies and when you can use them.

The most common route is the primary residence exclusion: if you owned and lived in a home as your main residence for at least two of the last five years before selling, you can exclude up to $250,000 of gain from taxes (or $500,000 if you are married filing jointly). This is not a deduction — it means that portion of your gain is never taxed at all. Many homeowners pay zero capital gains tax because their gain falls below this threshold.

Beyond that exclusion, the strategies that work depend on what kind of property you own, how long you have held it, and what you do with the money after the sale. Some require you to reinvest the proceeds; others require you to hold the property longer before selling.

Key Takeaways

  • The primary residence exclusion lets you avoid taxes on up to $250,000 of gain ($500,000 if married) if you lived in the home for two of the last five years before selling.
  • 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.
  • Holding property for more than one year before selling qualifies you for long-term capital gains rates, which are lower than short-term rates and ordinary income tax rates.
  • Charitable donations of appreciated property and installment sales are legal structures that can reduce your tax burden, but each has specific requirements and trade-offs.
  • Strategies that work depend on the property type, your income, and your plans for the money after the sale — there is no single answer for everyone.

Primary residence exclusion: the most common tax break

If you are selling a home you have lived in, the primary residence exclusion is your first line of defense. You must have owned the property and used it as your main home for at least two of the last five years before the sale closes. The two years do not have to be consecutive, and you can have rented it out or left it vacant for part of that period — what matters is that it was your primary residence for the time you did occupy it.

The exclusion amount is $250,000 for single filers and $500,000 for married couples filing jointly. If your gain is less than that, you owe no federal capital gains tax on the sale. If your gain exceeds the exclusion, you pay tax only on the amount above it. You can use this exclusion only once every two years, so if you sold a home two years ago and used the exclusion then, you cannot use it again until two years have passed from that sale date.

State and local taxes are separate: some states do not tax capital gains at all, while others tax them as ordinary income. The federal exclusion does not reduce state taxes, so you may still owe state capital gains tax even if you owe nothing to the federal government.

1031 exchanges: deferring tax by reinvesting in another property

A 1031 exchange (named after the section of the tax code) lets you sell an investment property and defer capital gains tax by reinvesting the proceeds into another investment property. You do not avoid the tax — you postpone it until you eventually sell the replacement property without doing another exchange. The strategy works only for investment or business property, not for your primary residence.

The rules are strict. You have 45 calendar days from the sale closing date to identify which replacement property (or properties) you want to buy. You then have 180 calendar days from closing to actually close on the replacement property. The replacement property must be of equal or greater value than the property you sold, and it must be held for investment or business use. You cannot use the proceeds for personal expenses or hold them yourself — a may have access to intermediary must hold the money between the sale and the purchase.

If you miss either deadline or buy a replacement property of lower value, the entire gain becomes taxable in the year of the sale. Many people use 1031 exchanges to move between rental properties or commercial real estate over decades, deferring tax each time until they eventually sell without reinvesting.

Long-term versus short-term capital gains rates

How long you hold a property before selling affects the tax rate you pay on the gain. If you sell within one year of purchase, the gain is short-term capital gain and is taxed as ordinary income at your regular tax bracket — potentially 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your income. If you hold the property for more than one year, the gain is long-term capital gain and is taxed at lower rates: 0%, 15%, or 20% depending on your income level.

For most people, the difference is significant. A $100,000 gain taxed as short-term capital gain at the 24% rate costs $24,000 in federal tax. The same gain as long-term capital gain at the 15% rate costs $15,000. Holding the property an extra few months to cross the one-year threshold can save thousands in taxes.

This is why investors often hold rental properties for years before selling: the long-term rate is substantially lower. The one-year holding period is measured from the date you took ownership (the closing date), not from when you began using the property or when you made improvements.

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 avoid capital gains tax on the appreciation entirely. When you donate appreciated property directly to a charity (rather than selling it first and donating the proceeds), you owe no capital gains tax on the gain. You also receive a charitable deduction on your tax return for the fair market value of the property at the time of donation.

This strategy works best when the property has appreciated significantly and you were planning to donate to charity anyway. You get a tax deduction for the full current value, and the charity receives the property without you having to pay capital gains tax. The property must go to a may have access to charitable organization — the IRS maintains a list of may be able to access charities, and you will need a written appraisal of the property's value for your tax records.

The downside is that you no longer own the property and cannot use it. This strategy makes sense for investors who have accumulated rental properties or land they no longer want and have charitable giving goals.

Installment sales: spreading the gain over multiple years

An installment sale is a structure where you sell the property but the buyer pays you over time in installments rather than in a lump sum at closing. Instead of recognizing all the gain in the year of sale, you recognize a portion of the gain each year as you receive payments. This can lower your taxable income in any single year and may keep you in a lower tax bracket.

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 recognize $20,000 of gain each year rather than $100,000 in year one. This can be especially useful if you are near a tax bracket threshold or if recognizing all the gain at once would trigger other tax consequences (such as higher Medicare premiums or loss of certain deductions).

The buyer must make a substantial down payment (usually at least 20%), and you become the lender for the remaining balance. You receive interest payments in addition to principal, and that interest is taxable as ordinary income. The strategy requires a creditworthy buyer and involves risk if the buyer defaults on payments.

Holding property longer and timing the sale strategically

The simplest way to reduce capital gains tax is to hold the property longer before selling. Every additional year you hold an investment property increases the likelihood that appreciation will be taxed at long-term rates rather than short-term rates. If you have flexibility on when to sell, waiting until you have held the property for more than one year can cut your tax bill substantially.

Timing the sale within a specific tax year can also matter. If you have had a loss in another investment or business that year, you can use that loss to offset capital gains from the property sale, reducing your taxable gain. If you are near retirement and expect your income to drop in a future year, selling in that lower-income year may result in a lower tax rate on the gain. These strategies require planning with a tax professional who knows your full financial picture.

For primary residences, timing is less critical because of the exclusion, but for investment properties, the year and month of sale can make a meaningful difference in your total tax bill.

Frequently Asked Questions

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

Yes, if the home was your primary residence for at least two of the last five years. However, if you rented out part of it or used part as a business, you may owe depreciation recapture tax on that portion — a separate tax on the depreciation deductions you claimed while renting it. The exclusion still applies to the portion you lived in.

What if I sell a property at a loss — can I deduct the loss?

Capital losses on investment property can be deducted against capital gains in the same 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. Losses on primary residences cannot be deducted at all.

Do I have to report the sale to the IRS even if I owe no tax?

Yes. You must report the sale on Form 8949 and Schedule D, even if the gain falls within the primary residence exclusion or is otherwise not taxable. The IRS uses this information to track property transactions. Failure to report can result in penalties.

Can I do a 1031 exchange with a primary residence?

No. The 1031 exchange applies only to investment or business property. Your primary residence does not may have access to, even if you plan to rent it out after the exchange. You must use the primary residence exclusion instead.

What counts as an improvement versus routine maintenance for reducing my gain?

Improvements that add value or extend the life of the property (new roof, addition, major renovation) reduce your gain because they increase your cost basis. Routine maintenance and repairs (painting, fixing a leak, replacing worn carpet) do not. Keep receipts for all work done — you will need them to document your basis when you sell.