Your home sale cost basis is the total tax investment you have in the property, and you subtract it from the net sale price to find the gain the IRS can tax. Start with what you paid, add the acquisition closing costs and every capital improvement you made along the way, then subtract items like depreciation, insurance payouts, and energy credits you claimed. The number you end up with is your adjusted basis, and getting it right is what determines whether you owe anything after the Section 121 exclusion is applied.
Start With the Purchase Price
The foundation of your basis is the price you paid for the home, including your down payment and the amount you borrowed. If you took over debts the seller owed on the property, or paid real estate taxes the seller owed and were never reimbursed for, those amounts go in too.1Internal Revenue Service. Publication 523 (2025), Selling Your Home
Certain settlement costs from the original purchase also fold into your basis. The IRS treats these as costs of acquiring the property itself, separate from financing:1Internal Revenue Service. Publication 523 (2025), Selling Your Home
- Abstract of title fees, title search costs, and owner’s title insurance
- Attorney charges for preparing the sales contract, deed, and closing documents
- Recording fees, transfer taxes, and stamp taxes
- Land survey fees
- Charges to install utility service to the property
These all appear on the settlement statement from your original closing. Purchases after October 2015 typically use a Closing Disclosure; older transactions used a HUD-1. Either one is your primary record of what you paid.
One item that moves the other direction: if the seller paid mortgage discount points on your behalf at closing, you generally subtract those points from your basis. For homes bought after April 3, 1994, this reduction applies whether or not you deducted the points on your tax return.2Internal Revenue Service. Publication 523 (2025), Selling Your Home – Section: Basis Adjustments It’s easy to miss, so check the original settlement statement line by line.
What You Can’t Include
Costs tied to the mortgage rather than the property stay out. Points you paid to get your loan, lender-required appraisal fees, and mortgage insurance premiums all relate to the debt, not to the house.3Internal Revenue Service. Publication 551 (12/2025), Basis of Assets
Prepaid items placed in escrow at closing are also excluded. Property taxes, homeowner’s insurance, and utility charges that cover the time after you take ownership are ongoing costs of living in the home, not costs of buying it.3Internal Revenue Service. Publication 551 (12/2025), Basis of Assets
Capital Improvements That Raise Your Basis
After you’ve set the starting basis, capital improvements you make during ownership push it higher. The IRS treats an expenditure as a capital improvement if it results in a betterment to the property, restores a major component, or adapts the property to a new use.4Internal Revenue Service. Tangible Property Regulations – Frequently Asked Questions The improvement must be permanent and expected to last beyond the current tax year.
Common examples: replacing the entire roof or HVAC system, adding a bathroom or bedroom, building a deck or garage, installing new insulation, putting in a swimming pool. Each adds measurable value or extends the structure’s useful life, so the full cost goes into your basis. If you demolished an existing structure before building, the demolition costs attach to the basis of the land rather than being deducted as a current expense.3Internal Revenue Service. Publication 551 (12/2025), Basis of Assets
The Line Between Repairs and Improvements
A repair keeps the home in its current operating condition without materially adding value. Repainting a room, patching a gutter, fixing a leaky faucet, or replacing a single broken window pane are all repairs. You can’t deduct them on a personal residence, and they don’t increase your basis.5Internal Revenue Service. Publication 530 (2025), Tax Information for Homeowners
Scope is what separates the two. Swapping one cracked window is a repair; replacing every window in the house with energy-efficient models is an improvement. Repairs done as part of a larger remodeling project get treated as improvements and added to basis.5Internal Revenue Service. Publication 530 (2025), Tax Information for Homeowners That matters when you renovate a kitchen or bathroom, because the small fixes folded into the project become part of the improvement cost.
Events That Reduce Your Basis
Improvements push the basis up. Other events pull it back down, and missing any of them causes you to understate the gain.
Depreciation From Rental or Business Use
If you ever rented the home or used part of it for business, depreciation you claimed reduces your basis. The IRS goes further: even if you were entitled to depreciation but never took it, your basis is still reduced by the amount that was allowable.6Internal Revenue Service. Publication 946 (2025), How To Depreciate Property Skipping the deduction during rental years doesn’t help you, because the IRS treats the basis as reduced either way.
When you sell, the cumulative depreciation is subject to recapture. Unrecaptured Section 1250 gain is taxed at a maximum rate of 25%, usually higher than the long-term capital gains rate on the rest of the profit. Recapture applies even if part of your gain qualifies for the Section 121 exclusion.3Internal Revenue Service. Publication 551 (12/2025), Basis of Assets
Casualty Losses and Insurance Payments
If the home suffered damage from a fire, storm, or similar event and you received insurance reimbursement, that payment reduces basis. The same applies if you claimed a casualty loss deduction for damage insurance didn’t cover; the basis drops by the amount of the deduction you actually took.7Internal Revenue Service. Publication 547 (2025), Casualties, Disasters, and Thefts
Easement Payments
Money received for granting an easement reduces your basis. If only part of the property is affected, only that portion’s basis is reduced. When it’s impractical to separate the affected part, the basis of the entire property drops by the amount received. Any payment that exceeds your remaining basis is treated as taxable gain.8Internal Revenue Service. Publication 544, Sales and Other Dispositions of Assets
Federal Energy Tax Credits
If you claimed federal energy tax credits for improvements like solar panels, insulation, or efficient windows in prior years, the credit amount reduced your basis at the time you claimed it. Both the Section 25C energy efficient home improvement credit and the Section 25D residential clean energy credit included basis-reduction provisions.9Office of the Law Revision Counsel. 26 USC 25C – Energy Efficient Home Improvement Credit Both credits terminated for property placed in service after December 31, 2025.10Internal Revenue Service. FAQs for Modification of Sections 25C, 25D, 25E, 30C, 30D, 45L, 45W, and 179D If you claimed either credit in any prior year, the basis reduction still affects your gain calculation when you sell.
When You Didn’t Buy the Home
Inherited and gifted homes don’t start from a purchase price, and the rules differ sharply depending on how the property came to you.
Inherited Homes
When you inherit a home, your basis is stepped up (or less commonly, stepped down) to the property’s fair market value on the date the previous owner died. This effectively erases all the appreciation that built up during the decedent’s lifetime. The estate’s executor can elect an alternate valuation date six months after death, but only if doing so decreases both the total value of the estate and the estate tax owed.3Internal Revenue Service. Publication 551 (12/2025), Basis of Assets
In community property states, the surviving spouse can receive a full step-up on the entire property, not just the decedent’s half, as long as at least half the community interest was included in the decedent’s gross estate for estate tax purposes.11Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired From a Decedent This double step-up can eliminate capital gains on the full value of the home.
Gifted Homes
If someone gave you the home, you generally take over the donor’s adjusted basis, including improvements they made. This is a carryover basis.12Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust You’ll need the donor’s purchase records and improvement receipts.
There’s a wrinkle when the fair market value at the time of the gift was lower than the donor’s basis. If you later sell at a loss, you must use the lower fair market value as your basis for that loss calculation, not the donor’s higher basis.12Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust Holding period also depends on which basis you use. When you use the donor’s carryover basis to figure a gain, you tack the donor’s holding period onto your own. If you’re using the gift-date fair market value to figure a loss, your holding period starts on the date of the gift.13Office of the Law Revision Counsel. 26 U.S. Code 1223 – Holding Period of Property
Homes Transferred in a Divorce
A home transferred between spouses as part of a divorce is treated as a gift for tax purposes. No gain or loss is recognized at the transfer, and the receiving spouse takes the transferring spouse’s adjusted basis.14Office of the Law Revision Counsel. 26 U.S. Code 1041 – Transfers of Property Between Spouses or Incident to Divorce The rule covers transfers within one year of the marriage ending, or within six years if the transfer is required by the divorce or separation agreement.15Internal Revenue Service. Publication 504 (2025), Divorced or Separated Individuals
The consequence is real. If your ex-spouse bought the home for $200,000 and added $50,000 in improvements, your basis is $250,000 even if the home is worth $400,000 when it’s transferred to you. The spouse who keeps the home inherits the full future tax liability, and divorce settlements often undervalue that.
Doing the Final Math
Once you’ve added improvements and subtracted reductions, you have your adjusted basis. The gain calculation is:
Amount Realized − Adjusted Basis = Capital Gain (or Loss)
Amount realized is not the gross sale price. First subtract your selling expenses: real estate commissions, title fees, transfer taxes paid by the seller, legal fees, and other costs directly tied to the sale. What’s left is the amount realized.1Internal Revenue Service. Publication 523 (2025), Selling Your Home
If the amount realized exceeds your adjusted basis, you have a gain, reported on Schedule D of Form 1040 and potentially Form 8949.16Internal Revenue Service. 2025 Instructions for Schedule D (Form 1040) Most homeowners selling a primary residence can then apply the Section 121 exclusion, which shelters up to $250,000 of gain for single filers and up to $500,000 for married couples filing jointly, provided the two-year ownership and use tests are met.17Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Only the gain above the exclusion is taxed.
One asymmetry worth knowing: if your adjusted basis is higher than the amount realized, the IRS does not let you deduct the loss on a personal residence. You can’t offset other income with it and you can’t carry it forward.18Internal Revenue Service. Capital Gains, Losses, and Sale of Home Losses on real property are only deductible when the property was used in a trade or business or held for investment. A careful basis calculation still matters in a loss scenario, because knowing the loss isn’t deductible can affect how and when you sell.
Records That Protect the Number
Every dollar added to your basis is a dollar subtracted from taxable gain, but only if you can prove it. Keep the original closing statement, receipts and invoices for every capital improvement, records of any casualty losses or insurance reimbursements, and depreciation schedules if you ever rented the home or used it for business.
The general rule is to keep these records for at least three years after the due date of the tax return on which you report the sale.1Internal Revenue Service. Publication 523 (2025), Selling Your Home Many tax professionals suggest keeping them longer. Even if you excluded the full gain under Section 121, the IRS can question whether you qualified, and the underlying records are what support your basis.
Losing the paperwork for a $15,000 kitchen remodel or a $25,000 roof replacement directly increases your tax bill. If you can’t substantiate an improvement, the IRS isn’t required to accept it. Bank and credit card statements can serve as backup, but the strongest evidence is the original contractor invoice paired with proof of payment.