Capital Gains Tax on Selling a House (2026)

Posted on Share:

realtor holding miniature home and house keys with calculator, contract and pen on the table

Get Multiple Cash Offers in Minutes with an iBuyer.com Certified Specialist.


This article is for informational purposes only and does not constitute tax or legal advice. Consult a qualified tax professional before making decisions based on your specific situation.

Home sale capital gains tax is a federal tax on the profit you make when you sell a property. For most primary homeowners, the actual tax bill is $0 because a federal exclusion shelters up to $250,000 of gain for single filers and up to $500,000 for married couples filing jointly. If your profit exceeds those thresholds, the taxable portion is subject to long-term capital gains rates of 0%, 15%, or 20%, depending on your income for the year.

Qualifying for the full exclusion requires meeting two tests: you must have owned the home and lived in it as your primary residence for at least 2 of the last 5 years before the sale date.

This guide covers how capital gains tax works on a home sale, how to qualify for the primary residence exclusion and the 2-of-5-year rule, how to calculate your exact tax owed using a step-by-step worked example with real dollar figures, the 2026 rate brackets, special rules for inherited and rental homes, common mistakes that inflate your bill, and state-level taxes that apply on top of the federal amount.

Close Before Your Tax Window Expires Cash buyers close in 7-30 days so you can hit the 2-year exclusion mark.

No repairs, no agent fees, no waiting.

What is capital gains tax on a home sale?

Capital gains tax on a home sale is a tax on the difference between what you sold the home for and what you originally paid for it, adjusted for improvements and selling costs. The formula: capital gain = sale price minus adjusted cost basis minus selling expenses. For most homeowners who have lived in their property for two or more years, the gain falls below the exclusion threshold and the federal tax owed is $0.

How capital gains differ from ordinary income

Capital gains on a home sale are not taxed the same way as wages or salary. The federal government applies preferential rates to long-term capital gains, which run 10 to 12 percentage points lower than ordinary income rates for most taxpayers. Per IRS rules on home sale gain, profit from selling your main home qualifies for this preferential treatment as long as you meet the ownership and use tests.

The practical difference matters in dollar terms. A seller in the 22% ordinary income bracket still pays only 15% on a qualifying long-term capital gain. The cost basis home sale calculation is where that distinction becomes real money.

Short-term vs. long-term capital gains defined

Long-term capital gains apply when you have owned the property for more than one year before selling. Long-term rates are 0%, 15%, or 20%, based on your taxable income. Short-term capital gains apply when you sell property held for one year or less. Short-term gains are taxed as ordinary income, which can reach 37% federally at the top bracket. Holding a property for at least 12 months before selling avoids the short-term rate, even when you do not yet qualify for the 2-year exclusion.

How to avoid capital gains tax on your home

The primary way to avoid capital gains tax on a home sale is to qualify for the federal exclusion under IRS Section 121. Sellers who meet both the ownership and use tests exclude up to $250,000 (single) or $500,000 (married filing jointly) of profit from federal income tax entirely. The home sale capital gains tax applies only to whatever gain remains after the exclusion.

The $250,000 and $500,000 primary residence exclusion

The capital gains tax exclusion home sale benefit lets single filers exclude up to $250,000 of profit and lets married couples filing jointly exclude up to $500,000. Per the Section 121 exclusion for owner-occupied housing (Congressional Research Service, August 6, 2025), the Section 121 exclusion applies when taxpayers satisfy both a use test and an ownership test. You can claim the exclusion once every two years, and there is no requirement to buy a replacement home with the proceeds.

What is the 2-of-5-year rule?

The 2 of 5 year rule capital gains requirement means you must have owned the home for at least 24 months AND lived in it as your primary residence for at least 24 months within the 5-year period ending on the sale date. Both the ownership test and the use test must be satisfied independently. The 24 months of qualifying use do not need to be continuous; you can add up separate periods of residence as long as the total reaches 24 months within that 60-month lookback window.

If your 2-year ownership clock is within weeks of the required threshold, timing your close precisely is critical. Vetted cash buyers can close in 7 to 30 days, giving you control over the exact closing date that a traditional listed sale cannot guarantee.

Partial exclusion for special circumstances

Sellers who do not fully satisfy the 2-year use test may still claim a partial exclusion if the sale is due to a change in employment, a health reason, or an “unforeseen circumstance” as defined by the IRS in IRS Publication 523. The partial exclusion is calculated as a fraction: months of qualifying use divided by 24, multiplied by the full exclusion maximum.

