Capital gains tax on the sale of a home

The capital gain on a home sale is not the check you receive at closing, and it is not simply the sale price minus what you paid years ago. The calculation also depends on selling expenses, improvements, previous depreciation, and other adjustments to the home's tax basis.

A separate rule may let an eligible seller exclude up to $250,000 of gain from federal income. The limit can reach $500,000 for a married couple filing jointly when the joint-return requirements are met. Those amounts apply to gain, not to the sale price.

The Capital Gains Tax Calculator can check the first part of the arithmetic: proceeds minus adjusted basis and selling fees. It does not test eligibility for the home-sale exclusion or apply it automatically.

Start with the gain, not the sale price

For a basic sale of a main home, the rough calculation is:

Sale price minus selling expenses minus adjusted basis equals gain or loss.

Adjusted basis usually starts with the home's purchase price. Certain settlement costs from the purchase can be added, as can qualifying improvements. Other events, including depreciation claimed for rental or business use, can reduce basis.

Suppose a homeowner has these figures:

  • Sale price: $700,000.
  • Selling expenses: $42,000.
  • Original purchase price plus eligible buying costs: $325,000.
  • Qualifying improvements: $55,000.

The adjusted basis is $380,000. After subtracting $42,000 of selling expenses from the sale price, the amount realized is $658,000. The gain is $278,000.

For a qualifying single seller, a $250,000 exclusion would leave $28,000 of gain before any other applicable adjustments. A couple who satisfies all the joint-return requirements could have enough exclusion to cover the example's entire gain. This is only an illustration; it leaves out complications such as depreciation, nonqualified use, a partial business interest, and state tax.

Who can use the $250,000 home-sale exclusion?

The IRS home-sale overview says a seller generally must pass three tests:

1. Ownership: You owned the home for at least 24 months during the five years ending on the sale date. 2. Use: You used it as your residence for at least 24 months during that five-year period. 3. Look-back: You generally did not exclude gain from another home sale during the two years before this sale.

The 24 months of ownership and use do not have to be one uninterrupted block, and they do not have to be the same 24 months. Both must fall inside the five-year window.

The property must also be your main home. Owning a vacation property for two years does not satisfy the residence test merely because you spent some time there.

The $500,000 joint-return limit has extra conditions

Filing a joint return does not by itself double the exclusion. According to IRS Publication 523, the full $500,000 maximum generally requires:

  • Either spouse to meet the ownership test.
  • Both spouses to meet the residence test.
  • Neither spouse to have used the exclusion for another home during the two-year look-back period.

A couple may qualify for a smaller total when only one spouse meets all the requirements. Marriage, divorce, the death of a spouse, and transfers between spouses have special rules, so the filing status on its own does not settle the amount.

What can increase the home's adjusted basis?

Basis records can matter more than the tax rate. A higher legitimate basis means a smaller gain, but every addition needs support.

Publication 523 lists improvements that add value to the home, prolong its useful life, or adapt it to a new use. Examples can include an addition, a new roof, permanent heating or air-conditioning equipment, rewiring, plumbing upgrades, built-in appliances, and some landscaping or accessibility work.

The full cost does not always survive as a basis adjustment. Insurance reimbursements, energy credits, subsidies, and other tax benefits can reduce the amount added. If an improvement is later removed or replaced, its remaining basis may also need to come out.

Routine upkeep normally does not increase basis. Painting a room, fixing a leak, or replacing a broken pane keeps the property in ordinary condition. A repair may count when it is part of a larger remodeling or restoration project, but a receipt with the word "repair" or "renovation" is not enough to decide the treatment.

Your own unpaid labor is not added to basis. Materials you bought for a qualifying project may count; an estimate of what your time was worth does not.

Which closing costs count?

Buying and selling costs do not all receive the same treatment.

Some costs paid when buying the home can enter basis. IRS Publication 551 includes items such as certain legal fees, recording fees, surveys, transfer taxes, and owner's title insurance. Loan charges generally do not enter the home's basis. Mortgage points, lender appraisal fees, credit-report charges, mortgage insurance, and loan-origination fees follow separate rules.

Selling expenses reduce the amount realized rather than increasing the purchase basis. Publication 523 gives examples that include sales commissions, advertising fees, legal fees, and seller-paid transfer or stamp taxes.

Keep both closing packages. The original settlement statement helps reconstruct basis, while the sale closing disclosure supports the amount realized. Bank statements alone often do not show what a payment was for.

Depreciation can leave taxable gain

Home-office or rental use can change an otherwise simple exclusion. Gain tied to depreciation allowed or allowable after May 6, 1997, generally cannot be excluded. This can matter even if the total gain is below $250,000 or $500,000.

The word "allowable" is the trap. Skipping a depreciation deduction does not necessarily erase the later adjustment if the deduction could have been taken. A separate rental unit, a former rental period, or business space outside the home's living area can also require separate calculations and forms.

Publication 523 also has rules for periods of nonqualified use, generally involving time after 2008 when the property was not used as a main home. Exceptions and sequencing rules make this a poor place for a one-line estimate.

A partial exclusion may apply after an early sale

Failing the full two-year tests does not always mean the exclusion is zero. Publication 523 describes reduced exclusions for some sales caused by:

  • A qualifying work-related move.
  • A qualifying health reason.
  • Certain unforeseeable events.

The reduced maximum is generally based on the shortest of the qualifying ownership period, residence period, or time since a previous exclusion, divided by two years. The exact reason and facts still have to fit the IRS rules. Wanting a different neighborhood or selling after a price increase does not create a partial exclusion by itself.

Do you have to report the sale?

A fully excludable sale may not require reporting when no Form 1099-S was issued. The IRS says the sale must be reported when:

  • You receive Form 1099-S, even if the gain is fully excludable.
  • Some gain remains after the exclusion.
  • You choose not to claim an exclusion that is available.

When reporting is required, Form 8949 and Schedule D are commonly involved. Depreciation, installment payments, business use, canceled debt, or a sale by a nonresident can add other forms and rules.

A loss on the sale of a home used only as a personal residence generally is not deductible. That differs from a loss on investment or business property.

Records worth keeping

A useful home-sale file includes:

  • The purchase contract and original settlement statement.
  • Receipts, permits, contracts, and proof of payment for improvements.
  • Records of insurance reimbursements, energy credits, and subsidies.
  • Depreciation schedules for any rental or business use.
  • The sale contract, closing disclosure, and Form 1099-S.
  • Documents for a spouse's ownership or residence period when relevant.

Photos can help show that work occurred, but they do not replace invoices and payment records. If old receipts are missing, gather reliable contemporaneous records rather than inventing a round number.

How to use the calculator without overstating the answer

Enter the gross sale price as proceeds, the adjusted basis supported by your records, and eligible selling costs. The calculator will return a pre-exclusion gain. Do not treat its tax estimate as final because the tool asks for an assumed rate and does not know your exclusion, depreciation, other income, capital losses, or state rules.

After finding the gain, check the ownership, use, and look-back tests. Then subtract only the exclusion you qualify to claim. Our 2026 capital gains tax guide explains how any remaining long-term gain interacts with other taxable income and the federal 0%, 15%, and 20% brackets.

The home's sale date, not the day you accept an offer, controls the five-year testing period. Check the dates and records before estimating the exclusion.

Browse the Economy section for more guides on taxes, housing, interest rates, and household cash flow.

Educational only. This article gives general federal tax information and examples, not personalized tax, legal, financial, or investment advice. State rules can differ, and home-office, rental, divorce, inheritance, disability, military service, and expatriation facts may change the result.