From Spotlight: Get Ready for Tax Filing—the Easy Way

How to Avoid Capital Gains Tax on a Home Sale

When your home value goes through the roof, you may end up with capital gains when you sell. Here are tips to limit tax liability.

Graphic of a green house with a blue background featuring dollar signs.
Image: HouseLogic

Most homeowners aim for a substantial increase in home value – and many are achieving it when they sell their primary home. But that increase can come with a thorny issue: capital gains tax when they file their tax returns after selling. If you’re in that situation or anticipating it, you can take advantage of a number of strategies to pay lower capital gains tax on real estate.

Understanding the Capital Gains Problem

Many homeowners who purchased their homes long ago have seen huge gains in the value of their residences. When they ultimately sell their houses, the gain may extend beyond the federal tax law's maximum exclusion amounts on capital gains of $250,000 for single filers and $500,000 for married couples. That can leave the sellers on the hook for a large capital gains tax on the sale.

“The problem is that in 1997, when the maximum exclusion levels were added to the tax code, they were not indexed to inflation,” says Evan Liddiard, CPA, director of federal tax policy for the National Association of REALTORS®. So, the amounts we see today are still the same as they were in 1997, when these were big numbers and virtually no one went over them. Today, because of inflation, a $250,000 or $500,000 gains of much more than $250,000 or $500,000 are not uncommon, so many people go over, especially in higher-priced markets.”

Take the Tests to See if You Qualify for Exclusions

To qualify for the exclusions, you must satisfy tests that you’ve lived in your house for at least two of the last five years and have owned it for at least two of the last five years, says Jack McGuff IV, owner of McGuff Financial, based in Pearland, Texas. If you don’t meet these requirements and haven’t yet sold your home, you might consider delaying a home sale until you’ve satisfied the necessary use and ownership tests, he adds.

If you rented out your primary residence for a period before a sale, however, you may lose a portion or all of the exclusion, McGuff continues. That’s because the property would be considered a rental property for tax purposes.

How Cost Basis Factors into Capital Gains Tax

You can think of cost basis in real estate as the total cost of buying the property. Consider it as a baseline, says Quicken Loans: When you sell the property, the cost basis is subtracted from the net sales price to determine capital gains tax liability. That’s why you should document the cost basis of your home over time.

To calculate the cost basis of their homes, owners typically start with the purchase price. The cost basis rarely stays the same over time, and once it’s changed, it becomes the adjusted basis. Several factors can increase or decrease the adjusted basis, says McGuff.

Increases in adjusted basis can result from:

  • The cost of additions and improvements to the house
  • Money spent to restore the property after damages or loss
  • Legal fees incurred in relation to the property

Decreases in adjusted basis can result from:

  • Receipt of insurance payments due to a casualty loss or theft
  • Tax credits for home energy improvements

If you sold your primary home last year, there’s little you can do to avoid capital gains tax liability when you file taxes this April, Liddiard says. "If [a homeowner] sold their house and had a gain over the exclusion amount, they’re going to pay taxes. If they have some capital losses pending, these might offset the gains if they took the losses in the same year. But most people are not walking around with huge unrealized capital losses.”

Capital Gains Tax Strategies for Those Planning to Sell in 2024

If you’re planning to sell your home in 2024 and believe you may have a large enough gain to trigger a capital gains liability, you can consider these three strategies:

Tax Loss Harvesting

This involves the sale of securities at a loss to offset capital gains taxes owed on profits, says Paul Miller, CPA, founder of Miller & Company, an accounting firm based in Queens, N.Y. “Of course, any harvested losses from previous years that have not been offset by gains will be applied against the current year gain,” McGuff says. “This highlights the importance of regular tax-loss harvesting in your after-tax nonretirement investment accounts throughout the year.”

Contribution to a Traditional IRA

Another option would be to contribute to a traditional IRA to reduce taxable income, subject to contribution limits and deductibility phaseouts, says McGuff. “If an individual is part of a high-deductible health care plan, making a contribution into their health savings account would also reduce taxable income.”

Donation to a Qualified Charitable Organization

Charitably inclined individuals might consider donating cash or appreciated property to a qualified charitable organization, potentially providing a tax deduction to help offset that tax year’s taxable income. Deductibility depends on the type of charity and is also subject to a percentage of the taxpayer’s adjusted gross income. “Any unused charitable contributions can be carried forward for five years,” McGuff says. “Unfortunately, many taxpayers are forced to bite the bullet if they have not utilized any of these strategies in a timely fashion.”

Consider Tax Changes for 2024 Tax Year

If you’re planning to sell your home, consider tax changes initiated for tax year 2024, McGuff says. For example, the Qualified Charitable Distribution cap has been indexed for inflation and now stands at $105,000. This change permits owners of IRAs who are 70 and a half or older to transfer up to $105,000 in 2024 from their IRAs directly to a qualified charity and avoid income tax on those amounts. “These amounts will count toward the required minimum distribution for the respective tax year,” McGuff says.

In addition, the elective deferral limit for 401(k), 403(b), 457(b), and Roth 401(k) plans now stands at $23,000, with a catch-up contribution of $7,500 permitted for those 50 and older. IRA contribution limits have increased from $6,500 to $7,000 for 2024 with a $1,000 catch-up contribution for those 50 and older. Deductible contribution limits to health savings accounts have also increased from $3,850 to $4,150 for singles, and from $7,750 to $8,300 for families. HSA holders 55 and older can contribute an extra $1,000 to their HSAs.

Also in 2024, the IRS increased the standard deduction by $1,500, to $29,200, for married couples filing jointly, plus $1,550 for each spouse 65 and older. The standard deduction is now $14,600 for single filers and $16,550 for singles 65 and older, McGuff says.

Liddiard explains that NAR and other stakeholders are supporting raising the maximum exclusion levels by backing the More Homes on the Market Act, introduced in the House in September 2022. The bill would double the tax exclusion on the gain from sale of a principal residence and require future annual inflation adjustments to the amount. “It’s an uphill battle to get that passed, because the problem is not as serious in all parts of the country,” he says.

For now, if you’ve experienced a significant increase in the value of your primary home and plan on selling, develop a capital gains strategy as soon as possible before selling your home. And be sure to track changes in your adjusted cost basis. Depending on the amount involved, you might also consider hiring a tax advisor.

Jeffrey Steele

Jeffrey Steele has been a Chicago-based freelance writer for almost one-third of a century, during which he's written extensively about real estate. Since 1991, he’s never been without at least one writing assignment – and more often a dozen. His byline has appeared thousands of times in publications including Barron’s,, Boston Globe, and Chicago Tribune.