How to Calculate Capital Gains Tax on a Property Sale

To calculate capital gains tax on a property sale, subtract your adjusted basis (what you have invested in the property for tax purposes) and your selling costs from the sale price, then apply any exclusion you qualify for and tax the remainder at the federal rate that matches how long you owned the property and how much you earn. Long-term gains (property held more than one year) are taxed at 0%, 15%, or 20%. Short-term gains (one year or less) are taxed at ordinary income rates up to 37%. The work happens in a few steps, and each one changes the final number.

Step 1: Find Your Adjusted Basis

Your adjusted basis is the tax-recognized amount you have invested in the property. Where you start depends on how you got it.

If You Bought the Property

Start with the purchase price.1Office of the Law Revision Counsel. 26 U.S. Code 1012 – Basis of Property Add settlement costs from the original purchase, including title insurance, legal fees for the deed, recording fees, and transfer taxes you paid at closing.2Internal Revenue Service. Publication 523 (2024), Selling Your Home

Then add the cost of capital improvements you made while you owned it. An improvement is a permanent change that raises the property’s value or extends its useful life: a new roof, central air, a garage addition, a kitchen remodel, new flooring. Routine repairs and maintenance don’t count. Painting, patching cracks, fixing leaks, and replacing broken hardware cannot be added to basis.2Internal Revenue Service. Publication 523 (2024), Selling Your Home

If you claimed depreciation on the property (common with rentals and business use), subtract the total depreciation from your basis.3Office of the Law Revision Counsel. 26 U.S.C. 1016 – Adjustments to Basis The reduction applies to depreciation that was allowable, not just what you actually deducted, so the IRS will lower your basis even if you skipped the deduction in some years. Keep receipts for improvements in case of an audit.

If You Inherited the Property

Your basis is generally the fair market value on the date the previous owner died, not what they paid for it.4Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired from a Decedent This “stepped-up basis” can shrink or wipe out a taxable gain. If a parent bought a house for $100,000 and it was worth $400,000 the day they died, your starting basis is $400,000. The estate’s executor can supply the appraised value.5Internal Revenue Service. Gifts and Inheritances

If You Received the Property as a Gift

For calculating a gain, your basis is usually the donor’s adjusted basis: what they paid, plus improvements, minus depreciation. If the donor’s basis was higher than the property’s fair market value at the time of the gift, you use fair market value when calculating a loss. If gift tax was paid on the transfer, basis may be increased by a portion of that tax, but not above fair market value at the time of the gift.6Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust

Step 2: Calculate the Amount Realized

The amount realized is the gross sale price minus what it cost you to sell. Selling expenses typically include:

  • Real estate agent commissions, usually the biggest single deduction from the sale price
  • Advertising fees paid to market the property
  • Legal fees for preparing closing documents
  • State or local transfer taxes on the sale

All of these reduce the amount realized, which in turn reduces the taxable gain.2Internal Revenue Service. Publication 523 (2024), Selling Your Home

Step 3: Subtract to Find the Gain

Subtract the adjusted basis from the amount realized. A positive number is a capital gain; a negative number is a capital loss.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Say your amount realized after selling costs is $500,000 and your adjusted basis (original price plus improvements minus depreciation) is $350,000. The capital gain is $150,000. That is the amount potentially subject to tax before any exclusion.

Losses on personal-use property, including your primary home and a vacation home, are not deductible. Capital losses are only deductible on investment or business property.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses

Step 4: Apply the Primary Residence Exclusion If It Fits

If the property was your main home, you may be able to exclude up to $250,000 of gain from income, or $500,000 if married filing jointly.8Internal Revenue Service. Topic No. 701, Sale of Your Home For many homeowners this eliminates the tax entirely, so check it before running rates.

To claim the full exclusion, you must meet both tests during the five-year period ending on the sale date:9Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain from Sale of Principal Residence

For a married couple filing jointly to take the $500,000 exclusion, at least one spouse must meet the ownership test, both must meet the use test, and neither can have used the exclusion on another home sale within the past two years.9Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain from Sale of Principal Residence

If you sell before hitting two years because of a job relocation, a health issue, or certain unforeseen circumstances, you may qualify for a prorated exclusion based on the fraction of the two-year period you did meet.9Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain from Sale of Principal Residence One year of use, cut short for a qualifying reason, gets a single filer up to $125,000.

