For the latest information about developments related to Pub. 523, such as legislation enacted after it was published, go to IRS.gov/Pub523.
Home energy tax credits. Home improvements that use clean energy, or otherwise add to energy efficiency, may qualify for home energy tax credits, which were extended, increased, and/or modified by the Inflation Reduction Act, P. L. 117-169, sections 13301 and 13302. These credits are detailed in Energy credits and subsidies . See sections 25C and 25D. For more information, see IRS News Release 2023-97, available at IRS.gov/newsroom/irs-going-green-could-help-taxpayers-qualify-for-expanded-home-energy-tax-credits.
Photographs of missing children. The IRS is a proud partner with the National Center for Missing & Exploited Children® (NCMEC). Photographs of missing children selected by the Center may appear in this publication on pages that would otherwise be blank. You can help bring these children home by looking at the photographs and calling 800-THE-LOST (800-843-5678) if you recognize a child.
Special rules for capital gains invested in Qualified Opportunity Funds. Effective December 22, 2017, section 1400Z-2 provides a temporary deferral of inclusion in gross income for capital gains invested in Qualified Opportunity Funds, and permanent exclusion of capital gains from the sale or exchange of an investment in the Qualified Opportunity Fund if the investment is held for at least 10 years. For more information, see the Instructions for Form 8949.
Extension of the exclusion of canceled or forgiven mortgage debt from income. The exclusion of income for mortgage debt canceled or forgiven was extended through December 31, 2025. The indebtedness discharged must generally be on a qualified principal residence, and based on an agreement in writing prior to January 1, 2026. See Report as ordinary income on Form 1040, 1040-SR, or 1040-NR applicable canceled or forgiven mortgage debt , later.
This publication explains the tax rules that apply when you sell or otherwise give up ownership of a home. If you meet certain conditions, you may exclude the first $250,000 of gain from the sale of your home from your income and avoid paying taxes on it. The exclusion is increased to $500,000 for a married couple filing jointly.
This publication also has worksheets for calculations relating to the sale of your home. It will show you how to:
Comments and suggestions.
We welcome your comments about this publication and suggestions for future editions.
You can send us comments through IRS.gov/FormComments. Or, you can write to the Internal Revenue Service, Tax Forms and Publications, 1111 Constitution Ave. NW, IR-6526, Washington, DC 20224.
Although we can’t respond individually to each comment received, we do appreciate your feedback and will consider your comments and suggestions as we revise our tax forms, instructions, and publications. Don’t send tax questions, tax returns, or payments to the above address.
Getting answers to your tax questions.
If you have a tax question not answered by this publication or the How To Get Tax Help section at the end of this publication, go to the IRS Interactive Tax Assistant page at IRS.gov/Help/ITA where you can find topics by using the search feature or viewing the categories listed.
Getting tax forms, instructions, and publications.
Go to IRS.gov/Forms to download current and prior-year forms, instructions, and publications.
Ordering tax forms, instructions, and publications.
Go to IRS.gov/OrderForms to order current forms, instructions, and publications; call 800-829-3676 to order prior-year forms and instructions. The IRS will process your order for forms and publications as soon as possible. Don’t resubmit requests you’ve already sent us. You can get forms and publications faster online.
Publication
Form (and Instructions)
The tax code recognizes the importance of home ownership by allowing you to exclude gain when you sell your main home. To qualify for the maximum exclusion of gain ($250,000 or $500,000 if married filing jointly), you must meet the Eligibility Test , explained later. To qualify for a partial exclusion of gain, meaning an exclusion of gain less than the full amount, you must meet one of the situations listed in Does Your Home Qualify for a Partial Exclusion of Gain , later.
Before considering the Eligibility Test or whether your home qualifies for a partial exclusion, you should consider some preliminary items.
Transfer of your home to a spouse or an ex-spouse.
Generally, if you transferred your home (or share of a jointly owned home) to a spouse or ex-spouse as part of a divorce settlement, you are considered to have no gain or loss. You have nothing to report from the transfer and this entire publication doesn’t apply to you. However, if your spouse or ex-spouse is a nonresident alien, then you likely will have a gain or loss from the transfer and the tests in this publication apply.
Home’s date of sale.
To determine if you meet the Eligibility Test or qualify for a partial exclusion, you will need to know the home's date of sale, meaning when you sold it. If you received Form 1099-S, Proceeds From Real Estate Transactions, the date of sale appears in box 1. If you didn’t receive Form 1099-S, the date of sale is either the date the title transferred or the date the economic burdens and benefits of ownership shifted to the buyer, whichever date is earlier. In most cases, these dates are the same.
Sale of your main home.
You may take the exclusion, whether maximum or partial, only on the sale of a home that is your principal residence, meaning your main home. An individual has only one main home at a time. If you own and live in just one home, then that property is your main home. If you own or live in more than one home, then you must apply a "facts and circumstances" test to determine which property is your main home. While the most important factor is where you spend the most time, other factors are relevant as well. They are listed below. The more of these factors that are true of a home, the more likely that it is your main home.
Finally, the exclusion can apply to many different types of housing facilities. A single-family home, a condominium, a cooperative apartment, a mobile home, and a houseboat each may be a main home and therefore qualify for the exclusion.
The Eligibility Test determines whether you are eligible for the maximum exclusion of gain ($250,000 or $500,000 if married filing jointly).
Determine whether any of the automatic disqualifications apply.
Your home sale isn’t eligible for the exclusion if ANY of the following are true.
If any of these conditions are true, the exclusion doesn’t apply. Skip to Figuring Gain or Loss , later.
Determine whether you meet the ownership requirement.
If you owned the home for at least 24 months (2 years) out of the last 5 years leading up to the date of sale (date of the closing), you meet the ownership requirement. For a married couple filing jointly, only one spouse has to meet the ownership requirement.
Determine whether you meet the residence requirement.
If you owned the home and used it as your residence for at least 24 months of the previous 5 years, you meet the residence requirement. The 24 months of residence can fall anywhere within the 5-year period, and it doesn't have to be a single block of time. All that is required is a total of 24 months (730 days) of residence during the 5-year period. Unlike the ownership requirement, each spouse must meet the residence requirement individually for a married couple filing jointly to get the full exclusion.
If you were ever away from home,
you need to determine whether that time counts toward your residence requirement. A vacation or other short absence counts as time you lived at home (even if you rented out your home while you were gone).
If you become physically or mentally unable to care for yourself,
and you use the residence as your main home for at least 12 months in the 5 years preceding the sale or exchange, any time you spent living in a care facility (such as a nursing home) counts toward your 2-year residence requirement, so long as the facility has a license from a state or other political entity to care for people with your condition.
Determine whether you meet the look-back requirement.
If you didn't sell another home during the 2-year period before the date of sale (or, if you did sell another home during this period, but didn't take an exclusion of the gain earned from it), you meet the look-back requirement. You may take the exclusion only once during a 2-year period.
There are some exceptions to the Eligibility Test. If any of the following situations apply to you, read on to see if they may affect your qualification. If none of these situations apply, skip to Step 6.
Separated or divorced taxpayers.
If you were separated or divorced prior to the sale of the home, you can treat the home as your residence if:
If your home was transferred to you by a spouse or ex-spouse (whether in connection with a divorce or not), you can count any time when your spouse owned the home as time when you owned it. However, you must meet the residence requirement on your own. If you owned your home prior to your marriage and after your divorce or separation, and your spouse or former spouse is not allowed to live in the home under a divorce or separation agreement, you count any time that you owned the home solely or jointly with your spouse as time when you owned it, and you must meet the residence requirement on your own.
Surviving spouses.
If you are a surviving spouse who doesn't meet the 2-year ownership and residence requirements on your own, consider the following rule. If you haven’t remarried at the time of the sale, then you may include any time when your late spouse owned and lived in the home, even if without you, to meet the ownership and residence requirements.
Also, you may be able to increase your exclusion amount from $250,000 to $500,000. You may take the higher exclusion if you meet all of the following conditions.
Service, Intelligence, and Peace Corps personnel.
If you or your spouse are a member of the Uniformed Services or the Foreign Service, an employee of the intelligence community of the United States, or an employee, enrolled volunteer or volunteer leader of the Peace Corps, you may choose to suspend the 5-year test period for ownership and residence when you’re on qualified official extended duty. This means you may be able to meet the 2-year residence test even if, because of your service, you didn’t actually live in your home for at least the 2 years during the 5-year period ending on the date of sale. Make the election by filing your tax return for the year of the sale or exchange of your main home, and exclude the gain from your taxable income.
Qualified extended duty.
You are on qualified extended duty if:
Period of suspension.
The period of suspension can’t last more than 10 years. Together, the 10-year suspension period and the 5-year test period can be as long as, but no more than, 15 years. You can’t suspend the 5-year period for more than one property at a time. You can revoke your choice to suspend the 5-year period at any time.
Example 1.
You bought a home on May 1, 2007. You used it as your main home until August 27, 2010. On August 28, 2010, you went on qualified official extended duty with the Navy. You didn’t live in the house again before selling it on August 1, 2023. You choose to use the entire 10-year suspension period. Therefore, the suspension period would extend back from August 1, 2023, to August 2, 2013, and the 5-year test period would extend back to August 2, 2008. During that period, you owned the house all 5 years and lived in it as your main home from August 2, 2008, until August 28, 2010, a period of more than 24 months. You meet the ownership and use tests because you owned and lived in the home for at least 2 years during this test period.
Example 2.
You bought and moved into a home in 2014. You lived in it as your main home for 3½ years. For the next 6 years, you didn’t live in it because you were on qualified official extended duty with the Army. You then sold the home at a gain in 2023. To meet the use test, you choose to suspend the 5-year test period for the 6 years you were on qualified official extended duty. This means you can disregard those 6 years. Therefore, your 5-year test period consists of the 5 years before you went on qualified official extended duty. You meet the ownership and use tests because you owned and lived in the home for 3½ years during this test period.
Vacant land next to home.
You can include the sale of vacant land adjacent to the land on which your home sits as part of a sale of your home if ALL of the following are true.
Also, if your sale of vacant land meets all these requirements, you must treat that sale and the sale of your home as a single transaction for tax purposes, meaning that you may apply the exclusion only once.
However, if you move your home from the land on which it stood (meaning you relocate the actual physical structure), then that land no longer counts as part of your home. For example, if you move a mobile home to a new lot and sell the old lot, then you can’t treat the sale of the old lot as the sale of your home.
Home destroyed or condemned—considerations for benefits.
If an earlier home of yours was destroyed or condemned, you may be able to count your time there toward the ownership and residence test.
If your home was destroyed, see Pub. 547, Casualties, Disasters, or Thefts. If your home was condemned, see Pub. 544, Sales and Other Disposition of Assets.
Remainder interest.
The sale of a remainder interest in your home is eligible for the exclusion only if both of the following conditions are met.
Like-kind/1031 exchange.
If you sold a home that you acquired in a like-kind exchange, then the following test applies.
You can’t claim the exclusion if:
A main home is not available for exchange because the exchange must be between like-kind real property held for productive use in a trade or business or for investment. Also, real property held primarily for sale is not eligible for deferral of gain under section 1031. For an exchange of rental property that was later converted to personal use as a main home, there is a 5-year holding period required under section 121(d)(10). A separate 2-year holding period is required for exchanges between related persons under section 1031(f). See Pub. 544.
If you convert your main home to a rental property (or use a portion of the living area for productive use in a trade or business as in Rev. Proc. 2005-14, examples 3–6), the exchange rules under section 1031 and exclusion of income rules under section 121 may both apply.
If the requirements of both sections 1031 and 121 are met, the section 121 exclusion is applied first to realized gain; section 1031 then applies, including any gain attributable to depreciation deductions. Any cash received in exchange for the rental property is taken into account only to the extent the cash exceeds the section 121 excluded gain on the rental property given up in the exchange. The period before the exchange that is after the last date the property was used as a main home is not considered nonqualified use for purposes of the proration rules of section 121. To figure basis of the property received in the exchange (replacement property), any gain excluded under section 121 is added to your basis of your replacement property, similar to the treatment of recognized gain. You can’t convert the replacement property to a main home immediately after the exchange per section 1031(a)(1), which requires that replacement property be held either for investment, or for productive use in a trade or business. For more information about like-kind exchanges, see Pub. 544.
For additional information about the intersection of sections 121 and 1031, see Rev. Proc. 2005-14, 2005-7 I.R.B. 528, available at IRS.gov/irb/2005-07_IRB#RP-2005-14. Please note, however, that any period after 2008 during which the property is not used as a principal residence is, with certain exceptions, considered nonqualified use of that property for which gain allocable to such period may not be excluded, in accordance with section 121(b)(5). This includes property that is separate from the main property and not a part of the living area of the main home that is not used as a principal residence for a period after 2008. See section 121(b)(5)(C). See also Rev. Proc. 2005-14 for examples that illustrate how to allocate basis and gain realized in an exchange that is also eligible for section 121 exclusion, as well as details of depreciation recapture.
If you meet the ownership, residence, and look-back requirements, taking the exceptions into account, then you meet the Eligibility Test. Your home sale qualifies for the maximum exclusion. Skip to Worksheet 1, later.
If you didn’t meet the Eligibility Test, then your home isn’t eligible for the maximum exclusion, but you should continue to Does Your Home Qualify for a Partial Exclusion of Gain .
If you don't meet the Eligibility Test, you may still qualify for a partial exclusion of gain. You can meet the requirements for a partial exclusion if the main reason for your home sale was a change in workplace location, a health issue, or an unforeseeable event.
You meet the requirements for a partial exclusion if any of the following events occurred during your time of ownership and residence in the home.
You meet the requirements for a partial exclusion if any of the following health-related events occurred during your time of ownership and residence in the home.
You meet the standard requirements if any of the following events occurred during the time you owned and lived in the home you sold.
Even if your situation doesn’t match any of the standard requirements described above, you still may qualify for an exception. You may qualify if you can demonstrate the primary reason for sale, based on facts and circumstances, is work related, health related, or unforeseeable. Important factors are:
Use this worksheet only if no automatic disqualifications apply, and take all exceptions into account.
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 |
A positive number indicates a gain; a negative number indicates a loss.
Certain events during your ownership, such as use of your home for business purposes or your making improvements to it, can affect your gain or loss. They are explained in this section.
See Worksheet 2, later, for steps you should follow to figure your gain or loss.
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 Pub. 551, Basis of Assets.
Some settlement fees and closing costs you can include in your basis are:
Settlement costs don’t include amounts placed in escrow for the future payment of items such as taxes and insurance.
Some settlement fees and closing costs you can’t include in your basis are:
Construction.
If you contracted to have your house built on the 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. In addition, you must generally 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. Don’t include in the cost of the house:
Costs owed by the seller that you paid.
You can include in your basis any amounts the seller owes that you agree to pay (as long as the seller doesn’t reimburse you), such as:
Improvements 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.
Exterior
Storm windows/doors
New roof
New siding
Satellite dish
Repairs done as part of larger project.
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.
Examples of improvements you CAN’T include in your basis.
You can’t include:
Exception.
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. However, you must adjust your basis by any amount of insurance reimbursement you receive or expect to receive for casualty losses. See Worksheet 2, line 5.
Energy credits and subsidies.
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:
Traded for another home.
When you trade your home for a new one, you are treated as having sold your home and purchased 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.
Traded for other property.
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.
If your home was foreclosed on, repossessed, or abandoned, you may have ordinary income, gain, or loss. See Pub. 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 Pub. 544, for examples of how to figure gain or loss.
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 that you have. If your home was destroyed, see Pub. 547. If your home was condemned, see Pub. 544.
Home acquired after July 18, 1984.
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 received anything in exchange for the home.
Home acquired on or before July 18, 1984.
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 Pub. 504, Divorced or Separated Individuals. If you or your spouse or ex-spouse lived in a community property state, see Pub. 555, Community Property.
If you received your home as a gift, you should keep records of the date you received it. Record the adjusted basis of the donor at the time of the gift and the fair market value of the home at the time of the gift. Also ask if the donor paid any gift tax. As a general rule, you will use the donor’s adjusted basis at the time of the gift as your basis. However, see Table 1 below to determine if any exceptions to this rule listed in the “IF” column apply.
Table 1. Exceptions to Using a Donor's Adjusted Basis for a Home Received as a Gift
IF. | AND. | THEN. |
at the time of the gift, the donor’s adjusted basis in the home was more than the home’s fair market value, | your usage of the donor’s adjusted basis as your basis results in a loss, | you must use the fair market value of the home at the time of the gift as your basis (if using the fair market value results in a gain for you, then you don’t need to recognize that gain). |
at the time of the gift, the donor’s adjusted basis in the home was less than the home’s fair market value, | the donor paid gift tax on the gift of the home, | you figure your basis by starting with the donor’s adjusted basis at the time of the gift and adding the federal gift tax paid due to the increase in value of the home (see Regulations section 1.1015-5 for further details on this calculation). |
Home acquired from a decedent who died before or after 2010.
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 a federal estate tax return (Form 706) was filed or required to be filed, the value of the property listed on the estate tax return is your basis. If Form 706 didn’t 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. See section 1014 for details.
Surviving spouse.
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.
Example.
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).
Community property.
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 rule 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 Pub. 555, Community Property.
. If you are selling a home in which you acquired an interest from a decedent who died in 2010, see Pub. 4895, Tax Treatment of Property Acquired From a Decedent Dying in 2010, available at IRS.gov/pub/irs-prior/p4895--2011.pdf, to determine your basis. .
Calculation.
If you use property partly as a home and partly for business or to produce rental income, the treatment of any gain on the sale depends partly on whether the business or rental part of the property is part of your home or separate from it. Treatment of any gain also depends on the use during the 5 years leading up to the sale. To figure the portion of the gain allocated to the period of nonresidential use, see Business or rental usage calculations , later. See also Worksheet 2.
Space within the living area.
If the part of your property used for business or to produce rental income is within your home, such as a room used as a home office for a business, you do not need to allocate gain on the sale of the property between the business part of the property and the part used as a home. In addition, you do not need to report the sale of the business or rental part on Form 4797. This is true whether or not you were entitled to claim any depreciation. However, you cannot exclude the part of any gain equal to any depreciation allowed or allowable after May 6, 1997, which must be recaptured and reported as ordinary income under section 1250(b)(3). Other examples of space within the living area include a rented spare bedroom and attic space used as a home office.
Space separate from the living area.
You generally can’t exclude gain on the separate portion of your property used for business or to produce rental income. Regulations section 1.121-1(e) provides that the use of a separate portion of your home for business or rental purposes does not qualify for exclusion under section 121, and this may affect your gain or loss calculations. See Regulations section 1.121-1(e). Examples are:
You can’t exclude gain on the separate part of your property used for business or to produce rental income unless you owned and lived in that part of your property for at least 2 years during the 5-year period ending on the date of the sale. If you do not meet the use test for the separate business or rental part of the property, an allocation of the gain on the sale is required. For this purpose, you must allocate the basis of the property and the amount realized between the residential and nonresidential portions of the property using the same method of allocation that you used to determine depreciation adjustments. Report the sale of the business or rental part on Form 4797. Note that space formerly used as business or rental will qualify for exclusion under section 121 if the use was converted to personal use for a total of 2 years, as long as the personal use was within the 5 years leading up to the sale. See Regulations section 1.121-1(a).
Business or rental usage calculations.
If you use property partly as a home and partly for business or to produce rental income, and the business or rental portion is not within the home’s living area, you need to make separate gain/loss calculations for the business and residence portions of your property. Make three copies of all pages of Worksheet 2. Label one copy “Total,” one copy “Home,” and one copy “Business or Rental.”
Complete your “Total” worksheet using the figures for your property as a whole. 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.
Determine your “business or rental percentage,” meaning the percentage of your property that you used for business or rental. If you were entitled to take depreciation deductions because you used a portion of your home for business purposes or as rental property, you can’t exclude the part of your gain equal to any depreciation allowed or allowable as a deduction for periods after May 6, 1997.
If you used part of your home for business or rental after May 6, 1997, you may need to pay back (“recapture”) some or all of the depreciation you were entitled to take on your property. “Recapturing” depreciation means you must include it as ordinary income on your tax return. If you took depreciation on your home on past tax returns, use the same business or rental percentage that you used in determining how much depreciation to take. If you didn’t take depreciation on your home 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 three equal-sized stories, and you live in the top two stories and use the ground floor for a store, then you are using 1 /3 of the property and your business percentage is 33.3%.
For each number on your “Total” worksheet, figure the business-related portion of that number and enter it on your “Business or Rental” worksheet. 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.
The total you get on line 7 on your “Business” copy of Worksheet 2 is the gain or loss related to the business or rental portion of the property you sold.
Next, complete your “Home” worksheet. 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 (for example, subtract the number on line 1f of the "Business or Rental" worksheet from the number on line 1f of your "Total" worksheet), and enter the result on your "Home" worksheet.
Now figure the totals on your “Home” worksheet. The total you get on line 7 on the “Home” copy of Worksheet 2 is the gain or loss related to the home portion of the property you sold.
Review the results of your “Home” and “Business” worksheets to determine your next step. 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. For more information about using any part of your home for business or as a rental property, see Pub. 587, Business Use of Your Home, and Pub. 527, Residential Rental Property.
. For detailed information about figuring and reporting depreciation associated with the business or rental use of your home, see Pub. 527. .
Complete Worksheet 2. Then see Table 2 to determine your next steps.
Example.
The following example demonstrates separate calculations for business and residential uses.
Stacey owns property that consists of a house, a stable and 35 acres. Stacey uses the stable and 28 acres for non-residential purposes for more than 3 years during the 5-year period preceding the sale. Stacey uses the entire house and the remaining 7 acres as a principal residence for at least 2 years during the 5-year period preceding the sale. For periods after May 6, 1997, Stacey claims depreciation deductions of $9,000 for the non-residential use of the stable. Stacey sells the entire property in 2014, realizing a gain of $24,000. Stacey has no other section 1231 or capital gains or losses for 2014.
Because the stable and the 28 acres used in the business are separate from the dwelling unit, the allocation rules apply and Stacey must allocate the basis and amount realized between the portion of the property used as a principal residence and the portion used for non-residential purposes based on their respective FMVs. Stacey creates three copies of Worksheet 2 and titles them “Business or Rental,”“Home,” and “Total” to allocate basis and the amount realized for the different uses of the property.
Stacey determines that $14,000 of the gain is allocable to the non-residential-use portion of the property by completing the copy of Worksheet 2 entitled “Business or Rental.” Stacey determines that $10,000 of the gain is allocable to the portion of the property used as a residence by completing the copy of Worksheet 2 entitled “Home.” Stacey must recognize the $14,000 of gain allocable to the non-residential-use portion of the property ($9,000 of which is unrecaptured section 1250 gain, and $5,000 of which is adjusted net capital gain). Stacey reports gain associated with the non-residential-use portion of the property on Form 4797. Stacey may have to complete Form 8949 and Schedule D (Form 1040). See the Instructions for Form 4797, Form 8949, and Schedule D (Form 1040).
Stacey transfers the gain from the “Home” worksheet to Worksheet 3, reviews the maximum amount available for exclusion as figured on Worksheet 1, and determines that the $10,000 gain from the residence portion is less than the maximum amount available for exclusion from Worksheet 1. The $10,000 gain on the property may be excluded.
Worksheet 2 is used to figure the adjusted basis of your home and your gain or (loss). You will figure your taxable gain (if any), on Worksheet 3, later.
DO NOT use this worksheet to determine your basis if you acquired an interest in your home from a decedent who died in 2010 and whose executor filed Form 8939. See Home acquired from a decedent who died before or after 2010 .
IF. | THEN. |
your “Home” worksheet shows a loss, | follow the instructions at the end of line 7, under Worksheet 2 for “If the number is negative.” |
your “Home” worksheet shows a gain, | see How Much Is Taxable? and Worksheet 3 to find out how much of the gain on your “Home” worksheet is taxable. |
your “Business” worksheet shows a loss, | DON’T follow the instructions at the end of line 7, under Worksheet 2. Instead, report the loss from your “Business” worksheet on Form 4797, Sales of Business Property. Note . Your loss may be limited. See the Instructions for Form 4797. |
your “Business” worksheet shows a gain, | you can’t exclude any of the gain shown on your “Business” worksheet. DON’T follow the instructions at the end of line 7, under Worksheet 2. Instead, report the gain from your “Business” worksheet on Form 4797. |
Nonqualified use of entire property after 2008.
If you fail to meet the requirements to qualify for the $250,000 or $500,000 exclusion, you may still qualify for a reduced exclusion. If you fail to meet the ownership and use tests, or if you used a portion of your home for business or rental purposes during your ownership, this type of usage may affect your gain or loss calculations.
Gain from the sale or exchange of your main home isn’t excludable from income if it is allocable to periods of nonqualified use. Nonqualified use means any period after 2008 where neither you nor your spouse (or your former spouse) used the property as your main home, with certain exceptions.
Exceptions.
A period of nonqualified use does not include:
a. As a member of the uniformed services; |
b. As a member of the Foreign Service of the United States; or |
c. As an employee of the intelligence community; and |
Calculation. To figure the portion of the gain allocated to the period of nonqualified use, see Worksheet 3. For more information about using any part of your home for business or as a rental property, see Pub. 587, Business Use of Your Home, and Pub. 527, Residential Rental Property.
Review of the Eligibility Test.
Generally, your home sale qualifies for the maximum exclusion, if all of the following conditions are true.
*If this condition isn’t met, your home sale may qualify for a partial exclusion. The sale must involve one of the following events experienced by you, your spouse, a co-owner, or anyone else for whom the home was her or his residence: a work-related move, a health-related move, a death, a divorce, a pregnancy with multiple children, a change in employment status, a change in unemployment compensation eligibility, or other unusual event.
**The transfer of vacant land or of a remainder interest may qualify for the maximum exclusion, but special rules apply in those situations.
For a step-by-step guide to determining whether your home sale qualifies for the maximum exclusion, see Does Your Home Sale Qualify for the Exclusion of Gain? above.
If you qualify for an exclusion on your home sale, up to $250,000 ($500,000 if married and filing jointly) of your gain will be tax free. If your gain is more than that amount, or if you qualify only for a partial exclusion, then some of your gain may be taxable. This section contains step-by-step instructions for figuring out how much of your gain is taxable. See Worksheet 3, later, for assistance in determining your taxable gain.
If you determined in Does Your Home Sale Qualify for the Exclusion of Gain , earlier, that your home sale doesn't qualify for any exclusion (either full or partial), then your entire gain is taxable. If you don’t have a gain, you owe no tax on the sale. In either case, you don’t need to complete Worksheet 3 and you can skip to Reporting Your Home Sale , later.
If you were entitled to take depreciation deductions because you used your home for business purposes or as rental property, you cannot exclude the part of your gain equal to any depreciation allowed or allowable as a deduction for periods after May 6, 1997. If you used all of your home for business or rental after May 6, 1997, you may need to pay back (“recapture”) some or all of the depreciation you were entitled to take on your property. “Recapturing” depreciation means you must include it as ordinary income on your tax return.
Example.
Cartier owned and used a house as a main home from 2015 through 2018. On January 1, 2019, Cartier moved to another state. Cartier rented the home from that date until April 30, 2021, when Cartier sold it. During the 5-year period ending on the date of sale (May 1, 2016–April 30, 2021), Cartier owned and lived in the house for more than 2 years. Because the period of nonqualified use does not include any part of the 5-year period after the last date Cartier lived in the home, there is no period of nonqualified use. Because Cartier met the ownership and use tests, Cartier can exclude gain up to $250,000. However, Cartier can’t exclude the part of the gain equal to the depreciation Cartier claimed, or could have claimed, for renting the house.
Worksheet 3 is used to help you figure taxable gain on the sale or exchange of your home (if any), and how to report it.
. If you completed “Business” and “Home” versions of your gain/loss worksheet as described in Property Used Partly for Business or Rental, earlier, complete Worksheet 3 only for the “Home” version. .
If you completed “Business” and “Home” versions of your gain/loss worksheet as described in Property Used Partly for Business or Rental , earlier, complete this worksheet only for the “Home” version.
Section A. Determine your net gain. Complete this section only if you used any part of your home for business or rental purposes between May 6, 1997, and the date of sale. Otherwise, skip to Section B. | ||||||
Step 1 | Enter your gain from line 7 of Worksheet 2 | _____ | ||||
Step 2 | List the total of all depreciation deductions that you took or could have taken for the use of your home for business or rental purposes between May 7, 1997, and the date of sale | _____ | ||||
Step 3 | Subtract the sum of Step 2 from the amount listed in Section A, Step 1. This is your net gain | _____ | ||||
Section B. Determine your nonqualified use gain. Complete this section only if the following apply: a) During the time you owned the property there were periods of nonqualified use when neither you nor your spouse (or your former spouse) used the entire property as your main home; b) the periods of nonqualified use occurred after 2008; c) the periods of nonqualified use occurred before the last day the entire property was used as your or your spouse’s (or your former spouse) main home prior to the date of sale. Do not include any period of nonqualified use that occurred after the last day that you or your spouse (or former spouse) used the entire property as your main home during the 5-year period prior to the date of sale.* Otherwise, skip to Section C. | ||||||
*Note . If the period of non-use was 1) for an aggregate of 2 years or less and due to a change in employment, a health condition, or other "unforeseen circumstance" described in Does Your Home Qualify for a Partial Exclusion of Gain , earlier; or 2) for 10 years or less and due to a "stop the clock" exception for certain military, intelligence, and Peace Corps personnel described in Service, Intelligence, and Peace Corps Personnel , earlier, then you may skip Section B. | ||||||
Step 1 | Enter the amount from Section A, Step 1 or, if you skipped Section A, your gain from line 7 of Worksheet 2 | _____ | ||||
Step 2 | Enter the total number of days after 2008 and before the date of sale that neither you nor your spouse (or former spouse) used the entire home as a main residence. Do not include any days that occurred after the last day that you or your spouse (or former spouse) used the entire property as your main home during the 5-year period prior to the date of sale. This number is your non-use days | _____ | ||||
Step 3 | Enter the total number of days you owned your home (counting all days, not just days after 2008). This number is your number of days owned | _____ | ||||
Step 4 | Divide the non-use days by the days owned. This number is your non-residence factor | _____ | ||||
Step 5 | Multiply the decimal from Section B, Step 4, by the amount listed in Section B, Step 1. This number is your nonqualified use gain | _____ | ||||
Section C. Determine your gain that is eligible for exclusion. | ||||||
IF. | THEN your gain that is eligible for exclusion is … | |||||
you skipped Sections A and B | your gain from line 7, under Worksheet 2. | |||||
you completed Section A but skipped Section B | your net gain, from Section A, Step 3. | |||||
you completed Section B (regardless of whether you completed Section A) | your gain from line 7, under Worksheet 2 less your nonqualified use gain, from Section B, Step 5. | |||||
Your gain that is eligible for exclusion is $ _______________ | ||||||
Section D. Determine if you have taxable gain. | ||||||
IF. | THEN … | |||||
your gain that is eligible for exclusion from Section C is less than or equal to your exclusion limit from Worksheet 1, Section C | your gain that is eligible for exclusion from your income is not to be reported on your tax return. The Reporting Your Home Sale section only applies to your nonqualified use gain. | |||||
your gain that is eligible for exclusion from Section C is greater than your exclusion limit from Worksheet 1, Section C | some of your gain isn’t excludable, and you may owe tax on it. See Reporting Your Home Sale for instructions on how to report the gain on your tax return. |
This section tells you how to report taxable gain, take deductions relating to your home sale, and report income other than the gain that you may have received from your home sale.
This section also covers special circumstances that apply to some home sellers.
. What records to keep. Any time you buy real estate, you should keep records to document the property's adjusted basis. In general, keep these records until 3 years after the due date for your tax return for the year in which you sold your home. .
Determine whether you need to report the gain from your home.
You need to report the gain if ANY of the following is true.
If NONE of the three bullets above is true, you don’t need to report your home sale on your tax return. If you didn’t make separate home and business calculations on your property, skip to Reporting Deductions Related to Your Home Sale , later.
If ANY of the three bullets above is true, skip to Determine whether your home sale is an installment sale , later.
If you made separate gain/loss calculations for business and residence portions of your property,
you may have to use Form 4797 to report the sale of the business or rental part. See Property Used Partly for Business or Rental , earlier.
Determine whether your home sale is an installment sale.
If you finance the buyer's purchase of your home (you hold a note, mortgage, or other financial agreement), you probably have an installment sale. You may be able to report any non-excludable gain on an installment basis. Use Form 6252, Installment Sale Income, to report the sale.
For more information, see Pub. 537, Installment Sales.
Report any interest you receive from the buyer.
If the buyer is making payments to you over time (as when you provide seller financing), then you must generally report part of each payment as interest on your tax return. Report the interest portion of the payment as ordinary income on Form 1040 or 1040-SR, line 2b, or Schedule NEC (Form 1040-NR) if a nonresident alien. If the buyer is using the property as a first or second home, also report the interest on Schedule B (Form 1040), Interest and Ordinary Dividends, and provide the buyer's name, address, and social security number. If you don’t show the buyer’s name, address, and SSN you may have to pay a $50 penalty.
If you’re a nonresident or resident alien who doesn’t have and isn’t eligible to get a social security number,
you may be issued an individual taxpayer identification number (ITIN). If you don’t have an ITIN, apply for one by filing Form W-7, Application for IRS Individual Taxpayer Identification Number. If needed, a nonresident or resident alien buyer can apply for an ITIN as well.
Complete Form 8949, Sales and Other Dispositions of Capital Assets.
Use Form 8949 to report gain from the sale or disposition of the personal-use portion of your home if you can’t exclude the gain. If you received Form 1099-S, report the transaction on Form 8949. See the Instructions for Form 8949.
. If you have gain that can’t be excluded, you must generally report it on Form 8949, Sales and Other Dispositions of Capital Assets, and Schedule D (Form 1040), Capital Gains and Losses. Report the sale on Part I or Part II of Form 8949 as a short-term or long-term transaction, depending on how long you owned the home. In addition, you may be able to temporarily defer capital gains invested in a Qualified Opportunity Fund (QOF). You may also be able to permanently exclude capital gains from the sale or exchange of an investment in a QOF if the investment is held for at least 10 years. For more information, see the Instructions for Form 8949. .
Complete Schedule D (Form 1040), Capital Gains and Losses.
Using the information on Form 8949, report on Schedule D (Form 1040) the gain or loss on your home as a capital gain or loss. Follow the instructions for Schedule D when completing the form.
If you have any taxable gain from the sale of your home, you may have to increase your withholding or make estimated tax payments. See Pub. 505, Tax Withholding and Estimated Tax.
If you aren’t itemizing deductions on your return for the year in which you sold your home, skip to Reporting Other Income Related to Your Home Sale , later.
There is no tax deduction for transfer taxes, stamp taxes, or other taxes, fees, and charges you paid when you sold your home. However, if you paid these amounts as the seller, you can treat these taxes and fees as selling expenses. If you pay these amounts as the buyer, include them in your cost basis of the property.
Determine the amount of real estate tax deductions associated with your home sale.
Depending on your circumstances, you may need to figure your real estate tax deductions differently. See the discussion that follows for more information.
If you didn’t receive a Form 1099-S,
use the following method to compute your real estate tax deduction, which may be different from the amount of real estate tax you actually paid.
Example.
The real estate tax on Jackie and Pat White's home was $620 for the year. Their real property tax year was the calendar year, with payment due August 3, 2023. They sold the home on May 6, 2023. Jackie and Pat are considered to have paid a proportionate share of the real estate taxes on the home even though they didn’t actually pay them to the taxing authority.
Jackie and Pat owned their home during the 2023 real property tax year for 125 days (January 1 to May 5, the day before the sale). They figure their deduction for taxes as follows.
1. | Total real estate taxes for the real property tax year | $620 |
2. | Number of days in the real property tax year that you owned the property | 125 |
3. | Divide line 2 by 365 (366 if leap year) | 0.342 |
4. | Multiply line 1 by line 3. This is your deduction. Enter it on line 5b of Schedule A (Form 1040) | $212 |
Since the buyers paid all of the taxes, Jackie and Pat also include the $212 in the home's selling price. The buyers add the $212 to their basis in the home. The buyers can deduct $408 ($620 – $212) as an itemized deduction, the taxes for the part of the year they owned the home.
If you received a Form 1099-S,
start with the amount of real estate tax you actually paid in the year of sale. Subtract the buyer's share of real estate tax as shown in box 6. The result is the amount you can use in figuring your itemized deductions.
If you didn’t already deduct all your mortgage points on an earlier tax return,
you may be able to deduct them on your tax return for the year of sale. See Pub. 936, Home Mortgage Interest Deduction.
Report on Schedule A (Form 1040), Itemized Deductions, any itemized real estate deduction.
Follow the Instructions for Schedule A when completing the form.
Report as ordinary income on Form 1040, 1040-SR, or 1040-NR any amounts received from selling personal property.
If you sold furniture, drapes, lawn equipment, a washer/dryer, or other property that wasn’t a permanent part of your home, report the amount you received for the items as ordinary income. Report this amount on Schedule 1 (Form 1040), line 8z, or Schedule NEC (Form 1040-NR) if a nonresident alien. The selling price of your home doesn’t include amounts you received for personal property sold with your home.
Report as ordinary income on Form 1040, 1040-SR, or 1040-NR any amounts received for sales of expired options to purchase your property.
If you granted someone an option to buy your home and it expired in the year of sale, report the amount you received for the option as ordinary income. Report this amount on Schedule 1 (Form 1040), line 8z, or Schedule NEC (Form 1040-NR) if a nonresident alien.
Report as ordinary income on Form 1040, 1040-SR, or 1040-NR applicable canceled or forgiven mortgage debt.
If you went through a mortgage workout, foreclosure, or other process in which a lender forgave or canceled mortgage debt on your home, then you must generally report the amount of forgiven or canceled debt as income on your tax return. However, if you had a written agreement for the forgiveness of the debt in place before January 1, 2026, then you might be able to exclude the forgiven amount from your income. For more information, see Pub. 4681, Canceled Debts, Foreclosures, Repossessions, and Abandonments.
If you received any homebuyer credits or federal mortgage subsidies, you may have to pay back (“recapture”) some or all of the amount by increasing your tax payment.
Determine any amounts you may have claimed as a first-time homebuyer tax credit.
If you bought your home in 2008, you must pay back the credit unless you qualify for an exception.
See Form 5405, Repayment of the First-Time Homebuyer Credit, to find out how much to pay back, or if you qualify for any exceptions. If you do have to repay the credit, file Form 5405 with your tax return.
Determine any amounts you may have received in federal mortgage subsidies in the 9 years leading up to the date of sale.
If you financed your home under a federally subsidized program (loans from tax-exempt qualified mortgage bonds or loans with mortgage credit certificates), you may have to recapture all or part of the benefit you received from that program upon the sale or other transfer of ownership of your home. You recapture the benefit by increasing your federal income tax for the year of the sale. You may have to pay this recapture tax even if you can exclude your gain from income under the rules discussed earlier; that exclusion doesn’t affect the recapture tax.
See Form 8828, Recapture of Federal Mortgage Subsidy, to find out how much to repay, or whether you qualify for any exceptions.
If you did receive any federal mortgage subsidies, you must file Form 8828 with your tax return whether you sold your home at a loss or a gain. If you had a loss, you won't have to pay back any subsidy.
If you have questions about a tax issue; need help preparing your tax return; or want to download free publications, forms, or instructions, go to IRS.gov to find resources that can help you right away.
Preparing and filing your tax return.
After receiving all your wage and earnings statements (Forms W-2, W-2G, 1099-R, 1099-MISC, 1099-NEC, etc.); unemployment compensation statements (by mail or in a digital format) or other government payment statements (Form 1099-G); and interest, dividend, and retirement statements from banks and investment firms (Forms 1099), you have several options to choose from to prepare and file your tax return. You can prepare the tax return yourself, see if you qualify for free tax preparation, or hire a tax professional to prepare your return.
Free options for tax preparation.
Your options for preparing and filing your return online or in your local community, if you qualify, include the following.
Using online tools to help prepare your return.
Go to IRS.gov/Tools for the following.
. Getting answers to your tax questions. On IRS.gov, you can get up-to-date information on current events and changes in tax law. .
Need someone to prepare your tax return?
There are various types of tax return preparers, including enrolled agents, certified public accountants (CPAs), accountants, and many others who don’t have professional credentials. If you choose to have someone prepare your tax return, choose that preparer wisely. A paid tax preparer is:
. Although the tax preparer always signs the return, you're ultimately responsible for providing all the information required for the preparer to accurately prepare your return and for the accuracy of every item reported on the return. Anyone paid to prepare tax returns for others should have a thorough understanding of tax matters. For more information on how to choose a tax preparer, go to Tips for Choosing a Tax Preparer on IRS.gov. .
Employers can register to use Business Services Online.
The Social Security Administration (SSA) offers online service at SSA.gov/employer for fast, free, and secure W-2 filing options to CPAs, accountants, enrolled agents, and individuals who process Form W-2, Wage and Tax Statement, and Form W-2c, Corrected Wage and Tax Statement.
IRS social media.
Go to IRS.gov/SocialMedia to see the various social media tools the IRS uses to share the latest information on tax changes, scam alerts, initiatives, products, and services. At the IRS, privacy and security are our highest priority. We use these tools to share public information with you. Don’t post your social security number (SSN) or other confidential information on social media sites. Always protect your identity when using any social networking site.
The following IRS YouTube channels provide short, informative videos on various tax-related topics in English, Spanish, and ASL.
Watching IRS videos.
The IRS Video portal (IRSVideos.gov) contains video and audio presentations for individuals, small businesses, and tax professionals.
Online tax information in other languages.
You can find information on IRS.gov/MyLanguage if English isn’t your native language.
Free Over-the-Phone Interpreter (OPI) Service.
The IRS is committed to serving taxpayers with limited-English proficiency (LEP) by offering OPI services. The OPI Service is a federally funded program and is available at Taxpayer Assistance Centers (TACs), most IRS offices, and every VITA/TCE tax return site. The OPI Service is accessible in more than 350 languages.
Accessibility Helpline available for taxpayers with disabilities.
Taxpayers who need information about accessibility services can call 833-690-0598. The Accessibility Helpline can answer questions related to current and future accessibility products and services available in alternative media formats (for example, braille, large print, audio, etc.). The Accessibility Helpline does not have access to your IRS account. For help with tax law, refunds, or account-related issues, go to IRS.gov/LetUsHelp.
Form 9000, Alternative Media Preference, or Form 9000(SP) allows you to elect to receive certain types of written correspondence in the following formats.