skip navigation

Search Help
Navigation Help

Tax Map Index
ABCDEFGHI
JKLMNOPQR
STUVWXYZ#

International
Tax Topic Index

Affordable Care Act
Tax Topic Index

FAQs
Forms
Publications
Tax Topics

Comments
About Tax Map

IRS.gov Website
Publication 523
taxmap/pubs/p523-002.htm#en_us_publink100010379

Figuring Gain or Loss(p7)

rule
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 
taxmap/pubs/p523-002.htm#en_us_publink100025071

Gain.(p7)

rule
Gain is the excess of the amount realized over the adjusted basis of the property.
taxmap/pubs/p523-002.htm#en_us_publink100025072

Loss.(p7)

rule
Loss is the excess of the adjusted basis over the amount realized for the property.
See How to Figure Your Gain or Loss Worksheet, later, for steps you should follow to figure your gain or loss.
taxmap/pubs/p523-002.htm#en_us_publink100010380
PencilHow to Figure Your Gain or Loss Worksheet
The process is the same for single family homes, condominiums, mobile homes, and all other types of homes. If you have questions as you work through these step-by-step instructions, or want examples of costs that can and cannot be included, see Basis Adjustments—Details and Exceptions, later.
  • If married and filing jointly, figure gain or loss for both of you together.
  • If not filing jointly, or if there are two owners who are not married, you will need a gain or loss figure for each individual. If ownership is joint, or is shared 50/50, the figure for each individual is half of the final gain or loss result from this worksheet. If ownership is divided according to different percentages, each owner's figure is the gain or loss result from this worksheet multiplied by their ownership percentage.
  • If you used any portion of the property for business or rented it out, go to Business or Rental Use of Home, earlier.
1.Determine the sale price. This is everything you received in exchange for your home.
 a.All money (currency, check, wire transfer)a.
 b.The value of any notes, mortgages, or other debts that the buyer agreed to assume (take over) as part of the saleb.
 c.Any real estate taxes the buyer paid on your behalfc.
 d.The fair market value of any other property or services you receivedd.
 e.Any amount you received for granting an option to buy your home, if the option was exercisede.
 f.Add lines 1a through 1e. This is your sale pricef.
  
  • If you received payment for personal property, do NOT include it in the sale price (examples: furniture, draperies, rugs, washer and dryer, and lawn equipment),
  • If you received payment or reimbursement from your employer because of a job transfer, do not include the payment as part of the selling price. Your employer will include it as wages in box 1 of your W-2.
  • If you received Form 1099-S, the gross proceeds for the sale price should appear in box 2. If box 4 is checked, the sale price included non-cash payments, and you need to determine the value of these and add them to the figure in box 2.
  • If you did not receive Form 1099-S, refer to your real estate transaction documents for the total amount you received for your home.
  
