Capital Gains Tax When Selling a House: What Sellers Actually Owe

The short answer
Most people who sell their primary home owe no capital gains tax at all, because the IRS lets single filers exclude up to $250,000 of gain (and married couples filing jointly up to $500,000), as long as you owned and lived in the house for at least two of the five years before the sale. Gain above that exclusion, gains on a rental or second home, and gains taxed at the state level can still apply. This is general information, not tax advice — a CPA can confirm exactly what you'll owe based on your numbers.
Capital gains tax on a home sale scares a lot of sellers more than it should. For most owner-occupants, the exclusion wipes out the tax bill entirely. But the rules around cost basis, the exclusion tests, rentals, and inherited property all interact in ways that are easy to get wrong, so it's worth understanding the mechanics even if you expect to owe nothing.
How capital gain on a home sale is calculated
At the simplest level, your gain is your sale price minus your adjusted cost basis, minus qualifying selling expenses (things like real estate commissions and certain closing costs). It isn't just sale price minus purchase price — your basis can be higher than what you originally paid, which matters a lot for how much gain actually gets taxed.
Adjusted cost basis and improvements
Your basis starts with what you paid for the house, plus certain closing costs from the purchase. From there, it goes up for capital improvements — things that add value or extend the home's life, like a new roof, an addition, a remodeled kitchen, or a new HVAC system. Routine repairs and maintenance (painting, fixing a leaky faucet) generally don't count.
- Keep records as you go. Receipts, contracts, and invoices for improvements over the years you owned the home are what substantiate a higher basis if you're ever asked to show your math.
- Depreciation lowers basis if the property, or part of it, was ever used as a rental or for business — more on that below.
- Casualty losses and insurance reimbursements can also adjust basis in certain situations.
What counts as a capital improvement for tax purposes?
Generally, anything that adds value, prolongs the home's useful life, or adapts it to new uses — a new roof, room addition, finished basement, new siding, a major system replacement, or landscaping that permanently changes the property. A repair that just restores something to its prior condition, like patching drywall, typically doesn't qualify. When in doubt, a CPA can tell you which of your specific projects count.
The $250,000 / $500,000 primary residence exclusion
This is the exclusion that shields most home sales from any capital gains tax. Single filers can exclude up to $250,000 of gain; married couples filing a joint return can exclude up to $500,000, as long as both spouses meet the use test described below.
What is the 2 out of 5 year rule?
To qualify for the exclusion, you generally need to meet two tests during the five years leading up to the sale:
- Ownership test: you owned the home for at least two years during that five-year window.
- Use test: you lived in the home as your primary residence for at least two of those same five years (the two years don't have to be continuous).
You also generally can't have claimed this exclusion on a different home sale within the two years before the current sale. If you meet both tests, gain up to the limit is excluded from federal capital gains tax entirely — you may not even need to report the sale if the gain is fully covered and you meet other IRS reporting conditions.
Partial exclusions for job, health, or unforeseen circumstances
If you sell before meeting the full two-year use test, you may still qualify for a partial exclusion if the sale was primarily due to a change in workplace location, a health condition, or certain other unforeseen circumstances defined by the IRS (like divorce, multiple births from a single pregnancy, or a job loss that affects your ability to pay for the home). The partial exclusion is generally calculated based on the fraction of the two-year period you actually met the requirements. If you're relocating for a job and this might apply to you, see our guide on selling a house fast for a job relocation.
Short-term vs. long-term capital gains rates
How your gain is taxed depends heavily on how long you owned the property. Property held one year or less before selling is generally taxed at short-term capital gains rates, which are the same as your ordinary income tax rates — typically the higher of the two treatments. Property held longer than one year usually qualifies for long-term capital gains rates, which are generally lower than ordinary income rates for most taxpayers. Because rates and brackets change and depend on your total income, your CPA or a current IRS publication is the right source for the exact numbers that apply to you.
Inherited property and stepped-up basis
If you inherited the house rather than buying it, your basis generally isn't what the original owner paid — it's usually "stepped up" to the property's fair market value as of the date of death (or an alternate valuation date the estate may elect). This often erases most or all of the gain that built up during the original owner's lifetime, meaning heirs frequently owe little or no capital gains tax if they sell relatively soon after inheriting. Our article on selling an inherited house goes deeper into how this plays out alongside probate and multiple heirs.
Do I owe capital gains tax if I sell a house I inherited?
Possibly, but usually much less than you'd expect, because of the stepped-up basis. Gain is typically measured from the date-of-death value forward, not from what the original owner originally paid decades earlier. Get a qualified appraisal for that date if one wasn't already done as part of the estate.
Rental property, depreciation recapture, and 1031 exchanges
Rentals and investment property don't get the primary residence exclusion (unless you lived in the home as your primary residence for the required period before converting it to a rental, in which case a partial exclusion may still apply). A few things unique to rental and investment property:
- Depreciation recapture. If you claimed depreciation deductions while renting the property out, the IRS generally requires you to "recapture" that depreciation on sale — meaning it gets taxed, typically at a different rate than your regular capital gain, regardless of whether you actually benefited from the deductions in prior years.
- 1031 exchanges. Investors selling a rental or business property can potentially defer capital gains tax by reinvesting the proceeds into a "like-kind" replacement property under IRS Section 1031 rules. This involves strict timelines and a qualified intermediary, and doesn't apply to a primary residence.
State capital gains taxes
Don't forget the state side. Many states tax capital gains as ordinary income on top of whatever federal tax applies, while a handful of states have no personal income tax at all and therefore no state-level capital gains tax on a home sale. Your state's specific treatment, and whether it mirrors the federal exclusion, is worth confirming with a CPA licensed in your state.
Records worth keeping
Good records make this whole process faster and cheaper at tax time:
- Original purchase contract and closing statement
- Receipts and contracts for capital improvements
- Records of any depreciation claimed, if the home was ever rented
- Appraisals used to establish basis on inherited property
- Closing statement from the sale itself, showing commissions and fees
Questions sellers ask about capital gains tax
Do I have to buy another house to avoid capital gains tax?
No, not for a primary residence — that rule (the old "rollover" replacement rule) was eliminated decades ago and replaced by the current $250,000/$500,000 exclusion, which doesn't require buying a replacement home. Reinvesting proceeds into another property to defer tax is really a rental/investment property concept, via a 1031 exchange.
Do I owe capital gains tax if I sell for less than I paid?
If there's no gain, there's nothing to tax. A loss on the sale of a personal residence generally isn't deductible either way, unlike a loss on an investment property in some circumstances.
Does selling a house for cash change how capital gains tax works?
No — the tax treatment depends on your ownership history, basis, and gain, not on how the buyer pays or how quickly the sale closes. If speed and certainty matter more to you than maximizing sale price, see our overview of how selling to a cash buyer works.
What if I sold the house through probate?
The stepped-up basis rules for inherited property typically still apply, but probate sales can add timing and title complications worth discussing with both the estate's attorney and a CPA before the sale closes.
Loyal Property Partners LLC buys houses nationwide, including inherited property, rentals, and homes owners are selling for reasons that touch on some of the situations above. We aren't tax professionals and this isn't tax advice, but we're happy to talk through your timeline and options — you can book a call anytime with no obligation.
Want a Straight Answer on Your Property?
Tell us about the house and we'll walk you through your options — no fees, no repairs, and no obligation to accept anything.
More Guides on Selling a House Fast for Cash
Cash Offer vs. Listing With an AgentA line-by-line comparison of a cash offer and a traditional agent listing — commissions, repairs, holding costs, and tim…
How to Sell an Inherited HouseWhat heirs need to know before selling an inherited property: probate basics, stepped-up cost basis, clearing out belong…
How Investors Find Off-Market PropertiesThe real sourcing channels behind off-market deals — wholesalers, direct mail, driving for dollars, probate and code-vio…