Skip to main content

Selling · After

Capital gains on a home sale, the § 121 exclusion and what it actually covers

The IRS lets single filers exclude up to $250,000 of gain on the sale of a primary residence, $500,000 for married joint filers. Above the exclusion, the gain is taxable. The mechanics determine whether a sale produces a six-figure tax bill or no tax at all.

TaxFor specific situations: CPA or licensed tax professional
Last updated May 2, 2026

The §121 exclusion is a cliff, not a bracket. Up to $250K of gain ($500K married filing jointly) is excluded entirely; every dollar above is taxable at the long-term capital gains rate.

Federal capital gains tax vs. realized gain — §121 exclusion$250K$500KSingleMFJ$0$30K$60K$90K$120K$0$250K$500K$750K$1000KRealized gain on saleFederal tax owed

Federal long-term capital gains tax owed at the 20% top rate, as a function of realized gain on a primary residence. The horizontal stretch at $0 is the §121 exclusion in effect; the line tilts up the moment the exclusion is exhausted. State capital-gains taxes (excluded here) stack on top — see the state guides.

Source · IRS Publication 523 · Methodology at /tools/seller-net-proceeds

Key takeaways

  1. The §121 primary-residence exclusion lets a single filer exclude up to $250,000 of gain ($500,000 married filing jointly) on a primary-residence sale, when the ownership-and-use test is met (lived there 24+ months of the prior 60).
  2. Gain is calculated as sale price minus selling costs minus the home's adjusted basis (purchase price plus capital improvements, not maintenance).
  3. The exclusion can typically be used once every two years, so back-to-back sales of consecutive primary residences may not qualify for the second exclusion.
  4. Partial exclusions are available for sales triggered by job change, health, or other unforeseen circumstances before the 24-month test is met.
  5. Rental conversions complicate the calculation, since depreciation taken while the property was rented gets recaptured separately even when the §121 exclusion applies to the rest of the gain.

Quick answers

Do I owe taxes when I sell my home?
It depends on the gain. Single filers can exclude up to $250,000 of gain on a primary residence under the §121 exclusion ($500,000 for married joint filers). Gain above the exclusion is taxed as long-term capital gain at 0%, 15%, or 20% federally, plus state tax in most states and the 3.8% Net Investment Income Tax for high-income sellers.
How is capital gain on a home calculated?
Gain equals the amount realized (sale price minus selling costs) minus the adjusted basis (original purchase price plus capital improvements minus any depreciation taken). Selling costs (commissions, transfer tax, attorney fees) reduce the gain. The mortgage payoff is NOT a selling cost, it's the seller's existing balance and doesn't enter the calculation.
Do I qualify for the §121 exclusion?
The §121 exclusion requires both an ownership test (the seller owned the property for at least 2 of the 5 years before the sale) and a use test (the seller used it as a primary residence for at least 2 of those same 5 years). The two-year periods don't have to be continuous or overlapping. The exclusion can only be claimed once every two years.

Selling a primary residence in the United States can involve a significant tax bill, or no tax at all, depending on how the sale interacts with the § 121 exclusion in the federal tax code.1 The exclusion lets single filers exclude up to $250,000 of capital gain on the sale of a primary residence ($500,000 for married joint filers), which means many home sales produce zero federal tax. Sales above the exclusion threshold can produce material tax (sometimes six figures on long-held appreciated homes) and the rules for what counts and what doesn't are specific enough that this is one of the consultations where a CPA earns their fee.

The seller-net-proceeds calculator at /tools/seller-net-proceeds models this math, but the underlying rules are worth understanding for any seller approaching a sale.

How the gain is calculated

The realized gain on a home sale is the amount realized (sale price minus selling costs) minus the adjusted basis (original purchase price plus capital improvements minus any depreciation taken).2

A worked example. A home bought for $300,000, with $50,000 of capital improvements over the years (kitchen remodel, new roof, new HVAC), sold for $700,000 with $50,000 in selling costs (commissions, transfer tax, attorney fees). The math:

  • Amount realized = $700,000 − $50,000 = $650,000
  • Adjusted basis = $300,000 + $50,000 = $350,000
  • Realized gain = $650,000 − $350,000 = $300,000