Example: you moved in and sold after 14 months because of a qualifying job relocation. Your partial exclusion is 14/24 of $250,000, or approximately $145,833. Consult a tax professional before relying on the partial exclusion, because the IRS applies specific definitions to each qualifying reason category.

How to calculate capital gains on a home sale

Calculating your home sale capital gains tax follows four steps: find your adjusted cost basis, calculate your realized gain, apply the primary residence exclusion, then apply the correct rate to whatever remains. Each step is explained below, followed by a complete worked dollar example that covers every line from purchase price to tax owed.

Step 1: Find your adjusted cost basis

Your adjusted cost basis is the starting point for every capital gains calculation. It equals your original purchase price plus capital improvements (additions, kitchen or bathroom remodels, new roof, HVAC replacement, and similar projects that add value or extend the property’s useful life) plus buying-side closing costs. Routine maintenance and cosmetic repairs do not increase basis.

Per how to calculate adjusted cost basis on Investopedia, keeping receipts and permit records for every qualifying project is essential. Without documentation, you cannot claim the basis increase, and your taxable gain will be overstated.

Formula: Adjusted cost basis = purchase price + capital improvements + buying closing costs

Step 2: Calculate your realized gain

Your realized gain is your net profit before the exclusion is applied. Subtract your adjusted cost basis from your net sale proceeds. Net sale proceeds equal the sale price minus selling costs deduction items: agent commissions, transfer taxes, attorney fees, title costs paid by the seller, and repairs required as a condition of sale.

Selling without a realtor eliminates the agent commission line item entirely, which directly reduces your realized gain. At 5% to 6% total commission on a $500,000 sale, that is $25,000 to $30,000 in deductible selling costs you would not incur under a FSBO sale.

Formula: Realized gain = (sale price – selling costs) – adjusted cost basis

Step 3: Apply the primary residence exclusion

If you qualify under the 2 of 5 year rule capital gains ownership and use tests, subtract the exclusion ($250,000 for single filers, $500,000 for married filing jointly capital gains filers) from your realized gain. The result is your taxable gain. If your realized gain falls below the exclusion threshold, your federal taxable gain is $0.

Step 4: Apply the correct tax rate

Apply the capital gains tax rate on real estate 2026 that matches your income bracket to the taxable gain. Rates are 0%, 15%, or 20% for long-term gains on property held more than one year. Short-term gains are taxed as ordinary income. The rate table in the next section shows the full income thresholds for each bracket.

Worked example: $400,000 sale

The following calculation covers a single filer who purchased at $300,000, sold at $700,000 after three years, spent $25,000 on capital improvements, and incurred $20,000 in selling costs:

Step Item Amount
Purchase price Original cost $300,000
+ Capital improvements Kitchen remodel, new HVAC +$25,000
Adjusted cost basis $325,000
Sale price Gross proceeds $700,000
– Selling costs Commissions, transfer taxes -$20,000
Net sale proceeds $680,000
Realized gain $680,000 – $325,000 $355,000
– Primary residence exclusion Single filer maximum -$250,000
Taxable gain $105,000
Federal tax at 15% Most common rate $15,750

Based on IRS Publication 523 basis rules and 2026 long-term capital gains rate schedules. Verify current income thresholds at IRS.gov before transacting.

This seller owes $15,750 in federal capital gains tax on a $400,000 gain. Without the $25,000 in documented improvements and the $20,000 in selling cost deductions, the taxable gain rises to $150,000, producing a bill of $22,500 instead.

Capital gains tax rates in 2026

The capital gains tax rate on real estate 2026 depends on two factors: how long you held the property and your taxable income for the year. Long-term rates apply to property held more than one year and are significantly lower than ordinary income rates.

Long-term capital gains rate brackets

Per long-term capital gains rate breakdown from Jackson Hewitt, the three federal long-term rates are 0%, 15%, and 20%, assigned by income bracket:

Rate Single Filer Taxable Income Married Filing Jointly
0% Up to $47,025 Up to $94,050
15% $47,026 to $518,900 $94,051 to $583,750
20% Above $518,900 Above $583,750

Based on 2025 IRS rate schedules; 2026 inflation-adjusted thresholds should be confirmed at IRS.gov before making tax decisions. Thresholds apply to taxable income, not gross household income.

The 0% rate is more accessible than most sellers expect. A married couple with $80,000 in combined taxable income owes zero federal capital gains tax on any gain that falls within their $94,050 ceiling.

What the 20% rate actually means

