Calculate your capital gains tax when selling a home. Enter sale price, purchase price, improvements, and holding period.
When you sell a home for more than you paid, the profit is a capital gain — and it can be taxable. The good news for most homeowners is the principal residence exclusion, which lets you exclude up to $250,000 ($500,000 for married couples filing jointly) of gain from federal tax. This guide explains how the tax works, how the exclusion applies, and how the calculator below estimates what you might owe.
Your gain is the sale price minus your adjusted cost basis. Basis starts as what you paid, then you add capital improvements (a new roof, an addition) and subtract certain items like depreciation taken on rental use. Sell a home you bought for $300,000, put $50,000 into improvements, and sell for $500,000, and your gain is about $150,000 — under the exclusion for a single filer, so likely tax-free.
To use the exclusion you generally must have owned and lived in the home as your main residence for at least 2 of the 5 years before the sale. Meet that, and up to $250,000 of gain ($500,000 joint) is excluded from federal capital gains tax. The exclusion can be used repeatedly, but generally not more than once every two years. This is why most primary-home sales incur no federal tax at all.
Gains on assets held more than a year are long-term and taxed at lower preferential rates (0%, 15%, or 20% at the federal level, depending on income). Gains on a home you held a year or less are short-term and taxed as ordinary income — a much higher rate. Because the residence exclusion usually covers primary homes anyway, the rate distinction matters most for investment or flipped properties.
Some states tax capital gains as ordinary income; a few have no state income tax and thus generally no state capital gains tax on the sale. Your state may also have its own rules or exclusions. Because state treatment varies as much as federal, the calculator below focuses on the federal picture and you should check your state's rules with a tax professional.
You can owe when your gain exceeds the exclusion — common for long-held homes in hot markets or high-basis areas — or when you do not meet the 2-of-5-year residence test (for example, a second home or a property you rented most of the time). Depreciation recapture on formerly rented homes is also taxed. The calculator below estimates the federal tax on the portion of gain above your exclusion.
If you ever rented the home or used it for business, you likely claimed depreciation deductions. The IRS "recaptures" that depreciation on sale — taxing it at up to 25% regardless of the exclusion. A home with $30,000 of prior depreciation claimed could owe about $7,500 of recapture tax even if the rest of the gain is excluded. This is a common, unpleasant surprise for former rentals, so factor it in when you estimate.
The single best way to control the tax is meticulous records. Save receipts for capital improvements (kitchens, roofs, additions, major systems) — they raise your basis and lower the gain. Keep closing statements from both purchase and sale, and any records of selling costs (agent commissions, legal fees), which also reduce the gain. Years later, those papers are what prove a smaller taxable profit.
A single filer bought for $350,000, improved it by $30,000, and sells for $700,000. Gain is $320,000. The $250,000 exclusion leaves $70,000 taxable. At a 15% long-term rate the federal tax is about $10,500. A married couple with a $500,000 exclusion would owe nothing. The example shows why the exclusion is the decisive factor.
Capital gain — the profit on a sale (sale price minus adjusted basis). Cost basis — what you paid plus improvements, minus depreciation. Principal residence exclusion — the $250k/$500k gain you can exclude. Long-term — held over a year; taxed at preferential rates. Depreciation recapture — tax on depreciation previously deducted, up to 25%.
Capital-gains rules are a recurring political topic: proposals surface to raise the top rate, change the exclusion, or tax unrealized gains at death. While the $250k/$500k home exclusion has been stable for years, it is not untouchable. If you are planning a large sale years out, keep an eye on proposed changes — and consider timing within the current rules where legal.
Keep records of every capital improvement — they raise your basis and lower the gain. Meet the 2-of-5-year residence test before selling when possible. If a job move or other qualifying event forces an early sale, a partial exclusion may apply. And remember: real-estate commissions and selling costs reduce the gain too. Good records are the simplest tax saver.
Before listing, estimate your gain with the calculator below and set aside any expected tax. Gather improvement receipts now, not at closing. If you are near the 2-year mark, waiting to satisfy the residence test can save a fortune. And talk to a tax professional about 1031 exchanges if the property was an investment — those have their own rules.
How much gain can I exclude? Up to $250,000 for single filers and $500,000 for married couples filing jointly, if you meet the ownership and residence tests.
Do I have to live there 2 years straight? You need 2 of the last 5 years as your main residence; they need not be continuous.
Are home sale profits always tax-free? Only up to the exclusion. Gain above it — or sales that fail the residence test — can be taxed.
Do improvements reduce the gain? Yes. Capital improvements add to your cost basis, which lowers the taxable gain.
Does the calculator include state tax? It focuses on the federal estimate; state capital-gains rules vary, so confirm those with a professional.
If you must sell before meeting the full 2-of-5-year test, you may still claim a partial exclusion when the move is for a change in health, a job relocation, or certain other qualifying events. The IRS prorates the $250,000/$500,000 limit by the fraction of two years you actually lived there. A job transfer after 12 months, for example, could let a single filer exclude about $125,000 of gain — better than zero. Document the reason; the partial break is easy to miss.
An inherited home generally receives a step-up in basis to its fair market value on the date of death, which can shrink the taxable gain dramatically if the heir sells soon after. A gifted home, by contrast, usually carries the giver's original basis, so the gain can be large. These basis rules interact with the residence exclusion in ways the calculator cannot model — if you inherited or received the home, have a professional confirm the basis before you estimate the tax.
Because the exclusion and basis interact, the best time to model a sale is before you list, not at closing. Run the gain through the calculator below, gather improvement receipts, and check whether a partial exclusion applies if your timing is short. An early estimate tells you whether to hold a few more months to meet the residence test, what to set aside for tax, and whether a 1031 exchange or a professional review is worth it for an investment property.
Estimate the federal capital gains tax on your home sale. Uses the $250k (single) / $500k (married) primary-residence exclusion and 2026 long-term rates (0% / 15% / 20%, plus 3.8% NIIT where it applies).
When you sell your primary residence for a profit, you may owe capital gains tax on the gain. However, US tax law provides a significant exclusion: single filers can exclude up to $250,000 of gain, and married couples filing jointly can exclude up to $500,000—provided you owned and used the home as your primary residence for at least 2 of the 5 years before the sale.
The IRS uses both an "ownership test" and a "use test." You must have owned the home for at least 2 years and lived in it as your primary residence for at least 2 years during the 5-year period ending on the sale date. Short absences (vacations, temporary work assignments) do not disqualify you.
Gain = (Sale Price − Selling Costs) − (Purchase Price + Cost of Improvements). "Cost of improvements" includes major renovations (new roof, kitchen remodel, room addition) but NOT routine maintenance (painting, repairs). Keep receipts for all improvements—they directly reduce your taxable gain.
For most homeowners, the capital gains tax rate is 15% (for taxpayers with income between approximately $47,000 and $518,000 for single filers). Lower-income taxpayers may qualify for 0% rate, while high earners pay 20%. An additional 3.8% Net Investment Income Tax (NIIT) may also apply.