What to know about capital gains tax on a home sale

Breaking down provisions that impact what a seller may owe

Selling your home? Smart tax planning can help you keep more of what your home is worth. (Costar: Derrick Harvey)
Selling your home? Smart tax planning can help you keep more of what your home is worth. (Costar: Derrick Harvey)

Selling your home can be a financial windfall, but it can also trigger a hefty capital gains tax bill. Fortunately, there are several ways to reduce or avoid that tax if you know the rules.

Of course, it's impossible to provide information that applies to all sellers, as everyone's situation is unique. For guidance tailored to your specific situation, please consult a licensed tax professional.

Understand capital gains tax

Capital gains tax is the tax you pay on the profit from selling a capital asset such as a home, stocks, bonds or other investments. The tax applies only when you sell the asset for more than you paid for it. This profit is referred to as a “capital gain.” If you sell it for less than what you paid, that’s a “capital loss.”

What is your cost basis?

Your cost basis starts with the amount you paid to purchase your home, but it can also be adjusted over time. Permanent upgrades, also known as capital improvements, can increase your cost basis, while losses from property damage may reduce it. For tax purposes, a capital improvement is a lasting change that adds value, extends the life of your home, or prepares it for new uses. Routine maintenance and repairs, however, typically do not count as capital improvements.

It’s also worth noting that cost basis isn’t just important for single-family homes. The same principles apply to rental properties and other types of real estate.

Your cost basis is the total amount you’ve invested in your home and is the starting point for calculating your capital gain. The higher your cost basis, the lower your taxable gain will be. It can include:

  • Purchase price: What you paid to buy the property 
  • Eligible closing costs: Title fees, legal fees, recording fees (not all closing costs qualify) 
  • Capital improvements: New roof, kitchen remodel, heating and cooling system 
  • Certain assessments: Local government charges for permanent improvements, such as sidewalk installation or street paving 

“Homeowners often forget that improvements like solar panels or a new [heating and cooling] system can be added to their cost basis. That can significantly reduce the taxable gain,” Francine Lipman, the William S. Boyd professor of law at the University of Nevada, Las Vegas, told Homes.com. It's important to note that not all closing costs or assessments qualify. For example, loan origination fees and property taxes are excluded. And routine repairs (like fixing a leaky faucet) don’t count — only upgrades that add value or extend the home’s life. 

Pro tip: Keep receipts and documentation for all qualifying improvements. Routine repairs (like fixing a leaky faucet) don’t count, only upgrades that add value or extend the home’s life. Consult a tax professional to confirm which closing costs and assessments qualify.

Calculate your gain

To determine your capital gain:

  • Sale price: What you received when you sold the property
  • Purchase price: What you paid to buy the property
  • Adjusted cost basis: What you paid to buy the property, plus qualifying expenses and improvements
  • Sale Price – Adjusted Cost Basis = Capital Gain

Example:

  • Purchase price: $300,000 
  • Closing costs: $10,000 
  • Improvements: $40,000 
  • Adjusted cost basis = $350,000 
  • Sale price = $600,000 
  • Capital gain = $600,000 – $350,000 = $250,000 

According to Lipman, the most powerful tool for most homeowners is the Section 121 exclusion. The exclusion covers your time in the house. If you’ve lived in your home as your primary residence for at least two out of the last five years, you may be able to exclude a big chunk of your profit from the sale. The months don’t have to be consecutive. You can exclude up to $250,000 of gain if you’re single or $500,000 if you’re married filing jointly. “A lot of taxpayers, especially seniors, still think they have to reinvest their sale proceeds to exclude the gain. That’s not true anymore,” Lipman said. “You just need to meet the ownership and residency requirements.”

Pro tip: You can use the home sale exclusion more than once, but you must wait at least two years between each use. If you end up selling your house for less than you paid for it, you can’t claim that loss on your taxes. The IRS looks at your home like something you’ve used — so if you lose money when you sell, you just have to accept it. There’s no tax break for selling at a loss.

Hardship exemptions