The 20% long-term capital gains tax rate on real estate 2026 is not a universal rule for home sellers. It is the top-bracket rate and applies only to single filers with taxable income above approximately $518,900, or married filing jointly capital gains filers above approximately $583,750. Most sellers land in the 15% bracket or the 0% bracket. The phrase “20% rule” that circulates in casual financial advice implies a flat standard; it is not. Think of 20% as a ceiling for very high earners, not an expectation for typical homeowners.

The 3.8% Net Investment Income Tax

The net investment income tax (NIIT) is a 3.8% surcharge on investment income, including capital gains, for higher-income filers. NIIT real estate exposure arises when your modified adjusted gross income (MAGI) exceeds $200,000 for single filers or $250,000 for married filers. The NIIT applies only to gain above your primary residence exclusion. If your exclusion fully covers the gain, no NIIT applies. When taxable gain remains, the 3.8% stacks on top of your regular capital gains rate. A seller with $105,000 in taxable gain at the 15% rate who clears the MAGI threshold pays an effective rate of 18.8% (15% + 3.8%), for a combined federal bill of $19,740.

Capital gains on inherited and rental homes

Not every home sale qualifies for the primary residence exclusion. Inherited homes, rental properties, and vacation homes follow distinct rules that can change the tax outcome significantly.

Inherited property: the stepped-up basis rule

Stepped-up basis inherited home rules give the inheriting party a cost basis equal to the fair market value of the property on the date of the original owner’s death, not the original purchase price. If a home was purchased decades ago for $90,000 and is worth $450,000 on the date of death, the heir’s cost basis home sale starting point is $450,000. Selling shortly after for $465,000 produces a taxable gain of only $15,000.

This rule often eliminates most or all capital gains for heirs who sell within a reasonable timeframe. The primary residence exclusion does not automatically transfer to the heir; to use it, the heir must move in and independently satisfy the 2 of 5 year rule capital gains use test.

If you are selling an inherited home and dealing with probate at the same time, house before probate covers related steps that often run parallel to a sale.

Rental and investment property rules

Rental and investment properties do not qualify for the Section 121 exclusion. All gain is taxable at long-term rates (0%, 15%, 20%) for properties held more than one year. An additional tax applies on sale: depreciation recapture. Any depreciation claimed during the rental period is recaptured at a maximum rate of 25% as ordinary income when the property sells. This recapture is calculated separately from the capital gains tax on remaining appreciation.

A 1031 exchange allows investment property sellers to defer home sale capital gains tax exposure by rolling the proceeds into a like-kind replacement property within 180 days. This option is not available for primary residences. If you own rental or investment property, the 1031 exchange is the primary federal deferral mechanism available to you.

Second homes and vacation properties

Second homes and vacation properties receive no exclusion and no federal deferral option. All gain is taxed at long-term capital gains rates (0%, 15%, or 20%) for properties held more than one year. Per capital gains on a secondary home from Edelman Financial Engines, your combined income (wages plus capital gain) determines which rate bracket applies. A couple with $130,000 in combined income falls into the 15% bracket.

If the vacation property was also rented part-time, the rental periods introduce partial depreciation recapture and mixed-use basis calculations. Consult a tax professional for any property with mixed personal and rental use history.

Common mistakes that raise your capital gains tax

These four errors regularly cause sellers to pay more than they owe. Each has a practical fix.

Not tracking capital improvements

Homeowners who do not track capital improvements tax deduction-eligible projects understate their adjusted cost basis, which inflates taxable gain dollar for dollar. A $30,000 undocumented kitchen remodel costs a seller in the 15% bracket an extra $4,500 in avoidable tax. Keep all receipts, contractor invoices, and building permits from the day you purchase. IRS Publication 523 lists qualifying improvement categories in detail. Cosmetic repairs and routine upkeep do not qualify and do not increase basis.

Forgetting selling cost deductions

The selling costs deduction covers agent commissions, transfer taxes, seller-paid title insurance, attorney fees, and repairs required as a condition of sale. On a $500,000 sale, a 5% total agent commission alone is $25,000 in deductible costs. Sellers who omit these items overstate their realized gain by thousands of dollars.

If reducing that commission line is a priority, FSBO in New York lays out one path that directly affects this deductible cost item and the resulting gain calculation.

Selling too soon after moving in