Step 5: Apply the Right Rate

The rate depends on how long you held the property, your total taxable income, and whether any depreciation has to be recaptured.

Short-Term or Long-Term

Owned one year or less: the gain is short-term and taxed at ordinary income rates, which range from 10% to 37% for 2026.11Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 Owned more than one year: the gain is long-term and taxed at lower rates.12Office of the Law Revision Counsel. 26 U.S.C. 1222 – Other Terms Relating to Capital Gains and Losses

The 2026 long-term capital gains brackets by taxable income and filing status:13Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates

  • 0% on taxable income up to $49,450 (single) or $98,900 (married filing jointly)
  • 15% on taxable income from $49,450 to $545,500 (single) or $98,900 to $613,700 (married filing jointly)
  • 20% on taxable income above $545,500 (single) or $613,700 (married filing jointly)

Most sellers land in the 15% bracket. The 0% rate helps sellers whose total taxable income, including the gain, stays under the thresholds above.

Net Investment Income Tax

An additional 3.8% Net Investment Income Tax may apply if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).14Internal Revenue Service. Net Investment Income Tax The 3.8% hits the lesser of your net investment income or the amount by which your income exceeds the threshold.15Internal Revenue Service. Topic No. 559, Net Investment Income Tax These thresholds are set by statute and don’t adjust for inflation.

Depreciation Recapture

If you claimed depreciation on rental or business property, the part of the gain attributable to that depreciation is taxed at a maximum rate of 25%, higher than the standard long-term rates.16Office of the Law Revision Counsel. 26 U.S. Code 1 – Tax Imposed This is called unrecaptured Section 1250 gain. Only the amount equal to your prior depreciation is taxed at that rate; anything above it is taxed at the standard long-term rate.

On a $150,000 gain from a rental where you took $40,000 in depreciation, the first $40,000 is taxed at up to 25% and the remaining $110,000 is taxed at 0%, 15%, or 20% based on your income.

Step 6: Report the Sale and Pay

You report the sale on two forms. Enter the details (dates, proceeds, basis) on Form 8949, Sales and Other Dispositions of Capital Assets.17Internal Revenue Service. Instructions for Form 8949 Totals carry to Schedule D of Form 1040, which figures your overall capital gain or loss for the year.18Internal Revenue Service. Form 8949 – Sales and Other Dispositions of Capital Assets Both forms are on the IRS website and supported by most tax software.

If the sale happens mid-year and you expect to owe at least $1,000 more than what withholding and credits cover, you may need to make estimated tax payments rather than wait until you file.19Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc. Payments are due quarterly. For calendar-year taxpayers that means April 15, June 15, September 15, and January 15.20Internal Revenue Service. Publication 509 (2026), Tax Calendars If you have a W-2 job, raising your withholding for the rest of the year is another way to cover the liability. Underpaying during the year can trigger a penalty.

Deferring the Tax with a Like-Kind Exchange

For investment or business property, not a personal residence, a like-kind exchange under Section 1031 lets you defer the capital gains tax by rolling the proceeds into similar real property.21Office of the Law Revision Counsel. 26 U.S.C. 1031 – Exchange of Real Property Held for Productive Use or Investment The provision applies only to real property.22Internal Revenue Service. Like-Kind Exchanges – Real Estate Tax Tips

Deadlines are strict. After selling, you have 45 days to identify potential replacement properties in writing and 180 days to close on the replacement (or until your tax return is due for that year, whichever comes first).21Office of the Law Revision Counsel. 26 U.S.C. 1031 – Exchange of Real Property Held for Productive Use or Investment The replacement has to be held for business or investment use, not as a personal vacation home. Property held mainly for resale doesn’t qualify either.22Internal Revenue Service. Like-Kind Exchanges – Real Estate Tax Tips

If you receive cash or other non-like-kind property in the exchange, you have to recognize gain up to that value. An exchange defers the tax, it doesn’t erase it. Your basis in the new property carries over from the old one, so the deferred gain gets taxed when you eventually sell without doing another exchange. Report a like-kind exchange on Form 8824.22Internal Revenue Service. Like-Kind Exchanges – Real Estate Tax Tips