Back to Blog

Capital Gains Tax When Selling a Home: What You Need to Know

When selling a home in the United States, many people focus on how much their property has appreciated and what price they can sell it for. However, just as important as the sale price is the capital gains tax when selling a home.

Selling a property is not just a transaction—it involves multiple financial components, including capital gains tax, state withholding taxes, real estate commissions, and closing costs. While U.S. tax law provides significant benefits for primary residences, it applies stricter rules to investment properties and non-resident owners.

If you are planning to sell a home, understanding the tax structure and total selling costs in advance is essential.



What Is Capital Gains Tax When Selling a Home?

The most important tax when selling a home in the U.S. is capital gains tax.

In simple terms, if you sell your home for more than you originally paid, the profit (capital gain) may be subject to tax.

The basic formula is:

  • Purchase Price
  • Sale Price
  • Capital Gain = Sale Price – Purchase Price – Eligible Costs

This means that the capital gains tax when selling a home is based not on how much you sold the home for, but on how much profit you actually made.



How Much Tax Can You Avoid on a Primary Residence?

One of the most important tax benefits when selling a home is the capital gains exclusion for primary residences.

If you meet certain requirements, you may exclude part of your capital gain from taxation.

Exclusion Limits

  • Single: up to $250,000
  • Married filing jointly: up to $500,000

2-out-of-5 Year Rule

To qualify, you generally must:

  • Own the home for at least 2 years out of the last 5 years
  • Live in the home for at least 2 years out of the last 5 years

These 2 years do not need to be consecutive.

If you qualify, your capital gains tax when selling a home can be significantly reduced.

What If You Don’t Meet the 2-Year Rule?

If you do not meet the full requirement, you may still qualify for a partial exclusion if the sale is due to:

  • Job relocation
  • Health reasons
  • Divorce
  • Unemployment

In these cases, the exclusion is prorated based on the time you lived in the home.



How Are Investment Properties Taxed?

Investment properties are taxed differently and usually face a higher tax burden.

Key taxes include:

  • Short-term or long-term capital gains tax (depending on holding period)
  • Depreciation recapture (up to 25%)
  • State income tax

How to Defer Taxes: 1031 Exchange

One common strategy is a 1031 Exchange.

This allows you to defer capital gains tax if:

  • You reinvest the proceeds into a similar property
  • Within 180 days

This does not eliminate tax, but postpones it.



How to Reduce Capital Gains

To reduce your capital gains tax when selling a home, it’s important to calculate your Adjusted Basis correctly.

  • Home Purchase Costs: Ownership transfer fees, service charges, attorney fees, recording fees, title insurance, and related costs paid at the time of purchase.
  • Capital Improvements: Costs that increase the value of the home or extend its useful life, rather than routine repairs.
    • Included: Roof replacement, remodeling, kitchen or bathroom upgrades, HVAC system installation, landscaping, and similar improvements.
    • Not Included: Routine maintenance such as painting and minor repairs is not added to the cost basis.

Keeping records and receipts is critical for accurate tax calculations.



Other Costs When Selling a Home

Taxes are not the only costs involved in selling a home.

Typical expenses include:

  • Real estate agent commission
  • Closing costs
  • Title-related fees
  • Recording and administrative fees
  • Marketing and advertising costs
  • Home staging and photography

These costs reduce your net proceeds. That’s why you should focus on net profit, not just the sale price.



Why Do Taxes Differ by State?

When selling a home, taxes are not only federal—state taxes also apply.

For non-residents or foreign sellers, withholding tax rules often apply at closing.

① Federal Tax: FIRPTA (For Foreign Sellers)

If the seller is a foreign national, FIRPTA applies.

  • Withholding rate: 15% of the sale price
  • Based on: Gross Sales Price (not profit)
  • Collected at closing, with a potential refund after filing your tax return.

② State Withholding Taxes

Each state has its own rules, which can affect your cash flow at closing.

  • California
    • 3.33% withholding on sale price (non-residents)
    • Exemptions may apply if conditions are met
  • New York
    • About 2% of sale price or up to 8.82% of gain
    • Non-resident estimated tax requirement
    • Additional NYC tax may apply
  • New Jersey
    • 2% of sale price or 8.97% of gain (whichever is lower)
    • Known as “Exit Tax” (prepayment structure)



Sale Price ≠ Net Profit

Selling a home does not mean you keep the full sale price.

You must account for:

  • Capital gains tax
  • State taxes
  • Withholding taxes
  • Agent commissions
  • Closing costs
  • Repairs and preparation costs



Before selling your home, calculate your taxes and costs first.

Selling a home in the U.S. is not just a transaction—it is a financial decision involving taxes, costs, and strategy.

Understanding the capital gains tax when selling a home, along with state taxes and selling expenses, can help you avoid unnecessary losses and make better decisions.

The more prepared you are, the more effectively you can maximize your final proceeds.

Learn more about the U.S. home selling process at Loaning.ai.