taxmap/pubs/p523-002.htm#en_us_publink100012034
PencilHow to Figure Your Gain or Loss Worksheet—Continued pg 2
2.Determine your selling expenses. These are the costs directly associated with selling your home.
 a.Any sales commissions (for example, a real estate agent's sales commission)a.
 b.Any fees for a service that helped you sell your home without a brokerb.
 c.Any advertising feesc.
 d.Any legal feesd.
 e.Any mortgage points or other loan charges you paid that would normally have been the buyer's responsibilitye.
 f.Add lines 2a through 2f. These are your selling expensesf.
  
  • If you received payment or reimbursement from your employer, subtract from the selling expenses any portion of these expenses your employer paid or reimbursed to you.
  
3.Figure your "amount realized" (sale price minus selling expenses).
 a.Your sale price (line 1f) a.
 b.Subtract your selling expenses (line 2f) b.
 c.This is your amount realizedc.
4.Determine your "total basis" (the total amount you invested in your home). This includes what you paid for your home as well as other money you may have put into it that added to its value.
 a.The amount you paid for your home (or if you built your home, the cost of the land). Include any down payment and any amount you borrowed to pay for the home, such as a first or second mortgage, or notes you gave the seller in payment for the home. For cooperative apartments, include the value of the corporation stock you purchased. If you acquired your home through inheritance, gift, bargain sale, trade, or anything except a fair market purchase, see Basis Adjustments—Details and Exceptions, later a.
 b.Any settlement fees or closing costs you paid when you bought your home, except for financing-related costs (such as seller-paid points). A fee paid for buying the home is any fee you would have had to pay even if you paid cash for the home. See Basis Adjustments—Details and Exceptions and Fees and Closing Costsb.
 c.Any real estate taxes or other costs you paid on behalf of the seller you bought your home from (and for which the seller never paid you back) c.
 d.Any amounts you spent on construction, renovation, or other improvements that are still part of your home when you sell it, but not costs or repairs and maintenance. See Basis Adjustments—Details and Exceptions, later d.
 e.Any amounts you spent to repair damage to your home or the land it sits one.
 f.Any special assessments for local improvements (such as special tax or condominium association assessments that are not merely for repairs or maintenance) f.
 g.Add lines 4a through 4f. This is your total basisg.
taxmap/pubs/p523-002.htm#en_us_publink100012037
PencilHow to Figure Your Gain or Loss Worksheet—Continued pg 3
5.Determine your "basis adjustments" (any payments, credits, or benefits you may need to deduct from your basis).
 a.Any depreciation you took for using your home as a home officea.
 b.Any depreciation you took — or didn't take but could have taken — for any business or investment (rental) use of your home other than home office use b.
 c.Any casualty losses (such as flood or fire damage) you claimed as a deduction on a federal tax returnc.
 d.Any insurance payments you received or expect to receive for casualty lossesd.
 e.Any payments you received for granting an easement, conservation restriction, or right-of-waye.
 f.Any energy credits or subsidies that effectively paid you back for improvements you included in your total basis (generally available only from 1977–1987) f.
 g.Any adoption credits you claimed, or any nontaxable payments from an employer-sponsored adoption assistance program, you used for improvements you included in your total basis g.
 h.Any District of Columbia first-time homebuyer credit you claimedh.
 i.Any real estate taxes the seller paid on your behalf (and for which you never paid the seller back). If you reimburse the seller, it does not affect basis i.
 j.Any mortgage points the seller paid for you when you bought your home, but only if one of the following is truej.
  
  • You bought your home sometime between January 1, 1991 and April 5, 1994 (including those days) AND you deducted the points as home mortgage interest in the year they were paid, or
  • You bought your home after April 3, 1994 (whether you deducted the points or not).
  
 k.Any canceled or forgiven mortgage debt amount that was excluded due to a bankruptcy or insolvency and you did not have to declare as income. For more information, see Publication 4681 k.
 l.Any sales tax you paid on your home (such as for a mobile home or houseboat) and then claimed as a deduction on a federal tax return l.
 m.The value of any temporary housing the builder of your home provided for youm.
  
  • Use this equation:Contract price × Value of temporary housing ÷ (Value of temporary housing + Value of new home)
  
 n.Any gain you postponed from a home you sold before May 7, 1997n.
 o.Add lines 5a through 5n. This is your basis adjustmento.
6.Figure your "adjusted basis" (total basis minus basis adjustments).
 a.Your total basis (line 4g) a.
 b.Subtract your basis adjustments (line 5o) b.
 c.This is your adjusted basisc.
  
  • If your adjusted basis is less than zero and you went through a mortgage workout or other process resulting in forgiveness or cancellation of mortgage debt ("discharge of qualified principal residence indebtedness"), do not count any portion of your canceled debt that is bringing your basis below zero.
  
7.Figure your gain or loss (amount realized minus adjusted basis).
 a.Your amount realized (line 3c) a.
 b.Subtract your adjusted basis (line 6c) b.
 c.This is your gain or lossc.
  
  • If the number is negative (adjusted basis is greater than amount realized), you sold your home at a loss. You cannot deduct this loss, but you do not need to pay any tax on the money you received from selling your home. Skip to Reporting Your Home Sale, later.
  • If the number is positive, you sold your home at a gain. Skip to How Much Is Taxable, later.
  
taxmap/pubs/p523-002.htm#en_us_publink100010381

Business or Rental Use of Home(p7)

rule
taxmap/pubs/p523-002.htm#en_us_publink100010382

Determine whether the space used for business during the 5 years before the sale is considered to be within your home or not.(p7)

rule
If the business or rental space was physically part of the living area of your home, such as a spare room used as a bed-and-breakfast bedroom or attic space used as a home office, your business usage does not affect your gain/loss calculations. Complete How to Figure Your Gain or Loss Worksheet, later.
taxmap/pubs/p523-002.htm#en_us_publink100010383
If the business or rental space was not within your living space,(p7)
such as a first-floor store with residence, an apartment with its own entrance (and kitchen and bath), or a working farm with a farmhouse on the property, continue to Determine whether the business or rental space still counts as a business space, next.
taxmap/pubs/p523-002.htm#en_us_publink100010384

Determine whether the business or rental space still counts as a business space.(p10)

rule
A space formerly used for business is considered residence space if ALL of the following are true:
If all of these are true, your business usage does NOT affect your gain/loss calculations. Complete How to Figure Your Gain or Loss Worksheet and then go to How Much Is Taxable, later.
For more information about using any part of your home for business or renting it to someone, see Publication 587, Business Use of Your Home, and Publication 527, Residential Rental Property.
taxmap/pubs/p523-002.htm#en_us_publink100010385
Do you need to calculate your business and residence portions separately?(p10)
If ANY of the three bullets in Determine whether the business or rental space still counts as a business space, earlier, is NOT true, you need to make separate gain/loss calculations for the business and residence portions of your property. Continue to Make three copies of all pages of How to Figure Your Gain or Loss Worksheet, next.
taxmap/pubs/p523-002.htm#en_us_publink100010386

Make three copies of all pages of How to Figure Your Gain or Loss Worksheet.(p10)

rule
Label one copy "Total," one copy "Home," and one copy "Business or Rental."
taxmap/pubs/p523-002.htm#en_us_publink100010671

Complete your "Total" worksheet using the figures for your property as a whole.(p10)

rule
Include the total amount you received, all of your basis adjustments, etc. Include the cost of all improvements, whether you made them to the business space or the residential space.
taxmap/pubs/p523-002.htm#en_us_publink100010672

Determine your "business or rental percentage."(p10)

rule
This is the percentage of your property that is considered to have been used for business or rental.
taxmap/pubs/p523-002.htm#en_us_publink100010673
If you took depreciation on your home(p10)
on past tax returns, use the same business or rental percentage that you used in determining how much depreciation to take.
taxmap/pubs/p523-002.htm#en_us_publink100010674
If you did NOT take depreciation on your home(p10)
on past tax returns, compare the size of your business or rental space to the size of the whole property and express this as a percentage. For example, if you have a building with 3 equal-sized stories, and you live in the top 2 stories and use the ground floor for a store, then you are using 1/3 of the property. Your business percentage is 33.3%.
taxmap/pubs/p523-002.htm#en_us_publink100010675

Determine the business or rental portion of each number on your "Total" worksheet.(p10)

rule
For each number on your "Total" worksheet, calculate the business-related portion of that number and enter it on your "Business or Rental" worksheet.
Note that you may use different methods to determine the business portion of different numbers. Here are the three possible methods and the circumstances under which each method applies:
taxmap/pubs/p523-002.htm#en_us_publink100010676
If you are unsure how to apply a percentage,(p10)
simply take the percentage number, move the decimal point 2 spaces to the left, and multiply by the number you are taking a percentage of. For example, to figure 25% of $20,000, you would do this: 0.25 × $20,000 = $5,000.
taxmap/pubs/p523-002.htm#en_us_publink100010677

Calculate the totals on your "Business" worksheet.(p10)

rule
The total you get on line 7c, under How to Figure Your Gain or Loss Worksheet, earlier, on your "Business" worksheet is the gain or loss related to the business or rental portion of the property you sold.
taxmap/pubs/p523-002.htm#en_us_publink100010678

Complete your "Home" worksheet.(p10)

rule
For each number, take the number from your "Total" worksheet, subtract the number from your "Business or Rental" worksheet, and enter the result in your "Home" worksheet.
Now calculate the totals on your "Home" worksheet. The total you get on line 7c, under How to Figure Your Gain or Loss Worksheet, earlier, on your "Home" worksheet is the gain or loss related to the home portion of the property you sold.
taxmap/pubs/p523-002.htm#en_us_publink100010744

Review the results of your "Home" and "Business" worksheets to determine your next step.(p10)

rule
When you have completed each worksheet, you will know whether you have a gain or loss on each part of your property. It is possible to have a gain on both parts, a loss on both parts, or a gain on one part and a loss on the other.
See Table—Does Your Home or Business Show a Gain or a Loss, later, to determine your next steps.
taxmap/pubs/p523-002.htm#en_us_publink100013112
PencilTable—Does Your Home or Business Show a Gain or a Loss
IF...SHOWS...THEN...
your "Home" worksheeta loss,follow the instructions at the end of line 7c, under How to Figure Your Gain or Loss Worksheet, earlier, for "If the number is negative."
your "Home" worksheeta gain,skip to How Much Is Taxable, later, to find out how much of the gain on your "Home" worksheet is taxable.
your "Business" worksheeta loss,do NOT follow the instructions at the end of line 7c, under How to Figure Your Gain or Loss Worksheet, earlier. Instead, report the loss from your "Business" worksheet on Form 4797, Sales of Business Property.
your "Business" worksheeta gain AND you did NOT meet the 2-year residence test for the business/rental part of your home,you cannot get tax benefits for any of the gain shown on your "Business" worksheet. Do NOT follow the instructions at the end of line 7c, under How to Figure Your Gain or Loss Worksheet, earlier. Instead, report the gain from your "Business" worksheet on Form 4797.
your "Business" worksheeta gain AND you DID meet the 2-year residence test for the business/rental part of your home,skip to How Much Is Taxable, later, to find out how much of the gain on your "Business" worksheet is taxable.
taxmap/pubs/p523-002.htm#en_us_publink100010750

Basis Adjustments—Details and Exceptions(p11)

rule
You should include many, but not all, costs associated with the purchase and maintenance of your home in the basis of your home. For more information on determining basis, see Publication 551, Basis of Assets.
taxmap/pubs/p523-002.htm#en_us_publink100010751

Fees and Closing Costs(p11)

rule
Some settlement fees and closing costs you can include in your basis are:
Some settlement fees and closing costs you cannot include in your basis are:
If you contracted to have your house built on land you own, your basis is:
Your cost includes your down payment and any debt such as a first or second mortgage or notes you gave the seller or builder. It also includes certain settlement or closing costs. You must reduce your basis by points the seller paid you.
If you built all or part of your house yourself, its basis is the total amount it cost you to complete it. Do not include in the cost of the house:
taxmap/pubs/p523-002.htm#en_us_publink100010753

Costs owed by the seller that you paid.(p12)

rule
You can include in your basis any amounts the seller owes that you agree to pay (as long as the seller does not reimburse you), such as:
taxmap/pubs/p523-002.htm#en_us_publink100010755

Improvements(p12)

rule
These add to the value of your home, prolong its useful life, or adapt it to new uses. You add the cost of additions and improvements to the basis of your property.
The following chart lists some examples of improvements.
taxmap/pubs/p523-002.htm#en_us_publink100025170
PencilExamples of Improvements That Increase Basis
Additions
Bedroom
Bathroom
Deck
Garage
Porch
Patio

Lawn & Grounds
Landscaping
Driveway
Walkway
Fence
Retaining wall
Swimming pool
Systems
Heating system
Central air conditioning
Furnace
Duct work
Central humidifier
Central vacuum
Air/water filtration systems
Water heater
Soft water system
Plumbing
Septic system
Wiring
Security system
Lawn sprinkler system


Exterior
Storm windows/doors
New roof
New siding
Satellite dish

Insulation
Attic
Walls
Floors
Pipes and duct work

Plumbing
Septic system
Water heater
Soft water system
Filtration system

Interior
Built-in appliances
Kitchen modernization
Flooring
Wall-to-wall carpeting
Fireplace
taxmap/pubs/p523-002.htm#en_us_publink100010757

Repairs done as part of larger project.(p12)

rule
You can include repair-type work if it is done as part of an extensive remodeling or restoration job. For example, replacing broken windowpanes is a repair, but replacing the same window as part of a project of replacing all the windows in your home counts as an improvement.
taxmap/pubs/p523-002.htm#en_us_publink100010759

Examples of improvements you CANNOT include in your basis.(p12)

rule
You cannot include:
taxmap/pubs/p523-002.htm#en_us_publink100025183
Exception.(p12)
The entire job is considered an improvement if items that would otherwise be considered repairs are done as part of an extensive remodeling or restoration of your home. For example, if you have a casualty and your home is damaged, increase your basis by the amount you spend on repairs that restore the property to its pre-casualty condition.
taxmap/pubs/p523-002.htm#en_us_publink100025178

Energy credits and subsidies.(p13)

rule
If you included in your basis the cost of any energy-related improvements (such as a solar energy system), and you received any tax credits or subsidies related to those improvements, you must subtract those credits or subsidies from your total basis. Examples include:
taxmap/pubs/p523-002.htm#en_us_publink100010760

Home Acquired Through a Trade(p13)

rule
taxmap/pubs/p523-002.htm#en_us_publink100010761

Traded for another home.(p13)

rule
When your home is traded for another home, it is treated like a sale of your home and a purchase of a new one. Your sale price is the trade-in value you received for your home plus any mortgage or other debt that the person taking your home as a trade-in assumed (took over) from you as part of the deal.
taxmap/pubs/p523-002.htm#en_us_publink100010762

Traded for other property.(p13)

rule
If you paid for your home by trading other property for it, the starting basis of your home is usually the fair market value of the property you traded.
taxmap/pubs/p523-002.htm#en_us_publink100010763

Home Foreclosed, Repossessed, or Abandoned(p13)

rule
You may have ordinary income, gain, or loss. See Publication 4681, Canceled Debts, Foreclosures, Repossessions, and Abandonments.
If you used part of your home for business or rental purposes, see "Foreclosures and Repossessions" in chapter 1 of Publication 544, for examples of how to figure gain or loss.
taxmap/pubs/p523-002.htm#en_us_publink100010764

Home Destroyed or Condemned—Sale Price and Basis(p13)

rule
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. If your home was destroyed, see Publication 547. If your home was condemned, see Publication 544.
taxmap/pubs/p523-002.htm#en_us_publink100010767

Home Received in Divorce(p13)

rule
taxmap/pubs/p523-002.htm#en_us_publink100010768

Home acquired after July 18, 1984.(p13)

rule
If your former spouse was the sole owner, your starting basis is the same as your former spouse's adjusted basis just before you received the home. If you co-owned the home with your spouse, add the adjusted basis of your spouse's half-share in the home to the adjusted basis of your own half-share to get your starting basis. (In most cases, the adjusted basis of the two half-shares will be the same.) The rules apply whether or not you gave your spouse anything in exchange for the home.
taxmap/pubs/p523-002.htm#en_us_publink100010769

Home acquired on or before July 18, 1984.(p13)

rule
Your starting basis will usually be the home's fair market value at the time you acquired it from your spouse or ex-spouse.
For more information, see Publication 504, Divorced or Separated Individuals. If you or your spouse or ex-spouse lived in a community property state, see Publication 555, Community Property.
taxmap/pubs/p523-002.htm#en_us_publink100010770

Home Received as Gift(p13)

rule
To determine your basis if you received your home as a gift, you will need to know most of the following:
In some cases, you will also need to know how much federal gift tax was paid when you received the home.
If the donor's adjusted basis was more than the home's value, use the donor's adjusted basis as your basis. However, if you find this results in a loss in line 7c, under How to Figure Your Gain or Loss Worksheet, earlier, you are treated as having neither a gain nor a loss.
If the donor's adjusted basis was less than or equal to the home's value, your basis will depend on when you received the home.
taxmap/pubs/p523-002.htm#en_us_publink100011669

Home received before 1977.(p13)

rule
Do the following calculations to find your basis:taxmap/pubs/p523-002.htm#en_us_publink100011908
Pencil
1.Enter value of the home at the time of the gift1.
2.Enter total federal gift tax paid2.
3.Enter donor's adjusted basis3.
4.Add line 2 and line 34.
5.Enter the SMALLER of line 1 or line 4. This is your basis5.
taxmap/pubs/p523-002.htm#en_us_publink100011670

Home received in 1977 or later.(p13)

rule
Do the following calculations to find your basis:taxmap/pubs/p523-002.htm#en_us_publink100011909
Pencil
1.Enter value of the home at the time of the gift1.
2.Enter donor's adjusted basis2.
3.Enter any annual exclusion and marital or charitable deduction applied to the gift3.
4.Federal gift tax paid on gift4.
5.Subtract line 2 from line 15.
6.Subtract line 3 from line 16.
7.Divide line 4 by line 57.
8.Multiply line 7 by line 48.
9.Add line 2 and line 8. This is your basis9.
taxmap/pubs/p523-002.htm#en_us_publink100011671

Home Inherited(p14)

rule
taxmap/pubs/p523-002.htm#en_us_publink100025194

Home acquired from a decedent who died before or after 2010.(p14)

rule
If you inherited your home from a decedent who died before or after 2010, your basis is the fair market value of the property on the date of the decedent's death (or the later alternate valuation date chosen by the personal representative of the estate). If an estate tax return was filed or required to be filed, the value of the property listed on the estate tax return is your basis. If a federal estate tax return did not have to be filed, your basis in the home is the same as its appraised value at the date of death, for purposes of state inheritance or transmission taxes.
taxmap/pubs/p523-002.htm#en_us_publink100025195
Surviving spouse.(p14)
If you are a surviving spouse and you owned your home jointly, your basis in the home will change. The new basis for the interest your spouse owned will be its fair market value on the date of death (or alternate valuation date). The basis in your interest will remain the same. Your new basis in the home is the total of these two amounts.
If you and your spouse owned the home either as tenants by the entirety or as joint tenants with right of survivorship, you will each be considered to have owned one-half of the home.
taxmap/pubs/p523-002.htm#en_us_publink100025196

Example.(p14)

Your jointly owned home (owned as joint tenants with right of survivorship) had an adjusted basis of $50,000 on the date of your spouse's death, and the fair market value on that date was $100,000. Your new basis in the home is $75,000 ($25,000 for one-half of the adjusted basis plus $50,000 for one-half of the fair market value).
taxmap/pubs/p523-002.htm#en_us_publink100025197
Community property.(p14)
In community property states (Arizona, California, Idaho, Louisiana, Nevada, New Mexico, Texas, Washington, and Wisconsin), each spouse is usually considered to own half of the community property. When either spouse dies, the total fair market value of the community property becomes the basis of the entire property, including the part belonging to the surviving spouse. For this to apply, at least half the value of the community property interest must be includible in the decedent's gross estate, whether or not the estate must file a return.
For more information about community property, see Publication 555, Community Property.
EIC
If you are selling a home in which you acquired an interest from a decedent who died in 2010, see Publication 4895, Tax Treatment of Property Acquired From a Decedent Dying in 2010, to determine your basis.