How to Calculate Capital Gains Tax on Real Estate: Basis and Rates

To calculate capital gains tax on real estate, subtract your adjusted basis (what you paid for the property plus improvements) and your selling costs from the sale price. The difference is your capital gain. If you owned the home more than a year, that gain is taxed federally at 0%, 15%, or 20% depending on your income, and if the property was your primary residence you may exclude up to $250,000 of the gain as a single filer or $500,000 as a married couple filing jointly. The formula is simple; the accuracy of each input is what determines your actual bill.

Step One: Build Your Adjusted Basis

Adjusted basis is the IRS’s measure of your total investment in the property. It starts with the purchase price on your original settlement statement, but it does not stop there. Certain closing costs from the day you bought add to basis, including title insurance premiums, legal fees, recording fees, survey costs, and transfer taxes you paid at acquisition.1Internal Revenue Service. Publication 523 – Selling Your Home

Capital improvements move the needle the most. Any project that adds value, extends the home’s useful life, or adapts it to a new use increases basis: a new roof, an addition, upgraded plumbing or electrical, new HVAC, a finished basement, a new driveway.1Internal Revenue Service. Publication 523 – Selling Your Home Routine maintenance does not count. Painting, fixing a leaky faucet, patching drywall — none of that adds to basis. The IRS draws the line based on whether the work materially improved the property or merely maintained it.

Every dollar you can legitimately add to basis is a dollar subtracted from your taxable gain. Keep receipts, contractor invoices, and permits. If you are audited years later, those records are the difference between your number and the IRS’s number.

If You Inherited, Received, or Got the Property in a Divorce

Property inherited from someone who died gets a stepped-up basis. Instead of the decedent’s original purchase price, your basis resets to the property’s fair market value on the date of death.2Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A house bought for $80,000 in 1985 and worth $450,000 at death gives you a basis of $450,000, wiping decades of appreciation off the tax ledger.

Gifts work the opposite way. When someone gives you property during their lifetime, you take their basis with it. That same $80,000 house gifted to you at a $450,000 value leaves you with an $80,000 basis and a $370,000 gain if you sell at $450,000. If the fair market value at the time of the gift was lower than the donor’s basis, your basis for calculating a loss is limited to that lower fair market value.3Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust

Real estate that transfers between spouses in a divorce triggers no gain or loss at the time of transfer. The receiving spouse takes the same adjusted basis the transferring spouse had.4Office of the Law Revision Counsel. 26 U.S. Code 1041 – Transfers of Property Between Spouses or Incident to Divorce The tax is deferred, not eliminated, and it lands entirely on the spouse who keeps the house.

Step Two: Figure Your Net Proceeds

Net proceeds are what you keep after paying the costs of the sale. Start with the gross sales price on your closing disclosure, then subtract every expense directly tied to the transaction: the real estate agent commission (usually the biggest deduction), transfer taxes, closing legal fees, title insurance you provided to the buyer, recording fees, and any seller-paid concessions.

One trap catches many sellers: paying off your remaining mortgage balance is not a selling expense. It reduces the cash you walk away with, but it has no effect on your capital gain. The IRS looks at the difference between your sale price and your investment in the property, not at how much debt was attached to it.

Step Three: Apply the Formula

With adjusted basis and net proceeds in hand, the core calculation is:

Net Proceeds − Adjusted Basis = Capital Gain (or Loss)

Say you bought a home for $300,000, spent $15,000 on closing costs at purchase, and put $40,000 into a kitchen renovation and a new roof over the years. Your adjusted basis is $355,000. You sell for $600,000 and pay $35,000 in selling costs, leaving net proceeds of $565,000. Your capital gain is $210,000.

If the result is negative, you have a capital loss. Losses on a personal residence are not deductible against other income.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses Losses on investment or rental property follow different rules and may be deductible.

Step Four: Apply the Primary Residence Exclusion

Most homeowners selling the place they actually live in will never owe capital gains tax, because the Section 121 exclusion is generous. Single filers can exclude up to $250,000 of gain; married couples filing jointly can exclude up to $500,000.6Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence In the example above, a single filer with a $210,000 gain would owe zero federal capital gains tax.

To qualify, you must have owned and used the home as your primary residence for at least two of the five years before the sale. The two years do not need to be consecutive. You also cannot have claimed the exclusion on another home sale in the previous two years. For the $500,000 joint exclusion, either spouse must meet the ownership test and both spouses must meet the use test. If only one spouse meets the use requirement, the couple is limited to the $250,000 single exclusion.6Office of the Law Revision Counsel. 26 U.S. Code 121 – Exclusion of Gain From Sale of Principal Residence

Selling before the two-year mark does not always cost you the full exclusion. A prorated exclusion is available if you sold because of a job relocation (new workplace at least 50 miles farther from the home than the old one), a health-related reason recommended by a doctor or tied to family care, or unforeseen circumstances such as destruction of the home, divorce, job loss, or the death of a spouse.1Internal Revenue Service. Publication 523 – Selling Your Home The partial exclusion equals the number of days you met the tests divided by 730, multiplied by $250,000 or $500,000. One year of qualified use before an eligible job move gives a single filer roughly $125,000 of exclusion.

