Real estate

Capital gains tax on the sale of a home

Most homeowners owe no capital gains tax when they sell their home. The calculator shows whether you do, and how much your state adds.

When you sell your main home, you can exclude up to $250,000 of gain from federal income tax, or $500,000 for a married couple filing jointly, under section 121 of the tax code. Two conditions must both be met: you owned the home and lived in it as your main residence for at least 2 of the 5 years before the sale, and you did not exclude the gain on another home in the previous 2 years. Gain above the exclusion is taxed as a long-term capital gain at 0%, 15% or 20% depending on your income (in 2026 the 20% rate starts at $613,700 of taxable income for couples), plus the 3.8% net investment income tax for high earners and your state's income tax. A couple selling for $900,000 a home bought for $350,000, after $50,000 of selling costs, has a gain of $500,000 and owes nothing. Sell before two years for a job, health or an unforeseen event and a prorated exclusion still applies.

Top state income tax rate on the gain, editable below.

Your cost basis: price paid, closing costs at purchase, improvements.

Agent commission, transfer tax paid as seller, title, legal fees.

After deductions, without the sale.

Main home only; 2 years out of the last 5 for the full exclusion.

Advanced: partial exclusion, depreciation, state rate
Excluded a gain on another home in the last 2 years?
Moving for work, health or an unforeseen event?

Home office or rental use; taxed up to 25%, never excluded.

Nonqualified use: that share of the gain is not excluded.

Top rate shown; lower if your income stays in a lower bracket.

Tax on the sale of your home

$0

$500,000 of the $500,000 gain excluded · you keep $850,000 before paying off any mortgage

Gain (price − selling costs − basis)$500,000
Section 121 exclusion−$500,000
Taxable gain$0
Federal capital gains tax (0% / 15% / 20%)$0
Net investment income tax (3.8%)$0
California income tax on the gain$0

How this is calculated

Checked by Radif Partners · Editorial policy · How we calculate

The gain is smaller than the price difference

Tax is due on the gain, not on the sale price, and the gain is not simply what you sold for minus what you paid. Start from the amount realized: the price minus selling expenses such as the agent's commission, transfer taxes you paid as seller, title and escrow fees, and legal costs. Subtract your adjusted basis: the purchase price, plus the closing costs you paid when you bought (title insurance, recording fees, transfer tax paid as buyer), plus every capital improvement since. A new roof, a kitchen remodel, an addition, central air or a fence raise the basis; painting and repairs do not. Keep the receipts for as long as you own the home and three years after the return that reports the sale. Casualty losses you deducted and certain energy credits reduce the basis.

The 2-out-of-5-year test, read closely

The 24 months of ownership and the 24 months of use do not have to be continuous, and they do not have to be the same months. You can rent the house out for three years, move in for two, and sell. Short absences, such as vacations, count as use. For the $500,000 figure, either spouse may meet the ownership test, but both must meet the use test, and neither may have excluded a gain in the past two years; otherwise each spouse's own $250,000 is figured separately. Members of the uniformed services, the Foreign Service and the intelligence community on qualified extended duty can suspend the five-year window for up to 10 years. A surviving spouse who has not remarried keeps the $500,000 limit for a sale within 2 years of the death.

Selling early: the partial exclusion

If the main reason for the sale is a change of place of employment, health, or an unforeseen event (a divorce, a death, multiple births from the same pregnancy, a disaster, losing a job and qualifying for unemployment), you can exclude a prorated amount. Take the shortest of the time you owned the home, the time you lived in it, and the time since your last exclusion, divide by 24 months (or 730 days), and multiply by $250,000 or $500,000. A single owner who moves for a new job after 12 months can exclude up to $125,000: on a $110,000 gain, nothing is taxable. The prorated limit is a ceiling, not a share of the gain, which is why short holds with small gains often owe nothing either.

Partial exclusion if you sell before 2 years

Gain you can exclude

$120,000

Reduced maximum exclusion$291,667
Gain left to tax$0
Full exclusion reached at24 months

Only when the main reason for the sale is a job change, health or an unforeseen event (Publication 523).

What stays taxable even with the exclusion