Selling at 23 months means you miss the 2-year use requirement by one month and forfeit the entire exclusion. On a $200,000 gain, that forfeiture costs a seller in the 15% bracket $30,000 in avoidable tax. If the 2-year mark is a few weeks away, waiting is often the single highest-return decision available to you. The simplest answer to how to avoid capital gains tax on home sale is frequently: wait until you clear the 24-month mark.

Missing the partial exclusion option

Many sellers assume the choice is all or nothing. The partial exclusion for qualifying job relocation, health reasons, or IRS-defined unforeseen circumstances can still provide substantial relief. A seller who qualifies after 18 months of residence can exclude 18/24 of the full maximum, which equals $187,500 for a single filer. Most tax software will not flag this option unless you ask about it directly.

State capital gains taxes on home sales

Federal exclusion and federal rates are only part of your total tax bill. Most states impose their own tax on home sale gains, and the combined state-plus-federal amount can be significantly higher in high-tax states.

States with no income tax (and no capital gains tax)

Nine states impose no state income tax and therefore no state home sale capital gains tax: Alaska, Florida, Nevada, New Hampshire (wages only), South Dakota, Tennessee, Texas, Wyoming, and Washington. Washington is a partial exception: the state enacted a capital gains tax effective 2023 on long-term gains above $250,000, so sellers with large gains are not fully exempt there despite the absence of a general income tax on wages.

States with notable capital gains rates

State Treatment Approximate Top Rate
California Taxed as ordinary income, no preferential rate 13.3%
New York Taxed as ordinary income 10.9%
Oregon Taxed as ordinary income 9.9%
Minnesota Taxed as ordinary income 9.85%
Hawaii Preferential rate applies 7.25%
Colorado Flat ordinary income rate 4.4%
Florida No state income tax 0%
Texas No state income tax 0%
Nevada No state income tax 0%

State rates change via annual legislation. Verify current rates with your state tax authority before transacting.

How state exclusions differ from federal

Most states conform to the federal exclusion, allowing sellers to exclude the same gain at the state level as at the federal level. California is the exception most sellers need to know about. Per California income from home sale guidance from the California Franchise Tax Board (January 7, 2026), California conforms to the capital gains tax exclusion home sale amounts ($250,000 single, $500,000 married), but any gain above those thresholds is taxed as ordinary income at rates up to 13.3% with no preferential capital gains rate. A married couple in California with $600,000 in gain pays 0% federally on the first $500,000 but owes California ordinary income tax on the remaining $100,000 at up to 13.3%.

Sellers in high-tax states should calculate their combined state and federal liability before assuming the exclusion eliminates all tax exposure.

Selling Before Your Exclusion Window Expires

If your 2-year primary residence clock is running out, or you have a specific closing date you need to hit to qualify for the $250,000 or $500,000 exclusion, the timing of your sale matters as much as the price. iBuyer.com connects you with vetted cash buyers who can close in 7 to 30 days, giving you control over the close date. Request competing offers from multiple buyers, compare them side by side, and choose the timeline that protects your tax situation. No repairs, no agent commissions, no listing delays.

Close Before Your Tax Window Expires Cash buyers close in 7-30 days so you can hit the 2-year exclusion mark.

No repairs, no agent fees, no waiting.

FAQ: Capital gains tax on selling a house

How much capital gains tax do you pay when selling a house?

Most primary homeowners pay $0 in capital gains tax because the federal exclusion shelters up to $250,000 (single) or $500,000 (married) of profit. If your gain exceeds the exclusion, the taxable portion is subject to long-term capital gains rates of 0%, 15%, or 20% depending on your income. Short-term gains on homes sold within one year are taxed as ordinary income, reaching up to 37% federally. The majority of homeowners who have lived in their home for two or more years owe nothing.

How do you avoid capital gains tax on a home sale?

Qualify for the Section 121 exclusion by using the home as your primary residence for at least 2 of the last 5 years before selling. The 24 months of qualifying use do not need to be consecutive. You can also lower your taxable gain by adding documented capital improvements to your adjusted cost basis and by deducting eligible selling costs such as commissions and transfer taxes. A partial exclusion may apply if you sell early for a qualifying employment, health, or unforeseen-circumstances reason.

What is the 2-of-5-year rule for the home sale exclusion?

To qualify for the primary residence exclusion, you must have lived in the home for at least 2 of the last 5 years before the sale date. You must also satisfy the ownership test, which requires owning the property for at least 2 of those same 5 years. Both tests must be met. The 24 months of residence do not need to be consecutive; you can combine non-continuous periods as long as the total reaches 24 months within the 5-year lookback window.

How do I calculate capital gains tax on my home sale?