For a single filer, $250,000 of that gain is excluded, leaving $50,000 taxable. For a married joint filer, the entire $300,000 falls under the $500,000 exclusion, producing zero taxable gain.

The selling costs piece is important: per IRS Pub 523, selling costs reduce the realized gain, which means they reduce the eventual tax. The mortgage payoff, by contrast, is not a selling cost, it's the seller's existing balance owed, not a transaction expense.

What counts as a capital improvement (versus a repair)

The line between a capital improvement (which adds to basis) and a repair or maintenance expense (which doesn't) is one of the consequential ones in this calculation.1

Improvements that count toward basis are typically those that add value to the home, prolong its life, or adapt it to new uses. Examples: room additions, kitchen and bathroom remodels, new roof, new HVAC system, new water heater, added landscaping (significant), new windows or doors, finished basement, added insulation, new flooring, added decks or patios, new electrical or plumbing systems, swimming pool installation.

Repairs and maintenance do not count. Routine painting, fixing leaks, repairing a broken fixture, repaving the existing driveway, and similar maintenance don't add to basis. The work keeps the home in its existing condition; it doesn't improve it.

Borderline cases are common. A roof replacement at end of life is an improvement (new roof, new useful life). A patch of an existing roof is a repair. A complete electrical-system upgrade is an improvement. Replacing one outlet that broke is a repair. The IRS's specific rules (and Tax Court precedent) draw the line, often case by case.

The practical consequence: sellers who have made significant improvements over years of ownership and have receipts can often add tens of thousands to their basis, which directly reduces taxable gain. Sellers who don't keep records lose this benefit.

The ownership and use tests

The § 121 exclusion has two requirements: the seller must have owned the property for at least 2 of the 5 years before the sale (the ownership test), and the seller must have used the property as a primary residence for at least 2 of those same 5 years (the use test).1

The two-year periods don't have to be continuous, and they don't have to overlap. A seller who lived in the home for the first three years of a five-year ownership period passes both tests, even if they rented it out for the last two years.

Sellers who fail the tests don't get the exclusion. Sales of homes owned and used for less than two years typically produce fully taxable gains, with one exception: the IRS allows a partial exclusion for sales triggered by certain hardships (change of employment, change of health, unforeseen circumstances). The partial exclusion is prorated based on how much of the two-year requirement was met.

The exclusion can only be claimed once every two years. A seller who claimed the exclusion on one home and sells another within two years gets no exclusion on the second sale.

The federal tax rate on the taxable gain

Capital gain on a primary residence held more than a year is long-term capital gain, taxed at preferential rates: 0%, 15%, or 20% depending on the seller's taxable income for the year.3 The breakpoints adjust annually for inflation.

Roughly, for 2026 (the actual numbers vary year to year):

  • Single filers: 0% bracket up to about $48,000 of taxable income; 15% up to about $518,000; 20% above.
  • Married joint filers: 0% bracket up to about $96,000; 15% up to about $583,000; 20% above.

Most sellers fall in the 15% bracket. High-income sellers face the 20% bracket. Low-income sellers can sometimes use the 0% bracket strategically (a year of lower income produces tax-free realization of LTCG up to the bracket boundary).

State capital gains and NIIT

The federal rate isn't the only tax on the gain. Two additional layers can apply.

State capital gains tax varies enormously. Nine states (Florida, Texas, Washington, Nevada, Tennessee, New Hampshire, South Dakota, Wyoming, Alaska) don't have state income tax and therefore don't tax capital gains. Most other states tax capital gains as ordinary income, sometimes at the top marginal rate. California's top rate exceeds 13%; New York's tops out around 10.9%; New Jersey's at 10.75%. State cap gains tax stacks on top of federal.

Net Investment Income Tax (NIIT) is an additional 3.8% federal tax on the lesser of net investment income or modified adjusted gross income above $200,000 (single) or $250,000 (married joint). The NIIT applies to capital gains for higher-income filers and stacks on top of the LTCG rate. A high-income filer in a high-tax state can face combined cap gains rates approaching 35% on the taxable portion of a home-sale gain.

The seller-net-proceeds calculator surfaces these as separate inputs so the combined rate can be modeled.

Special situations

A few situations that complicate the standard analysis:

Homes that were ever rented. If the home was rented at any point during ownership, depreciation deductions taken (or that should have been taken) reduce basis. When the home is sold, the depreciation is recaptured at a 25% rate via depreciation recapture, separate from the regular LTCG rate. This is the most consequential complication for owners with rental history, and the math gets specific.

Inherited homes. Inherited property gets a step-up in basis to its fair market value at the date of death. The seller's gain on a subsequent sale is calculated against that stepped-up basis, not the deceased owner's original purchase price. For long-held inherited property, the step-up can eliminate most of the historical gain.

Married filers, including widowed sellers. The $500,000 joint exclusion applies to married filers filing jointly. A widowed seller can sometimes use the joint exclusion if the sale happens within two years of the spouse's death, depending on facts.

Same-sex couples and domestic partners. The federal exclusion rules apply to married filers under federal recognition. State law may have different treatment for state-tax purposes.

Like-kind exchanges. Investment properties (not primary residences) can sometimes be exchanged via § 1031 to defer capital gains. § 121 doesn't allow this for primary residences; the exclusion is the analogous benefit.

Reporting the sale

The closing professional issues a 1099-S to the IRS reporting the gross sale proceeds. The seller reports the sale on Form 8949 and Schedule D of the next year's tax return, showing the realized gain, the § 121 exclusion claimed, and the taxable gain (if any).3

For sales fully covered by the exclusion (gain less than $250k single / $500k MFJ, all tests met), the reporting is short. For sales above the exclusion, the calculation is more involved and benefits from CPA review.

A reasonable frame

The § 121 exclusion is one of the more generous tax provisions for residential property in the federal code, and it covers most home sales completely. Sellers who exceed the exclusion need to navigate the full capital gains analysis, which involves basis math, state-level treatment, NIIT, and (for rented properties) depreciation recapture. The mechanics aren't intuitive, the documentation requirements compound over years of ownership, and the dollar stakes can be material. For most sellers approaching a meaningful taxable gain, a CPA consultation before the sale closes is the conventional next step, with enough lead time to make timing or basis-related decisions if any apply.

Frequently asked

  • Do I owe taxes when I sell my home?
    It depends on the gain. Single filers can exclude up to $250,000 of gain on a primary residence under the §121 exclusion ($500,000 for married joint filers). Gain above the exclusion is taxed as long-term capital gain at 0%, 15%, or 20% federally, plus state tax in most states and the 3.8% Net Investment Income Tax for high-income sellers.
  • How is capital gain on a home calculated?
    Gain equals the amount realized (sale price minus selling costs) minus the adjusted basis (original purchase price plus capital improvements minus any depreciation taken). Selling costs (commissions, transfer tax, attorney fees) reduce the gain. The mortgage payoff is NOT a selling cost, it's the seller's existing balance and doesn't enter the calculation.
  • Do I qualify for the §121 exclusion?
    The §121 exclusion requires both an ownership test (the seller owned the property for at least 2 of the 5 years before the sale) and a use test (the seller used it as a primary residence for at least 2 of those same 5 years). The two-year periods don't have to be continuous or overlapping. The exclusion can only be claimed once every two years.
  • What home improvements count as basis additions?
    Capital improvements that add value, prolong useful life, or adapt the home to new uses (kitchen and bathroom remodels, new roof, new HVAC, finished basement, added rooms, new windows, swimming pools) add to basis. Routine repairs and maintenance (painting, fixing leaks, patching a roof) don't. The distinction matters because basis additions directly reduce taxable gain at sale, often by tens of thousands of dollars over years of ownership.
  • What tax rate applies to the gain above the §121 exclusion?
    Long-term capital gain on a home held more than a year is taxed at 0%, 15%, or 20% federally based on the seller's taxable income for the year. Most sellers fall in the 15% bracket. High-income sellers may also owe the 3.8% Net Investment Income Tax. State capital gains taxes apply on top in most states (California taxes gain as ordinary income; nine states have no income tax).