Calculators Guides
PocketWiseGuides › Capital Gains Tax on Home Sales

Capital Gains Tax on Home Sales: How Much You'll Owe

What Is Capital Gains Tax on a Home Sale — and Should You Be Worried?

Selling your home is one of the biggest financial transactions most people ever make. And if your home has appreciated significantly — which, let's be honest, is the whole point — the IRS will want to know about it. That's where capital gains tax on home sales comes in.

Here's the good news up front: most homeowners who sell their primary residence pay zero capital gains tax. Congress built a generous exclusion into the tax code specifically to protect everyday homeowners from being wiped out by taxes when they sell. But "most" isn't "all," and knowing where you stand before you sign a listing agreement can save you from a very unpleasant surprise come April.

This guide walks you through exactly how the tax works, who qualifies for the exclusion, how to run the math on your own sale, and what to do if your gain is larger than the exclusion allows. No jargon, no hand-waving — just a clear picture of what you'll actually owe.

The Primary Residence Exclusion: Your Biggest Break

The centerpiece of home sale tax rules is the Section 121 exclusion, named after its spot in the Internal Revenue Code. It lets you exclude up to $250,000 in capital gains from your taxable income if you're a single filer, or up to $500,000 if you're married filing jointly. For most homeowners in most markets, that exclusion covers the entire gain — meaning no tax owed at all.

But the exclusion isn't automatic. You have to meet two tests:

The Ownership Test

You must have owned the home for at least two of the five years before the sale date. The two years don't have to be consecutive — they just need to add up to 24 months within that five-year window.

The Use Test

You must have used the home as your primary residence for at least two of the five years before the sale. Again, not necessarily consecutive — but it needs to be your main home, not a vacation property or rental.

Both tests must be satisfied. And you can only use this exclusion once every two years — so if you sold another home and claimed the exclusion in the past 24 months, you'll need to wait before claiming it again.

Primary Residence Exclusion: Quick Reference
Filing Status Maximum Exclusion Ownership Requirement Use Requirement Frequency Limit
Single / Married Filing Separately $250,000 2 of last 5 years 2 of last 5 years Once every 2 years
Married Filing Jointly $500,000 Either spouse must own for 2 of last 5 years Both spouses must use for 2 of last 5 years Once every 2 years
Widowed Filers (within 2 years of spouse's death) $500,000 2 of last 5 years 2 of last 5 years One-time use post-death
Partial Exclusion (unforeseen circumstances) Prorated based on time lived in home Less than 2 years may qualify Job relocation, health, other qualifying reasons Per qualifying event

The IRS publishes the full rules in IRS Publication 523: Selling Your Home — it's more readable than most IRS documents and worth bookmarking if you're planning a sale.

How to Calculate Your Capital Gain (Step by Step)

Before you can know how much tax you owe, you need to know how large your gain actually is. The formula sounds simple — sale price minus what you paid — but the real calculation involves a few more pieces. Get them right and you might discover your taxable gain is significantly smaller than you thought.

Step 1: Determine Your Adjusted Basis

Your basis is generally what you paid for the home. But your adjusted basis is that purchase price plus certain costs you've added over the years:

What doesn't count: routine repairs and maintenance (painting, fixing a leaky faucet, replacing carpet that wore out). Those don't add to your basis.

Step 2: Calculate Your Amount Realized

Your amount realized is the sale price minus selling costs:

Step 3: Calculate Your Gain

Amount Realized − Adjusted Basis = Capital Gain (or Loss)

Step 4: Apply the Exclusion

If you qualify, subtract your exclusion amount ($250,000 or $500,000). Whatever remains is your taxable capital gain.


Example 1: The Straightforward Sale (No Tax Owed)

Sarah and James bought their home in 2015 for $320,000. They've lived there as their primary residence ever since. In 2025, they sell for $780,000.

They pay no capital gains tax at all. Their improvements and the $500,000 exclusion together wiped out any tax liability.


Example 2: The High-Appreciation Sale (Tax Is Owed)

David bought a home in San Francisco in 2010 for $550,000 as a single buyer. He's lived there as his primary residence. In 2025, he sells for $1,600,000.

David has a significant taxable gain. What he owes now depends on the capital gains tax rates — which brings us to the next section.


Example 3: The Short-Hold Sale (Ordinary Income Tax Applies)

If you've owned the home for less than one year before selling, your gain is treated as a short-term capital gain — taxed at ordinary income rates, not the lower long-term rates. This can mean paying 22%, 24%, 32%, or even 37% depending on your bracket. Selling quickly can be very expensive from a tax standpoint, so if you're within a year of purchase, do the math carefully before listing.

Capital Gains Tax Rates: What You'll Actually Pay

For homes you've owned longer than one year, gains above your exclusion are taxed at long-term capital gains rates. These are meaningfully lower than ordinary income tax rates — and for many middle-income homeowners, the rate is 15%.

2025 Long-Term Capital Gains Tax Rates
Tax Rate Single Filers (Taxable Income) Married Filing Jointly (Taxable Income)
0% Up to $47,025 Up to $94,050
15% $47,026 – $518,900 $94,051 – $583,750
20% Over $518,900 Over $583,750

Important: These rates apply to your total taxable income — including your capital gain. So if David (from Example 2 above) has $100,000 in other income plus $628,000 in taxable gain, his total taxable income is $728,000, pushing the gain into the 20% bracket. His federal capital gains tax would be roughly $125,600 on the gain alone. That's not nothing — but it's also not the 37% rate he'd face on ordinary income in that bracket.

The Net Investment Income Tax (NIIT)

Higher-income sellers face one more layer: the 3.8% Net Investment Income Tax. This applies to capital gains for individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). So at the top end, effective capital gains tax on a home sale can reach 23.8% federally.