Subtract your adjusted cost basis from net sale proceeds, then subtract the primary residence exclusion; any remainder is taxed at 0%, 15%, or 20%. Your adjusted cost basis equals your purchase price plus capital improvements and buying-side closing costs. Net sale proceeds are the sale price minus selling costs such as agent commissions and transfer taxes. See the 4-step worked example above for a complete dollar-by-dollar illustration.

How much capital gains do I pay on a $100,000 gain?

A $100,000 gain falls entirely within the $250,000 exclusion for single filers, so most primary home sellers owe $0 in federal capital gains tax on it. If that $100,000 gain is not sheltered by the exclusion (for example, on a rental or second home), the tax is $0, $15,000, or $20,000 depending on your bracket. At the most common 15% rate, a $100,000 unexcluded gain produces a $15,000 federal bill. State taxes apply on top in most states.

What is the 20% capital gains tax rate, and who pays it?

The 20% rate is the top-bracket long-term rate and applies only to single filers with taxable income above approximately $518,900 in 2026. Most home sellers pay the 15% rate or the 0% rate, not 20%. The “20% rule” framing implies a flat standard; it is not. Think of 20% as the ceiling for very high earners only. Verify the exact 2026 income thresholds at IRS.gov, as they are adjusted annually for inflation.

Does selling a house count as income for tax purposes?

Home sale profit above the exclusion is treated as capital gain income, not wages, which usually results in a lower federal tax rate. If you are in the 22% ordinary income bracket, a qualifying long-term capital gain is still taxed at only 15%. Short-term gains on homes sold within one year are the exception, taxed as ordinary income at the same rate as your wages.

Can I avoid capital gains tax by buying another house?

No, buying another home does not defer or eliminate capital gains tax on a primary home sale under current federal law. The “rollover” rule that once allowed sellers to defer gains by purchasing a more expensive home was repealed in 1997 when Congress replaced it with the current exclusion. A 1031 exchange can defer gains on investment or rental properties only; it does not apply to primary residences.

What happens if I sell my house before living there 2 years?

Selling before the 2-year use requirement means you lose the full exclusion and owe capital gains tax on any profit above your cost basis. A partial exclusion is available if the sale is due to a qualifying job change, a health reason, or an IRS-defined unforeseen circumstance. The partial exclusion equals months of qualifying use divided by 24, multiplied by the full exclusion maximum. Consult a tax professional to confirm your reason qualifies before filing.

Is capital gains tax different for inherited property?

Inherited property receives a stepped-up cost basis at the date of death, which usually reduces the taxable gain to near zero when you sell. If you inherit a home worth $400,000 on the date of death and sell it for $415,000, your taxable gain is only $15,000. The primary residence exclusion does not apply unless the heir moves in and independently satisfies the 2-of-5-year use test.

Do home improvements reduce capital gains tax?

Capital improvements such as additions, kitchen remodels, and roof replacements increase your adjusted cost basis, directly reducing the taxable gain when you sell. Routine maintenance and cosmetic repairs do not increase basis. Only improvements that add value, adapt the property to a new use, or extend its useful life qualify under IRS Publication 523. Receipts and permit records are required to support the basis increase.

What is the Net Investment Income Tax on a home sale?

The NIIT adds a 3.8% surcharge on taxable gain above the exclusion when your MAGI exceeds $200,000 (single) or $250,000 (married). The NIIT stacks on top of the regular capital gains rate. A seller with $100,000 in taxable gain at the 15% rate who clears the NIIT threshold owes 18.8% total (15% + 3.8%), for a combined federal bill of $18,800. Gain sheltered by the exclusion is not subject to the NIIT.

Does my state charge capital gains tax on home sales?

Most states tax home sale capital gains as ordinary income; rates range from 0% in no-income-tax states to 13.3% in California. States that conform to the federal exclusion allow you to exclude the same gain from state tax as from federal. Florida, Texas, Nevada, and six other states impose no state income tax, so no state capital gains exposure applies for sellers in those states.

What is a 1031 exchange, and can I use it for my primary home?

A 1031 exchange defers capital gains tax on investment or rental property sales but cannot be used for a personal primary residence. The exchange requires identifying a replacement property within 45 days of the sale and completing the purchase within 180 days. Proceeds must flow through a qualified intermediary. IRS Section 1031 governs the rules and limits the exchange to properties held for investment or business use only.

Sell Smart, Sell Fast with iBuyer.com
Discover Your Home’s Value in Minutes.