Two parts of the gain cannot be excluded. The first is depreciation claimed after May 6, 1997 for a home office or a rental period: it is taxed as unrecaptured section 1250 gain at your ordinary rate, with a ceiling of 25%. The second is gain allocated to nonqualified use after 2008, typically years when the house was a rental or vacation home before you moved in. The allocation is by time: a house owned ten years and rented for the first four leaves 40% of the gain (after depreciation) outside the exclusion. Renting after you move out does not count as nonqualified use if it falls within the five-year window, which is how many landlords sell an old home tax-free within three years of leaving it.

Federal capital gains tax rates on the rest in 2026

Gain above the exclusion is a long-term capital gain if you owned the home more than a year. It is taxed on top of your other taxable income: the part that fits under $98,900 of taxable income for a couple ($49,450 single, $66,200 head of household) is taxed at 0%, the part up to $613,700 ($545,500 single) at 15%, and the rest at 20%. The net investment income tax adds 3.8% on the taxable gain when modified adjusted gross income exceeds $250,000 for couples or $200,000 for single filers; the excluded part is not investment income. A couple with $150,000 of other taxable income who sell for $1,400,000 after fifteen years, with a $350,000 basis and $70,000 of costs, has $480,000 of taxable gain and owes about $87,255 in federal tax, plus about $59,040 to California at its top rate.

Your state's share

States that tax income almost all start from federal adjusted gross income, so the federal exclusion carries over and only the taxable gain reaches the state return. Alaska, Florida, Missouri, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington and Wyoming do not tax the gain at all. Elsewhere, most states tax capital gains as ordinary income, and a few give them a break, such as excluding a share of long-term gains. The table lists the top rate and any special treatment, read on each revenue department's site; the calculator starts from that top rate, which is an upper bound for a household whose income stays in lower brackets. The highest top rate is California's 12.3%.

State income tax on a capital gain, tax year 2026 (or latest published), official revenue department pages.
StateTop rate on the gainSpecial treatmentSource
Alabama5%graduated rates, gain taxed as incomerevenue.alabama.gov
Alaskanoneno personal income taxtax.alaska.gov
Arizona2.5%25% of a long-term gain subtractedazleg.gov
Arkansas3.9%half of a long-term gain taxeddfa.arkansas.gov
California12.3%1% more on income above $1,000,000ftb.ca.gov
Colorado4.4%flat ratetax.colorado.gov
Connecticut6.99%graduated rates, gain taxed as incomecga.ct.gov
Delaware6.6%graduated rates, gain taxed as incomedelcode.delaware.gov
District of Columbia10.75%graduated rates, gain taxed as incomeotr.cfo.dc.gov
Floridanoneno personal income taxleg.state.fl.us
Georgia4.99%flat ratedor.georgia.gov
Hawaii7.25%long-term gain taxed at 7.25% at mostfiles.hawaii.gov
Idaho5.3%60% of the gain on Idaho real estate held 12 months deductedweb.archive.org
Illinois4.95%flat ratetax.illinois.gov
Indiana2.95%flat ratein.gov
Iowa3.8%flat raterevenue.iowa.gov
Kansas5.58%graduated rates, gain taxed as incomeksrevisor.org
Kentucky3.5%flat rateapps.legislature.ky.gov
Louisiana3%flat raterevenue.louisiana.gov
Maine7.15%2% surcharge on income above $1,000,000 single, $1,500,000 jointmaine.gov
Maryland6.5%county income tax on top; extra 2% above $350,000 of income, not on a main home sold under $1.5Mmgaleg.maryland.gov
Massachusetts5%4% surtax on income above $1,107,750mass.gov
Michigan4.25%flat ratemichigan.gov
Minnesota9.85%1% on investment income above $1,000,000revenue.state.mn.us
Mississippi4%flat ratedor.ms.gov
Missourinone100% of capital gains subtracted since 2025revisor.mo.gov
Montana4.1%separate 3% and 4.1% rates on long-term gainsmca.legmt.gov
Nebraska4.55%graduated rates, gain taxed as incomerevenue.nebraska.gov
Nevadanoneno personal income taxweb.archive.org
New Hampshirenoneno tax on wages or capital gainsrevenue.nh.gov
New Jersey10.75%graduated rates, gain taxed as incomenj.gov
New Mexico5.9%home sale gain deduction limited to $2,500realfile.tax.newmexico.gov
New York10.9%graduated rates, gain taxed as incometax.ny.gov
North Carolina3.99%flat ratencdor.gov
North Dakota2.5%40% of a long-term gain excludedtax.nd.gov
Ohio3.125%graduated rates, gain taxed as incometax.ohio.gov
Oklahoma4.5%gain on Oklahoma real estate held 5 years or more is deductibleoklegislature.gov
Oregon9.9%graduated rates, gain taxed as incomeoregon.gov
Pennsylvania3.07%own home sale exclusion (2 of 5 years), no dollar cappa.gov
Rhode Island5.99%graduated rates, gain taxed as incomeweb.archive.org
South Carolina5.21%44% of a long-term gain deducteddor.sc.gov
South Dakotanoneno personal income taxdor.sd.gov
Tennesseenoneno tax on wages or capital gainsweb.archive.org
Texasnoneno personal income taxtlc.texas.gov
Utah4.45%flat ratele.utah.gov
Vermont8.75%only the $5,000 exclusion applies to a hometax.vermont.gov
Virginia5.75%graduated rates, gain taxed as incomelaw.lis.virginia.gov
Washingtonnonecapital gains excise tax exempts real estatedor.wa.gov
West Virginia4.58%graduated rates, gain taxed as incomecode.wvlegislature.gov
Wisconsin7.65%30% of a long-term gain excludedrevenue.wi.gov
Wyomingnoneno personal income taxno income tax

