skip navigation

Search Help
Navigation Help

Topic Index

Tax Topics

About Tax Map Website
Publication 523

Figuring Gain or Loss(p4)

To figure the gain or loss on the sale of your main home, you must know the selling price, the amount realized, and the adjusted basis. Subtract the adjusted basis from the amount realized to get your gain or loss.
  Selling price 
 Selling expenses 
  Amount realized 
 Adjusted basis 
  Gain or loss 


Gain is the excess of the amount realized over the adjusted basis of the property.


Loss is the excess of the adjusted basis over the amount realized for the property

Selling Price(p4)

The selling price is the total amount you receive for your home. It includes money; all notes, mortgages, or other debts assumed by the buyer as part of the sale; and the fair market value of any other property or services you receive.

Personal property.(p4)

The selling price of your home does not include amounts you received for personal property sold with your home. Personal property is property that is not a permanent part of the home. Examples are furniture, draperies, rugs, a washer and dryer, and lawn equipment. Separately stated amounts you received for these items should not be shown on Form 1099-S (discussed later). Any gains from sales of personal property must be included in your income, but not as part of the sale of your home.

Payment by employer.(p4)

You may have to sell your home because of a job transfer. If your employer pays you for a loss on the sale or for your selling expenses, do not include the payment as part of the selling price. Your employer will include it as wages in box 1 of your Form W-2 and you will include it in your income on Form 1040, line 7, or on Form 1040NR, line 8.

Option to buy.(p4)

If you grant an option to buy your home and the option is exercised, add the amount you receive for the option to the selling price of your home. If the option is not exercised, you must report the amount as ordinary income in the year the option expires. Report this amount on Form 1040, line 21, or on Form 1040NR, line 21.

Form 1099-S.(p4)

If you received Form 1099-S, Proceeds From Real Estate Transactions, box 2 (gross proceeds) should show the total amount you received for your home.
However, box 2 will not include the fair market value of any services or property other than cash or notes you received or will receive. Instead, box 4 will be checked to indicate your receipt or expected receipt of these items.
If you can exclude the entire gain, the person responsible for closing the sale in most cases will not have to report it on Form 1099-S. If you do not receive Form 1099-S, use sale documents and other records to figure the total amount you received for your home.

Amount Realized(p4)

The amount realized is the selling price minus selling expenses.

Selling expenses.(p5)

Selling expenses include:

Adjusted Basis(p5)

While you owned your home, you may have made adjustments (increases or decreases) to the basis. This adjusted basis must be determined before you can figure gain or loss on the sale of your home. For information on how to figure your home's adjusted basis, see Determining Basis, later.

Amount of Gain or Loss(p5)

To figure the amount of gain or loss, compare the amount realized to the adjusted basis.

Gain on sale.(p5)

If the amount realized is more than the adjusted basis, the difference is a gain and, except for any part you can exclude, in most cases is taxable.

Loss on sale.(p5)

If the amount realized is less than the adjusted basis, the difference is a loss. A loss on the sale of your main home cannot be deducted.

Jointly owned home.(p5)

If you and your spouse sell your jointly owned home and file a joint return, you figure your gain or loss as one taxpayer.
Separate returns.(p5)
If you file separate returns, each of you must figure your own gain or loss according to your ownership interest in the home. Your ownership interest is determined by state law.
Joint owners not married.(p5)
If you and a joint owner other than your spouse sell your jointly owned home, each of you must figure your own gain or loss according to your ownership interest in the home. Each of you applies the rules discussed in this publication on an individual basis.

Dispositions Other Than Sales(p5)

Some special rules apply to other dispositions of your main home.

Foreclosure or repossession.(p5)

If your home was foreclosed on or repossessed, you have a disposition.
In most cases, you figure the gain or loss from the disposition the same way as gain or loss from a sale. But the selling price of your home used to figure the amount of your gain or loss depends, in part, on whether you were personally liable for repaying the debt secured by the home, as shown in the following chart.
IF you were...THEN your selling price includes...
not personally liable for the debt the full amount of debt canceled by the foreclosure or repossession.
personally liable for the debtthe amount of canceled debt up to the home's fair market value. You may also have ordinary income, as explained next.
Ordinary income.(p5)
If you were personally liable for the canceled debt, you may have ordinary income in addition to any gain or loss. If the canceled debt is more than the home's fair market value, you have ordinary income equal to the difference. Report that income on Form 1040, line 21, or on Form 1040NR, line 21. However, the income from cancellation of debt is not taxed to you if the cancellation is intended as a gift, a discharge of qualified principal residence indebtedness, or if you are insolvent or bankrupt. For more information on insolvency or bankruptcy, see Publication 908, Bankruptcy Tax Guide. For the definition of qualified principal residence indebtedness and more information on discharges of that indebtedness, see Discharges of qualified principal residence indebtedness, later under Decreases to Basis. Also see Form 982 and Publication 4681, Canceled Debts, Foreclosures, Repossessions, and Abandonments.
Form 1099-A and Form 1099-C.(p5)
Generally, you will receive Form 1099-A, Acquisition or Abandonment of Secured Property, from your lender if your home is transferred in a foreclosure. This form will have the information you need to determine the amount of your gain or loss and any ordinary income from cancellation of debt that is not a discharge of qualified principal residence indebtedness. If your debt is canceled, you may receive Form 1099-C, Cancellation of Debt.
More information.(p5)
If part of a home is used for business or rental purposes, see Foreclosures and Repossessions in chapter 1 of Publication 544 for more information. Publication 544 has examples of how to figure gain or loss on a foreclosure or repossession.


If you abandon your home, see Publication 4681 to determine if you have ordinary income, gain, or loss.

Trading (exchanging) homes.(p5)

If you trade your old home for another home, treat the trade as a sale and a purchase.


You owned and lived in a home with an adjusted basis of $41,000. A real estate dealer accepted your old home as a trade-in and allowed you $50,000 toward a new home priced at $80,000. This is treated as a sale of your old home for $50,000 with a gain of $9,000 ($50,000 − $41,000).
If the dealer had allowed you $27,000 and assumed your unpaid mortgage of $23,000 on your old home, your sales price would still be $50,000 (the $27,000 trade-in allowed plus the $23,000 mortgage assumed).

Transfer to spouse.(p6)

If you transfer your home to your spouse or to your former spouse incident to your divorce, you in most cases have no gain or loss (unless the Exception, discussed next, applies). This is true even if you receive cash or other consideration for the home. As a result, the rules explained in this publication do not apply.
If you owned your home jointly with your spouse and transfer your interest in the home to your spouse, or to your former spouse incident to your divorce, the same rule applies. You have no gain or loss.
These transfer rules do not apply if your spouse or former spouse is a nonresident alien. In that case, you generally will have a gain or loss.
More information.(p6)
See Property Settlements in Publication 504, Divorced or Separated Individuals, for more information.

Involuntary conversion.(p6)

You have a disposition when your home is destroyed or condemned and you receive other property or money in payment, such as insurance or a condemnation award. This is treated as a sale and you may be able to exclude all or part of any gain from the destruction or condemnation of your home, as explained later under Special Situations (see Home destroyed or condemned).