State Capital Gains Taxes

Most states also tax capital gains — many at ordinary income rates. California, for instance, taxes capital gains as regular income, with rates up to 13.3%. That can make a high-gain California sale a significant tax event even after the federal exclusion. Check your state's rules before you assume you're in the clear.

Situations That Change the Calculation

You Rented Part of Your Home

If you've ever rented out a portion of your home — a basement apartment, a room on Airbnb — things get more complicated. The portion of the gain attributable to the rental use doesn't qualify for the exclusion. You'll need to allocate the gain between personal use and rental use, and you may also face depreciation recapture on any depreciation you claimed during the rental period. Depreciation recapture is taxed at a flat 25% rate, which can be a real bite if you've been depreciating the property for years.

You Converted a Rental to Your Primary Residence

Under rules that took effect in 2009, if you buy a property as a rental and later move in, the portion of appreciation that occurred during the rental period is no longer excluded — even after you've lived there for two years. The gain is split on a time basis: rental months versus total months of ownership. The rental-period portion is taxable; the personal-use portion qualifies for exclusion.

You Used the Home Office Deduction

If you've been deducting a home office, you may owe depreciation recapture on the depreciation you claimed. However, the home office itself doesn't disqualify you from the exclusion on the rest of the home — it just carves out the depreciated portion.

Divorce and Home Sales

If you're selling a home as part of a divorce, the rules get nuanced. A spouse who received the home via divorce decree can generally count the other spouse's ownership period toward the two-year ownership test. The use test still applies separately, so if one spouse moved out and the other lived there, only the spouse who lived there qualifies on the use side. For a joint sale as part of divorce, you can sometimes still claim the full $500,000 exclusion if both spouses meet the use test.

Inherited Homes

Inherited property gets a step-up in basis to the fair market value at the date of the original owner's death. This is one of the most valuable features in the tax code — if your parent bought a home for $100,000 that's now worth $600,000 at their death, your basis steps up to $600,000. Sell it soon after for $625,000, and you only owe tax on $25,000 of gain. The inherited home rules bypass the Section 121 residency requirements entirely if you don't live there.

Partial Exclusion for Unforeseen Circumstances

