Capital Gains on the Sale of Property: Complete Tax Guide

Selling real estate triggers some of the most complex tax calculations in personal finance — involving adjusted basis, depreciation recapture, short- vs. long-term rates, the §121 exclusion, and potentially the Net Investment Income Tax. This guide walks through every step from calculating your gain to filing the correct forms.

Illustration for Capital Gains on the Sale of Property
Quick Answer When you sell property, your taxable gain equals your amount realized (proceeds minus selling costs) minus your adjusted basis (purchase price plus improvements minus depreciation). For investment property held more than one year, gain is taxed at 0%/15%/20% long-term rates, with depreciation recapture taxed at up to 25%. Report on Form 4797 and Schedule D. The §121 exclusion can shelter up to $250,000/$500,000 of primary residence gain.
IRC §1001 — Gain or loss on disposition: Under IRC §1001(a), gain from the sale of property is the excess of amount realized over adjusted basis. Amount realized (§1001(b)) includes money received plus the fair market value of other property. Adjusted basis is determined under IRC §1011–§1016. The character of the gain (ordinary, §1231, §1250, §1245) determines the applicable tax rate.

Step 1: Determine your amount realized

Your amount realized is everything you receive for the property minus selling costs directly attributable to the sale:

Example: Sale price $600,000 − real estate commission $36,000 − closing costs $4,000 = Amount realized: $560,000

Step 2: Calculate your adjusted basis

Adjusted basis starts at cost basis and is then adjusted up and down:

Example: Purchase price $380,000 + improvements $45,000 − depreciation $120,000 = Adjusted basis: $305,000

Step 3: Calculate the total gain

Total gain = Amount realized − Adjusted basis

Using the examples above: $560,000 − $305,000 = $255,000 total gain

Step 4: Characterize the gain

For investment real property held more than 1 year, the gain is first allocated to two (or three) categories:

Tier 1: Unrecaptured §1250 gain (depreciation recapture)

The amount of MACRS straight-line depreciation previously deducted is taxed at a maximum federal rate of 25% under IRC §1(h)(1)(D). This applies even if the property is sold at a loss compared to the original purchase price but with enough depreciation to create a gain over adjusted basis.

In the example: $120,000 (depreciation) × 25% = $30,000 tax

Tier 2: §1231 long-term capital gain (above recapture)

The remaining gain above the depreciation recapture amount is §1231 gain taxed at long-term capital gains rates (0%, 15%, or 20% depending on taxable income). Note: §1231 losses in prior years can recapture §1231 gains as ordinary income.

In the example: ($255,000 − $120,000) = $135,000 × 15% = $20,250 tax

Tier 3: Net Investment Income Tax (NIIT)

If your modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly), a 3.8% NIIT applies to the lesser of your net investment income or the excess MAGI above the threshold.

Step 5: Apply the §121 exclusion (primary residence only)

If the property was your primary residence, you may be able to exclude up to $250,000 ($500,000 married filing jointly) of gain under IRC §121, provided:

§121 does not exclude depreciation recapture: Even if the §121 exclusion eliminates your §1231 gain, depreciation deducted while the property was rented or used in a business is not excluded. Unrecaptured §1250 gain (up to the total depreciation taken) remains taxable.

Form 1099-S: what you'll receive

The settlement agent or title company is required under IRC §6045 to file Form 1099-S (Proceeds From Real Estate Transactions) and provide you a copy by February 15 of the year following the sale. Box 2 reports your gross proceeds. You must reconcile this with your own gain calculation, as 1099-S does not account for your selling costs, basis, or any exclusion.

If you qualify for the full §121 exclusion and certify that fact to the settlement agent on IRS Form W-9 (or equivalent), the settlement agent may not be required to file Form 1099-S — but many still do.

Form 4797 and Schedule D: reporting the sale

For investment or business real property, the sale is reported on Form 4797 (Sales of Business Property):

For personal-use property (e.g., primary residence with no business use), report on Form 8949 and Schedule D directly. If gain is excluded under §121, enter "H" in column (f) of Form 8949.

Comprehensive worked example

Facts:

Tax calculation (assume 20% LT rate, NIIT applies on full gain):

Had the investor completed a §1031 exchange instead of selling, all $100,163 in federal tax would have been deferred.

Installment sales

If the buyer pays you over time (installment sale), you may be able to report the §1231 gain and long-term capital gain pro rata as payments are received under IRC §453 (Installment Method). However, depreciation recapture (unrecaptured §1250 gain) must be recognized in full in the year of sale — it cannot be deferred via installment reporting. Form 6252 is used for installment sale reporting.

Frequently asked questions

When do I owe capital gains tax on a property sale?

You owe capital gains tax when your amount realized (sale price minus selling costs) exceeds your adjusted basis (original purchase price plus improvements minus depreciation). The tax is due for the tax year in which the sale closes. If you have an installment sale you may spread the gain over the payment years, but depreciation recapture is fully recognized in the year of sale.

What forms do I need when selling property?

For investment or business real property, the primary form is Form 4797 (Sales of Business Property). The §1231 gain from Form 4797 flows to Schedule D (Capital Gains and Losses) on Form 1040. You will also receive Form 1099-S from the title company or settlement agent reporting your gross proceeds. If you excluded gain under §121, you may need to report that on Form 8949 as well.

How is depreciation recaptured on a property sale?

When you sell real property that was depreciated (rental or business use), the IRS recaptures the depreciation at up to 25% federal rate under the unrecaptured §1250 gain rules (IRC §1(h)(1)(D)). The recaptured amount is limited to the total straight-line depreciation taken. This portion is reported on Form 4797 and is separate from the regular long-term capital gains portion.

Can I use the §121 exclusion if I rented my home before selling?

Yes, but with limitations. Under the Housing Assistance Tax Act of 2008 (HATA), gain attributable to periods of non-qualified use (rental use after January 1, 2009) is not eligible for the §121 exclusion. You must allocate the gain between qualified (personal) use and non-qualified (rental) use. Depreciation taken on the property is also not excluded and is subject to unrecaptured §1250 recapture rules.

What is the Net Investment Income Tax on property sales?

The Net Investment Income Tax (NIIT) is a 3.8% surtax on net investment income including capital gains from property sales. It applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds $200,000 (single filers) or $250,000 (married filing jointly). These thresholds are not indexed for inflation. The NIIT is reported on Form 8960.

Educational information and estimates only. Not tax advice. Tax rules change and vary by situation; consult a qualified tax professional before acting.

Related