Reporting the sale

If the whole gain is excluded and you did not receive a Form 1099-S from the closing agent, you do not report the sale on your return. If you received a 1099-S, or part of the gain is taxable, report it on Form 8949 and Schedule D. A loss on the sale of a personal residence is not deductible. When the home was also a rental or an office, you split the sale between the personal part, which can use the exclusion, and the business part, reported on Form 4797. For a property that was only ever a rental, the exclusion does not apply at all, and the tool to look at is the 1031 exchange, which defers the tax instead of excusing it.

Questions people ask

Do I pay capital gains tax if I buy another house?

Not because of the purchase. The rule that let sellers roll a gain into a more expensive home was replaced in 1997 by today's exclusion of up to $250,000 or $500,000 of gain. Whether you buy again, rent or move abroad, only gain above the exclusion is taxed, and reinvesting it in a new home does not defer that tax.

How do I avoid capital gains tax on a home sale above $500,000 of gain?

Raise the basis with every capital improvement you can document, include all selling costs, and time the sale for a year when your other income is low so more of the gain falls in the 0% or 15% bracket. Heirs who inherit the home get a basis stepped up to its value at death, which is why some owners keep a highly appreciated home rather than sell it.

Can I use the home sale exclusion on a rental property I used to live in?

Yes, if you lived in it as your main home for at least two of the five years before the sale. Depreciation taken while it was rented after May 6, 1997 stays taxable at up to 25%, and gain allocated to rental years after 2008 that came before you moved in is not excluded. Rental after you move out does not reduce the exclusion.

Does the 2-out-of-5-year rule apply to a second home?

Only if the second home becomes your main residence for at least two of the five years before the sale. While it is a vacation home, its gain is fully taxable, and the years it was not your main home after 2008 count as nonqualified use, which reduces the exclusion even after you move in. You can have only one main home at a time.

Is the $250,000 home sale exclusion indexed for inflation?

No. The $250,000 and $500,000 limits have been unchanged since they were set in 1997, and the IRS does not adjust them each year as it does for tax brackets. In high-cost markets, owners who bought decades ago increasingly have gains above the limit, which is why the federal 15% and 20% rates and the state tax matter more than they used to.

What is the tax on a house sold after less than a year?

A home owned one year or less produces a short-term gain, taxed at your ordinary income tax rate instead of the 0%, 15% or 20% capital gains rates. The exclusion can still apply in part if the sale is due to a job change, health or an unforeseen event. Without such a reason, the whole gain is taxable, and the state taxes it as income too.

Keep going

Official sources for this page

Published by

Radif Partners

Rates checked on · Editorial policy · Contact

Estimates only: the figures on this page apply each state's published rates and rules to the numbers you enter. They do not replace the receipt of the seller, the bill of your county or city, or the decision of the state department of revenue.

State rates and exemptions for 2026, read on the official pages on