You cannot avoid capital gains tax entirely, but you can reduce what you owe through specific strategies the IRS allows
Capital gains tax on property is not optional — when you sell real estate for more than you paid for it, the profit is taxable income. However, the IRS has built several legitimate pathways into the tax code that lower or eliminate the tax on that gain. The most common is the primary residence exclusion, which lets you exclude up to $250,000 (or $500,000 if married filing jointly) of profit if you meet ownership and use tests. Beyond that, strategies like timing your sale, using tax-loss harvesting on other investments, making charitable donations of appreciated property, or holding property longer to may have access to for long-term capital gains rates can meaningfully reduce your bill. None of these are loopholes — they are features Congress wrote into the tax code.
The strategies that work best depend on what kind of property you are selling, how long you have owned it, and whether you have other investments or income to work with. A primary home qualifies for different rules than a rental property or investment land. Understanding which strategies explore to your situation helps you make a sale decision that minimizes your tax bill.
Key Takeaways
- The primary residence exclusion lets you exclude up to $250,000 of profit ($500,000 if married) if you owned and lived in the home for at least two of the last five years before sale.
- Long-term capital gains rates (15% or 20% for most people) are lower than short-term rates (your ordinary income tax rate), so holding property longer than one year before sale reduces your tax.
- You can offset capital gains from property sales with capital losses from other investments, dollar for dollar, up to $3,000 per year against ordinary income.
- Donating appreciated property directly to a may have access to charity lets you deduct the full fair market value and avoid the capital gains tax entirely on that property.
- A 1031 exchange lets you defer (not eliminate) capital gains by reinvesting the proceeds into another investment property of equal or greater value within strict timelines.
The primary residence exclusion: the biggest tax break for homeowners
If you are selling a home you have lived in, you may be able to exclude $250,000 of profit from taxable income (or $500,000 if you are married filing jointly). This is not a deduction — it is an exclusion, meaning that portion of gain straightforward does not count as income at all. To may have access to, you must have owned the home 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 do not have to live there on the day you sell. If you owned the home for five years but lived there for only two of those years, you still may have access to. If you are married and both spouses meet the test, you can exclude $500,000 together. If only one spouse meets the test, that spouse can exclude $250,000 and the other cannot exclude any. This exclusion is available once every two years. If you sold a home and used the exclusion, you cannot use it again on another home sale until two years have passed. You report this exclusion on Schedule D (Form 1040) when you file your tax return — you do not need to file anything with the IRS beforehand.
Holding property longer to may have access to for long-term capital gains rates
The IRS taxes short-term capital gains (property held one year or less) at your ordinary income tax rate, which can be as high as 37%. Long-term capital gains (property held more than one year) are taxed at 0%, 15%, or 20%, depending on your income. For most people, the long-term rate is 15%. Holding an investment property for just over one year instead of selling it within a year can cut your tax bill significantly.
This matters most for investment property, rental property, or land — not your primary home, which already has the exclusion. If you are considering selling an investment property, check whether you are close to the one-year mark. If you bought it eleven months ago, waiting one more month could save you thousands in taxes. The holding period starts the day after you buy the property and ends the day you sell it. For someone in the 37% tax bracket, the difference between short-term and long-term rates on a $100,000 gain is roughly $22,000 in taxes.
Using capital losses to offset capital gains
If you have investments that have lost value — stocks, mutual funds, or other property — you can sell them to create a capital loss. That loss can be used to offset capital gains from your property sale, dollar for dollar. If you sold a rental property and owe tax on a $50,000 gain, and you have a $50,000 loss from selling stocks, the two cancel out and you owe no capital gains tax on the property.
If your losses exceed your gains in a single year, you can use up to $3,000 of the excess loss to reduce your ordinary income (like wages or interest). Any loss beyond that carries forward to future years, so you can use it to offset future gains or income. This strategy is called tax-loss harvesting, and it is most useful if you have a brokerage account with investments that have declined in value. You cannot create an artificial loss by selling to a family member or related party and then buying the same investment back. The IRS has a wash-sale rule that disallows losses if you buy the same or substantially identical investment within 30 days before or after the sale. For property, this rule is less restrictive, but the principle is the same: the loss must be real.
Donating appreciated property instead of selling it
If you own property that has increased in value and you want to support a charity, you can donate the property directly to a may have access to charitable organization. You get a tax deduction for the full fair market value of the property, and you avoid paying capital gains tax on the appreciation entirely. This is often better than selling the property and donating the proceeds, because you save the capital gains tax.
For example, if you bought land for $100,000 and it is now worth $300,000, selling it would trigger a $200,000 capital gain and a tax bill of roughly $30,000 to $40,000 (depending on your tax bracket). If you donate it instead, you deduct $300,000 and owe no capital gains tax. The charity receives the full $300,000 value. You must donate to a may have access to organization — the IRS website has a search tool to verify charity status — and you must obtain a may have access to appraisal for property worth over $5,000. The deduction itself is subject to limits based on your adjusted gross income, so you may not be able to deduct the full amount in a single year, but you can carry the excess forward to future years.
Deferring gains through a 1031 exchange
A 1031 exchange (named after Section 1031 of the tax code) lets you sell investment property and reinvest the proceeds into another investment property without paying capital gains tax on the sale. The tax is deferred, not eliminated — you will owe it when you eventually sell the replacement property, unless you do another 1031 exchange at that time.
The rules are strict. You must identify a replacement property within 45 days of selling the original property, and you must close on the replacement within 180 days. The replacement property must be of equal or greater value, and it must be investment or business property (not your primary home). You cannot touch the proceeds from the sale — a may have access to intermediary must hold the money and transfer it directly to the seller of the replacement property. If you receive any of the proceeds, that portion is taxable when ready. 1031 exchanges are complex and require careful timing and documentation. Most people work with a may have access to intermediary (a company that specializes in these transactions) to may support compliance. The cost of using an intermediary is typically $500 to $1,500, but it is worth it to avoid mistakes that could trigger when ready taxation.
Timing your sale to stay in a lower tax bracket
Capital gains tax is tied to your income tax bracket. If you are in a lower bracket one year, your capital gains tax rate may be lower that year. If you have flexibility in when you sell, you might sell in a year when your other income is lower — for example, after you retire, or in a year when you had a business loss or took unpaid leave.
This is most useful if you are close to a tax bracket boundary. If you are near the top of the 15% long-term capital gains bracket, selling in a year when your income is lower might keep you in the 15% bracket instead of pushing you into the 20% bracket. The income thresholds change each year, so you would need to check the current year's rates with a tax professional or the IRS website. For married couples filing jointly, the 15% long-term capital gains bracket ends at a higher income level than for single filers, so your filing status also affects which bracket you fall into.
Installment sales and spreading income across multiple years
If you sell property and the buyer pays you over time (rather than in a lump sum), you can report the gain using the installment method. This spreads the taxable gain across multiple years as you receive payments, which can keep you in a lower tax bracket each year instead of bunching all the gain into one year. You must report the sale on Form 6252 and follow specific rules about interest and documentation.
Installment sales are most useful for large gains. If you sold a property for a $200,000 gain and the buyer pays you $50,000 per year over four years, you report $50,000 of gain each year instead of $200,000 in year one. This can save thousands in taxes by keeping you in a lower bracket. However, you must charge interest on the unpaid balance — the IRS sets a minimum interest rate each month — and you carry the risk that the buyer defaults. You also remain liable for the full tax even if the buyer stops paying, so this strategy works best when you have confidence in the buyer's ability to pay.
Frequently Asked Questions
Can I use the primary residence exclusion if I rent out part of my home?
Yes, as long as you live in the home as your primary residence. If you rent out a portion (like a guest house or basement apartment), you still may have access to for the exclusion on the portion you live in. However, you may owe capital gains tax on the rental portion's appreciation. You should consult a tax professional to determine how to allocate the gain between the two portions.
What if I inherited property — do I owe capital gains tax when I sell it?
Inherited property receives a stepped-up basis, meaning its tax basis is reset to its fair market value on the date of death. If you inherit a home worth $500,000 and sell it a year later for $510,000, you owe tax only on the $10,000 gain, not the entire $510,000. This is a major tax benefit of inherited property and applies to most inherited assets, not just real estate.
Can I do a 1031 exchange with my primary home?
No. 1031 exchanges are only for investment or business property. Your primary residence does not may have access to, but you would use the primary residence exclusion instead, which is usually more valuable. If you are selling a vacation home or rental property, a 1031 exchange may be an option.
Do I have to report the sale to the IRS even if I do not owe tax?
Yes. Even if your gain is fully excluded (like under the primary residence exclusion), you must report the sale on Schedule D (Form 1040) when you file your tax return. The IRS receives a copy of the closing statement from the title company, so they know you sold the property. Failing to report it can trigger an audit.
What is the difference between a capital gain and ordinary income tax?
Capital gains are profits from selling assets (like property or investments). Ordinary income is wages, interest, and business income. Capital gains are taxed at lower rates (0%, 15%, or 20% for long-term gains) than ordinary income (up to 37%). This is why holding property longer than one year matters — it qualifies for the lower long-term rate.