Life happens. If you need to sell before meeting the two-year requirement because of unforeseen circumstances like a job loss, divorce, disability or even having triplets — you may qualify for a prorated exclusion.

“There’s a hardship rule that allows you to prorate the gain. For example, if you lived in the home for only one year and your spouse becomes disabled, you could exclude up to half the usual amount,” Lipman said.

Pro tip: Keep documentation of the hardship. Some examples include medical records, job termination letters and birth certificates to support your claim if audited.

Understand the step-up basis for inherited home

Inherited homes benefit from a step-up in basis, which resets the cost basis to the home’s fair market value at the time of the original owner’s death. This can dramatically reduce or eliminate capital gains tax when the heir sells the property.

“The step-up in basis is one of the most powerful tools in estate planning. It can eliminate hundreds of thousands in capital gains tax for heirs,” Lipman said.

Pro tip: This rule applies only to inherited property — not gifts.

Understand depreciation recapture for former rentals

If you’re selling a property that was previously used as a rental, you may owe a depreciation recapture tax. That’s a separate tax on the depreciation you claimed while renting it out. It’s taxed at a special rate: up to 25%, even if the rest of your profit is taxed at the (usually lower) long-term capital gains rate.

The $250,000 (single) or $500,000 (married filing jointly) exclusion applies to the profit you make when selling your primary home, as long as you meet the residency requirements. Depreciation recapture is separate. It applies specifically to the portion of your gain that comes from depreciation you claimed while the home was being used as a rental property. That part doesn’t qualify for the main home sale exclusion and is always taxed at the special recapture rate.

Any profit above the exclusion amounts (after accounting for depreciation recapture) is typically taxed at the long-term capital gains rate, which is usually lower than your regular income tax rate. So, it’s helpful to know that your home sale could involve both the special depreciation recapture rate and the long-term capital gains rate.

Pro tip: “The gain that occurs while a rental is held — you need to get an appraisal or at least some reasonable documentation to justify that value,” Lipman said. Keep records of depreciation claimed and get an appraisal when converting a rental to a primary residence.

Use a 1031 exchange for investment properties

A 1031 exchange is not available for your primary residence. It’s a strategy for deferring capital gains tax when selling and reinvesting in another investment or commercial property.

“A 1031 exchange can be a powerful tool for investors, but it comes with strict timelines and rules. You need to plan carefully," Lipman said.

Pro tip: You must identify a replacement property within 45 days and close within 180 days of the sale. Work with a tax expert to ensure compliance.

Time your sale strategically

Selling in a year when your income is lower can reduce your capital gains tax rate. Long–term gains are taxed at 0%, 15% or 20% depending on your income bracket.

“If you’re nearing retirement or expect a dip in income, that might be the ideal time to sell. You could qualify for the 0% capital gains rate,” Lipman said.

Pro tip: Coordinate with a tax advisor to time your sale for maximum savings.

Know your state rules

State tax laws vary widely. For example:

  • California taxes capital gains as ordinary income. That means it's taxed at the same rate as your salary or wages. 
  • Washington has no income tax, but it imposes a 7% capital gains tax on long-term gains exceeding $250,000.  

Pro tip: Check your state tax rules before selling. Some states offer no capital gains tax, while others may add significant costs.

When do you pay capital gains tax?

Your sale is taxed in the calendar year it occurs, and any tax owed is due by April 15 of the following year. That’s the standard IRS tax filing deadline.

If you sell your home in 2025, you’ll report the gain and pay any tax due on April 15, 2026, unless you file an extension.

Pro tip: If your capital gain is large, the IRS recommends making estimated quarterly payments or increasing your withholding to avoid penalties for underpayment.

"Anytime you have a big tax event, you should contact your CPA or tax attorney before the transaction … Not after the fact … Not the day before," Lipman said.

"November and December are a good time to be talking about tax planning, maybe for this year, year-end tax planning, and/or talking about what you're thinking about doing in 2026," she added.

Writer
Dani Romero

Dani Romero is a staff writer for Homes.com based in Washington, D.C. She previously covered the stock market with a focus on housing, real estate and the broader economy for Yahoo Finance in New York.

Read Full Bio