Step Five: Apply the Right Tax Rate to What’s Left

How long you owned the property determines which rate applies. Hold it one year or less and any gain is taxed as ordinary income, at rates up to 37%.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses Hold it more than a year and you get long-term rates.

For 2026, long-term capital gains brackets for single filers are:7Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates

  • 0% on taxable income up to $49,450
  • 15% on taxable income from $49,451 to $545,500
  • 20% on taxable income above $545,500

For married couples filing jointly, the 0% ceiling is $98,900 and the 20% bracket starts at $613,700.7Tax Foundation. 2026 Tax Brackets and Federal Income Tax Rates Most homeowners with gains exceeding their exclusion land in the 15% bracket.

Add-Ons: The 3.8% Surtax and State Tax

Higher earners face an additional 3.8% net investment income tax on capital gains from real estate. It applies once modified adjusted gross income exceeds $200,000 for single filers, $250,000 for married filing jointly, or $125,000 for married filing separately, and it hits the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.8Internal Revenue Service. Net Investment Income Tax Those thresholds are not indexed for inflation.

State tax is a separate layer. Most states tax capital gains as ordinary income, with rates from zero in no-income-tax states to over 13% at the top end. A few states offer preferential treatment for real estate gains, but that is the exception. Build your state’s rate into any projection.

If the Property Was a Rental: Depreciation Recapture

Rental owners face an extra tax layer. If you claimed (or could have claimed) depreciation deductions while renting the property, the IRS recaptures those deductions at sale. Recaptured depreciation is taxed at your ordinary income rate or 25%, whichever is lower.9Internal Revenue Service. Treasury Decision 8836 – Unrecaptured Section 1250 Gain

Here is how it plays out. You bought a rental for $300,000, with $60,000 allocated to land (not depreciable) and $240,000 to the building. Over 10 years you claimed $87,273 in depreciation, dropping your adjusted basis to $212,727. You sell for $400,000 after selling costs, producing a $187,273 total gain. Of that, $87,273 is depreciation recapture taxed at up to 25%. The remaining $100,000 is taxed at the long-term capital gains rate.

Depreciation recapture is reported on Form 4797.10Internal Revenue Service. Instructions for Form 4797 Skipping the depreciation deductions during ownership does not help: the IRS calculates recapture based on the depreciation you were entitled to take, not just what you claimed.

Ways to Defer or Spread the Tax

Investment and rental owners can defer the entire gain by reinvesting the proceeds into another qualifying property through a 1031 like-kind exchange. Both properties must be held for business or investment purposes, so this does not apply to your personal residence. Deadlines are strict: 45 days from closing to identify replacement properties in writing, and 180 days to close on the replacement.11Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Miss either and the full gain becomes taxable, with no hardship extensions.12Internal Revenue Service. Like-Kind Exchanges Under IRC Section 1031 A qualified intermediary must hold the funds; if the proceeds touch your hands, the deferral is lost. Basis carries over to the new property, so the gain is deferred, not erased.

If you take payments over multiple years rather than in a lump sum, the installment method lets you report gain proportionally as each payment comes in, which can keep you in a lower bracket. At least one payment must arrive after the tax year of the sale. Report it on Form 6252, or elect out on your return for the year of sale if you would rather pay all at once.13Internal Revenue Service. Publication 537 – Installment Sales

Pay Estimated Tax So the Penalty Doesn’t Find You

Capital gains are not withheld the way wages are. If the tax on your gain pushes your total expected liability more than $1,000 above withholding and credits, you generally need to make estimated tax payments.14Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc. Plenty of sellers close in June, reinvest the money, and then discover a large bill plus an underpayment penalty the following April.

The safe harbor: total payments (withholding plus estimated) that equal at least 100% of last year’s tax liability, or 110% if your adjusted gross income exceeded $150,000.14Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc. For a mid-year sale, you can annualize the income and make a larger payment in the relevant quarter rather than spreading it evenly.

Reporting the Sale

The sale goes on Form 8949, with property description, dates acquired and sold, sale proceeds, and adjusted basis. The totals flow to Schedule D of Form 1040, which calculates your overall capital gains tax for the year.15Internal Revenue Service. Instructions for Form 8949 – Sales and Other Dispositions of Capital Assets If the Section 121 exclusion wiped out your entire gain, you usually don’t need to report the sale, though reporting it creates a paper trail.

Rental and investment property adds Form 4797 for depreciation recapture and Form 6252 for installment sales.10Internal Revenue Service. Instructions for Form 4797 Failing to report or underpaying triggers a failure-to-pay penalty of 0.5% per month on the unpaid tax, up to 25%, with interest on top.16Internal Revenue Service. Failure to Pay Penalty

Keep every record that supports your basis — settlement statements, improvement receipts, closing disclosures — for at least three years after you file the return reporting the sale.17Internal Revenue Service. How Long Should I Keep Records If depreciation or an installment sale was involved, hold them longer, since the limitations period doesn’t start running until you dispose of the property or report the final payment.