See the gain on your home sale, the way the IRS figures it.

Price, selling costs and your basis, one question at a time. The steps follow IRS Publication 523, and it never works out tax owed.

Opens your own AI in a new tab, in your own account, with the question ready for you. Keighbor cannot see the conversation.

Free · reference, not tax advice · nothing you type leaves your browser

What did the home sell for?

Or what you expect. The contract price, before any costs.

Question 1 of 6 · sale priceAbout two minutes
Why we ask this one

Pub 523 starts with everything you received for the home. Money for furniture or other things sold with it isn't part of the price.

Need your basis first?Home cost basis calculatorpurchase costs and improvements, added up the way Pub 523 and Pub 551 do
Figure my basis →

Part 1 of 4

How the IRS figures the gain on a home

Pub 523's Worksheet 2, line by line. Beside each, your figure once you give it.

Sale price

Everything you received for the home, including real estate tax the buyer paid on your behalf.

Not given yet
Selling expenses

Commissions, advertising, legal fees, loan charges you paid that are normally the buyer's, and transfer taxes you paid as the seller.

Not given yet
Amount realized

The sale price less selling expenses.

Not given yet
Adjusted basis

What you paid, plus certain closing costs and improvements, less certain decreases.

Not given yet
Gain or loss

The amount realized less the adjusted basis.

Not given yet

Part 2 of 4

The $250,000 and $500,000 exclusion

Topic 701 and Pub 523 describe three tests over the 5 years before the sale. You owned the home for at least 24 months. You lived in it as your main home for at least 24 months. And you didn't exclude gain on another home sold in the 2 years before.

On a joint return, one spouse can meet the ownership test, but both have to meet the use test and the 2-year look-back for $500,000. When only one of you does, Pub 523's Worksheet 1 looks at whether either spouse qualifies for $250,000 alone.

When a test isn't met, Pub 523 describes a partial exclusion for a move mainly because of work, health or an unforeseeable event, and some exceptions. Pub 523 also says a home acquired in a like-kind exchange in the past 5 years isn't eligible. This page figures none of those.

Part 3 of 4

Property tax and points in the year of the sale

Pub 523 counts your share of the year's real estate tax from the start of the tax year through the day before the sale, over 365 days (366 in a leap year). Its example: $620 for the year, a sale on May 6, 125 days, a $212 share. That share may be deductible if you itemize, and when the buyer paid the whole bill it joins your sale price.

If you received a Form 1099-S, Pub 523 starts instead from the tax you actually paid, less the buyer's share in box 6. Points on your own mortgage that you haven't fully deducted may be deductible in the year the loan ends (Pub 936).

Part 4 of 4 · where to read next

Questions people ask

How does the IRS figure the gain on a home sale?

IRS Publication 523 takes the sale price, subtracts your selling expenses to get the amount realized, then subtracts your adjusted basis. What's left is your gain, or your loss if it's below zero.

How much gain can I exclude when I sell my home?

Up to $250,000, or up to $500,000 on a joint return, when you meet the tests in Publication 523: you owned the home and lived in it as your main home for at least 24 months of the 5 years before the sale, and you didn't exclude gain on another home sold in the 2 years before.

What if I don't meet the 24-month tests?

Publication 523 describes a partial exclusion for a sale mainly because of a move for work, a health reason or an unforeseeable event, and some exceptions to the tests. This calculator doesn't figure those. A tax professional can.

Can I deduct a loss on selling my home?

Publication 523 says a loss on the sale of your main home can't be deducted.

Are closing costs deductible when I sell?

Most aren't a separate deduction. Publication 523 treats costs like commissions and a transfer tax you paid as the seller as selling expenses, which lower the amount realized. Your share of the year's property tax may be deductible if you itemize.

Does this tell me the tax I owe?

No. It stops at the gain that may be taxable. The tax depends on your whole return, and a tax professional or your tax software works that out.

Reference, not tax advice

Keighbor is a software company, not a tax adviser. These figures follow the steps in IRS Publications 523 and 551 as general information, not tax advice about your sale, and they are not the tax you owe. Your situation may differ, and tax rules change. Before you file or rely on a figure, ask a tax professional such as a CPA or an enrolled agent.

Written and researched by Keighbor Research · read against IRS Publication 523, Publication 936 and Topic 701 · how we research and check what we publish

Was this page helpful?

Keep the papers behind these figures.

A Room keeps your closing statement, receipts and every document from the sale in one place, next to the people and dates they came with.

Organize my sale

Next, tell us your name, address, and where you are in the sale. It takes about two minutes and does not list your home or contact anyone.

Where it is in your Room

  1. Open your Room
  2. Documents, in the menu on the left

The closing statement and your improvement receipts sit together, found by name.