If you're forced to sell before meeting the two-year requirement — due to job loss, job relocation more than 50 miles away, health issues, or other qualifying unforeseen circumstances — you may still claim a prorated exclusion. The fraction is calculated as: months you lived there ÷ 24 months, multiplied by the full exclusion amount. So if you lived in the home for 12 of the required 24 months, you'd qualify for 50% of the exclusion ($125,000 single / $250,000 married).

How to Reduce Your Capital Gains Tax Before You Sell

Document Every Improvement — Religiously

This is the single most overlooked tax strategy for homeowners. Every dollar you spend on capital improvements increases your adjusted basis, which reduces your gain dollar for dollar. A $30,000 kitchen renovation that happened eight years ago can save you $4,500 in taxes (at 15%) when you sell. Keep every receipt, every permit, every contractor invoice. Photograph the work. Store copies in the cloud. The IRS may ask for proof.

What counts: additions, new HVAC systems, new roof, landscaping that adds value, new driveway, hardwood floors, built-in appliances, solar panels, new windows and doors. What doesn't: painting, routine repairs, cleaning, or replacing things that simply wore out.

Time Your Sale Strategically

If you're close to the two-year ownership or use threshold, waiting to cross it can be the difference between owing nothing and owing tens of thousands of dollars. Run the actual numbers — in many markets, the tax savings from waiting a few more months far outweigh any market timing considerations.

Similarly, if you're near the income threshold for the 15% versus 20% long-term rate, consider whether you can defer other income into a different year, shift the closing date to straddle a tax year, or do anything to keep your total taxable income below the 20% threshold.

Maximize Deductible Selling Costs

Every dollar of selling cost reduces your amount realized, which reduces your gain. Make sure you're capturing everything: agent commissions, closing fees, attorney fees, transfer taxes, any repairs required by the buyer as a condition of sale, staging costs, and pre-sale home inspection fees. These are legitimate reductions to your taxable gain.

Consider a 1031 Exchange for Investment Property

The Section 121 exclusion is for primary residences. If you're selling an investment property or rental, a 1031 like-kind exchange lets you defer capital gains tax indefinitely by rolling the proceeds into another qualifying property. There are strict timelines (45 days to identify the replacement, 180 days to close), but it's a powerful tool for real estate investors who don't want to recognize a large gain.

Charitable Giving with Appreciated Property

If you have a vacation home or rental with significant appreciation, contributing it to a donor-advised fund or charitable remainder trust can eliminate the capital gains entirely while generating a charitable deduction. This is an advanced strategy worth a conversation with a tax advisor if the numbers are large enough.

What to Do After You Sell

Even if you qualify for the full exclusion and owe no tax, you still need to report the sale correctly. If your gain is fully excluded and you receive a Form 1099-S, you'll report the sale on Schedule D. If your gain is fully excluded and you don't receive a 1099-S, you may not need to report it at all — but keep your records in case the IRS ever questions it.

If you do owe tax, you'll need to report the transaction on Schedule D and Form 8949 with your federal return. The gain will also flow to your state return in most states. Consider making an estimated tax payment if the gain is large — underpayment penalties apply if you don't pay enough during the year the sale occurs.

A CPA or tax advisor who works with real estate transactions is worth the fee if your situation is anything other than a straightforward primary residence sale. Depreciation recapture, partial exclusions, 1031 exchanges, and multi-state issues can each add real complexity — and real dollars — to the outcome.

Putting It All Together

Here's the honest summary: if you've lived in your home for at least two years and your gain is under $250,000 (single) or $500,000 (married), you very likely owe nothing. That covers a lot of homeowners — but not all of them, and the exceptions matter.

The single best thing you can do right now, whether you're planning to sell this year or a decade from now, is build a simple file with your purchase documents, all capital improvement receipts, and your selling cost estimates. Run the calculation using the steps above. Know your number before you call a real estate agent.

Capital gains tax on home sales is one of the most manageable taxes in the code, precisely because Congress designed it that way. You just have to know the rules well enough to work within them.


You Might Also Enjoy