Skip to content
Independent money guidance
Clear Money Guide
Start here
Menu

Pub 523 Worksheet 2 (2025): Figure Your Home Sale Gain or Loss

Updated October 21, 2026. Quick answer: Worksheet 2 in Publication 523 turns a home sale into one number. Add up what you received, subtract selling expenses to get the amount realized, subtract your adjusted basis, and line 7 is the gain or loss. A positive number goes to Worksheet 3 to see how much, if any, is taxable. A loss on a main home is not deductible.

What this worksheet is for

Publication 523 introduces it as the step that “is used to figure the adjusted basis of your home and your gain or (loss).” The limit it is later compared with is at Worksheet 1, and the taxable result is at Worksheet 3.

The worksheet line by line

LineWhat the worksheet says
Setup“If married filing jointly, figure gain or loss for both spouses together. If single or married filing separately, figure gain or loss as an individual.”
1. Sale price“Determine the sale price. This is everything you received for selling your home.” Lines 1a to 1e are money, other property or services, debts the buyer took over, taxes the buyer paid for you, and option payments; “Add lines 1a through 1e. This is your sale price”
Form 1099-S“If you received Form 1099-S, the gross proceeds for the sale price should appear in box 2.”
2. Selling expenses“Determine your selling expenses. These are the costs directly associated with selling your home.” Lines 2a to 2e include “Any sales commissions (for example, a real estate agent’s sales commission)”; line 2f adds them.
3. Amount realized“Figure your “amount realized” (sale price minus selling expenses).” “Line 1f minus line 2f”
4. Total basis“Determine your “total basis” (the total amount you invested in your home).” Lines 4a to 4f cover the purchase price, closing costs, improvements and special assessments; line 4g adds them.
5. Basis adjustments“Determine your “basis adjustments” (any payments, credits, or benefits you may need to deduct from your basis).” Line 5 covers depreciation, casualty losses and insurance, easement payments, energy credits, adoption credits and a dozen other items; read the full list on the form. Line 5m adds them.
6. Adjusted basis“Figure your “adjusted basis” (total basis minus basis adjustments).” “Line 4g minus line 5m”
7. Gain or loss“Figure your gain or loss (amount realized minus adjusted basis).” “Line 3 minus line 6”

A worked example

Illustration, not an IRS example. Every input is invented.

ItemIllustration
Line 1a: money received (invented)$600,000
Line 1f, computed: add lines 1a to 1e (only 1a is used)$600,000 (computed)
Line 2a: sales commission (invented)$30,000
Line 2c: legal fees (invented)$2,000
Line 2f, computed: 30,000 + 2,000$32,000 (computed)
Line 3, computed: line 1f minus line 2f$568,000 (computed)
Line 4a: purchase price (invented)$300,000
Line 4b: closing costs when bought (invented)$4,000
Line 4d: improvements still part of the home (invented)$40,000
Line 4g, computed: 300,000 + 4,000 + 40,000$344,000 (computed)
Line 5m: basis adjustments (none)$0
Line 6, computed: line 4g minus line 5m$344,000 (computed)
Line 7, computed: line 3 minus line 6$224,000 (computed)

The $224,000 is the gain. For a single filer with the full $250,000 exclusion, the gain on this example would be fully excluded; whether it is depends on Worksheet 1 and Worksheet 3. The sale also belongs on Form 8949 if you received a Form 1099-S, whose instructions describe box 2a this way: “Enter the total gross proceeds from the real estate transaction, generally the sales price.”

If line 7 is negative

“If the number is negative (adjusted basis is greater than amount realized), you sold your home at a loss.” “You can’t deduct this loss, but you don’t need to pay any tax on the money you received from selling your home.”

Shared and part-business homes

“If the home you sold had multiple owners, your gain or loss is the gain or loss on the entire sale multiplied by your percentage of ownership.” “If you used any portion of the property for business or rental purposes, see Property Used Partly for Business or Rental.”

Edition and line numbers

This page reads Publication 523 (2025), the current file irs.gov served on 2026-10-21 (sha256 in the kit data). The Worksheet 2 in it is for the tax year 2025 return, filed in 2026. Check the tax year printed on the worksheet in your own copy and use that year’s line numbers, because a different year’s worksheet can word its lines differently.

Common mistakes

  • Leaving out selling expenses. Line 3 is “Line 1f minus line 2f”
  • Forgetting improvements that are still part of the home. Line 4d counts them; maintenance and repairs are not included.
  • Treating a loss as deductible. The worksheet says “You can’t deduct this loss”

Related: home sale taxes, Form 1099-S, Form 8949, and home sale capital gains exclusion calculator.

Find the right next step for your situation

About how much do you have invested? Pick the range that fits; your next step appears immediately below.

About how much do you have invested?

Sources

Read from the IRS documents linked above on October 21, 2026. General information, not tax advice. Your own facts decide the outcome, and a preparer, the account provider or the IRS is the right place to confirm anything consequential.

See the adviser match on this page