Skip to content

General education, not advice for your situation.

Carry Forward Learning Search the site

Selling Your Home

Selling Your Home: basis and your gain

Same facts. Pro adds the full authority stack under each answer.

What is basis?

Basis is your investment in the home for tax purposes: what you paid for it, plus certain closing costs and the cost of improvements, minus some adjustments like depreciation. The higher your basis, the lower your gain.
Sources

Authority, strongest first

  1. Code I.R.C. § 1012(a)
  2. Code I.R.C. § 1016(a)(1), (a)(2)
  3. Publication IRS Publication 523 (2025), Selling Your Home
Section 1012(a) (cost) and 1016(a)(1)-(2) (increases for capital expenditures, decreases for depreciation allowed or allowable). Pub. 523 Worksheet 2, lines 4 and 5.

Which home improvements raise my basis?

Things that add value, extend the life of the house or adapt it to a new use: an addition, a new roof, a remodeled kitchen, central air, a deck, a fence, landscaping. Routine repairs and upkeep, like painting or fixing a leak, don't count, unless they're part of a bigger remodel.
Sources

Authority, strongest first

  1. Code I.R.C. § 1016(a)(1), (a)(2)
  2. Publication IRS Publication 523 (2025), Selling Your Home
Pub. 523 says repairs done as part of an extensive remodeling or restoration are included, and that costs of improvements no longer part of the home (like carpeting you replaced) are not.

Which selling costs reduce my gain?

Agent commissions, advertising, legal fees, and other costs of selling, such as loan charges you paid that were normally the buyer's. They reduce the amount you're treated as receiving.
Sources

Authority, strongest first

  1. Code I.R.C. § 1001(a)-(c)
  2. Publication IRS Publication 523 (2025), Selling Your Home
Pub. 523 Worksheet 2, line 2. Transfer taxes paid as seller are treated as selling expenses rather than as a deduction.

What if I inherited the house?

Your basis is usually the home's value on the date of the owner's death, not what they paid. That reset often wipes out most of the gain. The exclusion itself needs you to have owned it and lived in it as your main home long enough yourself, so heirs who never lived there generally can't use it. Most heirs who sell quickly have little or no gain anyway.
Sources

Authority, strongest first

  1. Code I.R.C. § 1014(a), (b)(6)
  2. Code I.R.C. § 121
  3. Publication IRS Publication 523 (2025), Selling Your Home
Section 1014(a)(1) supplies the step-up; section 121(a) requires ownership and use by the taxpayer. Pub. 523 covers the 2010 exception (Pub. 4895).

I inherited my spouse's share. What happens to my basis?

For a home you owned together, you get a new basis for your late spouse's half, equal to its value at death. Your own half keeps its old basis. In the community property states, the whole home can get new basis.
Sources

Authority, strongest first

  1. Code I.R.C. § 1014(a), (b)(6)
  2. Publication IRS Publication 523 (2025), Selling Your Home
Section 1014(b)(6) for community property. For joint tenancy or tenancy by the entirety, Pub. 523 treats each spouse as owning one half and gives an example in which the new basis is half the old adjusted basis plus half the value at death.

What if someone gave me the house?

You generally take over the donor's basis, so you inherit their gain, too. If the home was worth less than their basis when they gave it to you and you sell at a loss, your basis for figuring the loss is the lower value.
Sources

Authority, strongest first

  1. Code I.R.C. § 1015(a)
  2. Publication IRS Publication 523 (2025), Selling Your Home
Section 1015(a). Pub. 523 Table 1 summarizes the exceptions, and the add-on for gift tax paid (Reg. 1.1015-5).

What's my basis if I got the house in a divorce?

Usually the same basis your spouse had. A transfer between spouses, or to an ex-spouse as part of the divorce, isn't taxed, and the new owner steps into the old owner's shoes.
Sources

Authority, strongest first

  1. Code I.R.C. § 1041
  2. Publication IRS Publication 523 (2025), Selling Your Home
Section 1041(a)-(c). The carryover basis applies to transfers within one year after the marriage ends or related to it. It does not apply if the receiving spouse is a nonresident alien (1041(d)).

Do energy credits for solar or windows change my basis?

Yes. If you added the cost of qualifying energy improvements to your basis and also claimed a credit or got a subsidy for them, you subtract the credit or subsidy from your basis. The two big home energy credits ended for improvements made in 2026 and later, but credits you claimed for 2025 and earlier still reduce your basis when you sell.
Sources

Authority, strongest first

  1. Code I.R.C. § 25C(g), (i)
  2. Code I.R.C. § 25D(f), (h)
  3. Code I.R.C. § 1016(a)(1), (a)(2)
  4. Session law Pub. L. 119-21 § 70505
  5. Session law Pub. L. 119-21 § 70506
  6. Publication IRS Publication 523 (2025), Selling Your Home
Sections 25C(g) and 25D(f) each reduce basis by the credit allowed. Section 25C(i) now says the credit does not apply to property placed in service after 2025 and 25D(h) says it does not apply to expenditures made after 2025 (P.L. 119-21 sections 70505 and 70506). Pub. 523 lists the credits and subsidies. Section 1016(a) permits the adjustments the Code requires.

What records should I keep, and for how long?

Keep the closing statement from when you bought, receipts for improvements, and the closing statement from the sale. Pub. 523's general advice is to keep them until 3 years after the due date of the return for the year you sold, and since basis records go back to the day you bought, keep them for the whole time you own the house.
Sources

Authority, strongest first

  1. Publication IRS Publication 523 (2025), Selling Your Home
Pub. 523, What records to keep. The general three-year period is the ordinary assessment period; records that support basis are needed to compute gain whenever the property is sold.

More questions

Where the numbers come from

Checked

Every figure above comes from the source listed here, with the date we checked it and the date it is due for a re-check.