Home / Helpful Guides / Capital Gains Tax on Property Sales
REAL ESTATE

Capital Gains Tax on Property Sales: How to Calculate What You Owe

Selling property is one of the biggest financial events most people experience, and the tax side of it catches a lot of sellers off guard. The gain isn’t just sale price minus purchase price — there are adjustments for improvements, selling costs and exclusions that can shift the number by tens of thousands of dollars. This guide walks through the full calculation, step by step, so you actually understand what you’ll owe before closing day.

The Basic Capital Gains Formula

Every property sale tax calculation follows the same structure. The math itself isn’t complicated — the hard part is getting the right numbers into each slot.

The math itself is short. Start with the sale price, which is what the buyer paid you. Subtract your selling costs, the broker commissions, transfer taxes, legal fees, and title insurance, and the result is your amount realized. From that, subtract your adjusted basis, which is what you paid plus improvements minus any depreciation you took. The difference is your capital gain or loss.

That gain is what gets taxed. Everything hinges on how you calculate the adjusted basis — and most people undercount their basis, which means they overpay on taxes. The IRS outlines this formula in Publication 523, Selling Your Home.

Calculating Your Adjusted Basis

Your basis starts with what you paid for the property. That includes the purchase price plus certain costs from the original acquisition: title insurance, legal fees, recording fees, transfer taxes you paid as the buyer, and any survey costs. If you inherited the property, your basis is generally the fair market value at the date of death — not what the deceased originally paid. If it was a gift, you typically carry over the donor’s basis (per IRC §1015).

Capital Improvements Add to Your Basis

Every dollar you spent on capital improvements increases your basis and reduces your taxable gain. This is real money. A $40,000 kitchen renovation directly reduces your gain by $40,000. But you need to know the difference between improvements and repairs.

Capital improvements add value, prolong the property’s life, or adapt it to a new use. New roof, finished basement, added bathroom, new HVAC system, structural work, a deck or patio — all improvements. Repairs maintain the property in its current condition: fixing a leaky faucet, patching drywall, painting. Repairs don’t add to your basis. The IRS clarifies this distinction in Publication 523.

Keep every receipt. We can’t stress this enough. Clients come to us after selling a property they’ve owned for 20 years, and they have no documentation for the $80,000 in improvements they made. Without records, you’re leaving money on the table.

Depreciation Reduces Your Basis

If you used the property as a rental or for business, you were required to take depreciation deductions each year — whether you actually claimed them or not. The IRS treats depreciation as “allowed or allowable,”. Meaning they’ll reduce your basis by the depreciation you should have taken even if you forgot to (per IRC §1016(a)(2)). Residential rental property depreciates over 27.5 years. Commercial property over 39 years.

Short-Term vs. Long-Term Capital Gains Rates

How long you owned the property determines which tax rate applies. Hold it for more than one year and it’s a long-term capital gain. Sell within a year and it’s short-term, taxed at your ordinary income rate — which could be as high as 37% federally.

Long-term capital gains rates for 2025 are 0%, 15%, or 20%, depending on your taxable income. Most people fall into the 15% bracket. The 0% rate applies to single filers with taxable income under roughly $48,350 and joint filers under $96,700. The 20% rate kicks in above about $533,400 for single filers and $600,050 for joint filers.

Short-term flips get expensive fast. A married couple in New York City flipping a property for a $200,000 gain in under a year could face a combined federal and state rate above 45%. That same gain held for 13 months drops to roughly 25% combined. Timing matters.

The Primary Residence Exclusion (Section 121)

This is the single biggest tax break available to homeowners. If you’ve owned and lived in the property as your primary residence for at least 2 of the last 5 years before the sale, you can exclude up to $250,000 of gain from tax ($500,000 if married filing jointly) under IRC §121.

The 2-of-5-year rule doesn’t require consecutive years. You could live in the home for year 1, rent it out for years 2 and 3, move back in for year 4, and sell in year 5 — you’d still qualify. The 5-year window is measured backward from the date of sale.

A few things that trip people up: you can only use this exclusion once every two years. Both spouses need to meet the use test to claim the full $500,000 (though only one needs to meet the ownership test). And if you converted a rental property to your primary residence, special rules limit how much of the gain qualifies for exclusion — any depreciation taken after 2008 while the property was a rental doesn’t get excluded. See our detailed guide on selling your house and buying a new home for more on the Section 121 rules.

Partial Exclusion for Unforeseen Circumstances

Didn’t meet the full 2-year requirement? You might still qualify for a partial exclusion if you sold due to a job change, health issue, or other unforeseen circumstance (per IRC §121(c)). The exclusion is prorated based on the fraction of the 2-year period you did meet. Moved after 12 months for a new job? You’d get half the exclusion — $125,000 for a single filer.

Depreciation Recapture: The Tax You Can’t Avoid

Even if you qualify for the Section 121 exclusion on your primary residence, depreciation recapture is a separate calculation. Any depreciation you claimed (or should have claimed) on the property is taxed at a flat 25% rate under IRC §1(h)(1)(E) when you sell. This applies to rental properties, home offices, and any portion of the property that was depreciated.

Example: you rented out a property for 10 years and claimed $80,000 in total depreciation. When you sell, that $80,000 is taxed at 25% regardless of your income bracket — that’s $20,000 in depreciation recapture tax, on top of whatever capital gains tax you owe on the remaining profit.

Depreciation recapture is the tax surprise that catches rental property owners every time. They see the long-term capital gains rate of 15% and assume that applies to the whole gain. It doesn’t.

Net Investment Income Tax (NIIT)

High-income taxpayers face an additional 3.8% surtax on net investment income, which includes capital gains from property sales. The NIIT applies when your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly) per IRC §1411.

So a married couple with $300,000 in regular income and a $400,000 capital gain from a property sale could face long-term capital gains tax at 20% plus the 3.8% NIIT — an effective federal rate of 23.8% on part or all of the gain. Add New York State and City taxes, and you’re north of 30%.

Step-by-Step Calculation Example

Let’s run a real scenario. A couple bought a home in Brooklyn in 2015 for $650,000. They spent $85,000 on capital improvements over the years (new kitchen, new roof, finished basement). They sell in 2025 for $1,200,000. They paid $72,000 in broker commissions and $15,000 in transfer taxes and legal fees.

Step 1: Amount Realized

$1,200,000 (sale price) minus $87,000 (selling costs) = $1,113,000

Step 2: Adjusted Basis

$650,000 (purchase price) + $12,000 (original acquisition costs) + $85,000 (improvements) = $747,000

Step 3: Capital Gain

$1,113,000 minus $747,000 = $366,000

Step 4: Apply Section 121 Exclusion

They lived in the home as their primary residence for 10 years. They qualify for the full $500,000 exclusion (married filing jointly). Their gain of $366,000 is entirely excluded. Federal capital gains tax: $0.

If that same couple had a gain of $600,000, they’d exclude $500,000 and pay capital gains tax on $100,000. At the 15% rate, that’s $15,000 in federal tax (plus state and city).

1031 Exchange: Deferring the Tax Entirely

If you’re selling an investment or business property (not your primary residence), a 1031 exchange lets you defer the entire capital gains tax by reinvesting the proceeds into a “like-kind”. Property. The rules are strict: you have 45 days to identify replacement properties and 180 days to close per IRC §1031(a)(3). A qualified intermediary must hold the funds — you can never touch the money yourself.

1031 exchanges work for rental properties, commercial buildings and other investment real estate. They don’t work for your personal residence, stocks, or partnership interests. And the tax is deferred, not eliminated. If you eventually sell without doing another exchange, the deferred gain comes due. Some investors keep exchanging until death, at which point heirs receive a stepped-up basis and the deferred gain disappears entirely. That’s a legitimate strategy, not a loophole.

Installment Sales: Spreading the Gain Over Time

If you’re selling a property and the buyer is paying you over time (seller financing), you can report the gain proportionally as you receive payments rather than all at once in the year of sale. This is called an installment sale, reported on Form 6252.

The advantage is keeping your income lower in any single year, which can keep you in a lower capital gains bracket or below the NIIT threshold. The downside is you’re lending money to the buyer and carrying credit risk. Interest on the installment note is taxed as ordinary income.

Don’t Forget State and Local Taxes

Federal capital gains tax is only part of the bill. New York State taxes capital gains as ordinary income, with a top rate of 10.9%. New York City adds another 3.876%. A property sale generating a $300,000 gain could cost you $45,000 in federal tax and another $40,000+ in state and city tax. California is even steeper at 13.3% for the highest earners.

Some states — Florida, Texas, Nevada, Washington, Wyoming — have no state income tax at all, which makes a massive difference on large gains. Where you’re a tax resident when you sell matters as much as where the property sits.

Frequently Asked Questions

how do I calculate capital gains tax on the sale of my house?

Your capital gains tax on a property sale is calculated by subtracting your adjusted cost basis from the sale price. If you’ve owned the home for more than a year, the gain is taxed at long-term capital gains rates — 0%, 15%, or 20% depending on your taxable income. For 2024, the 15% bracket kicks in at $47,026 for single filers and $94,050 for married filing jointly. You’ll report the sale on Schedule D of Form 1040, and if you received a Form 1099-S from the closing, that sale is definitely on the IRS’s radar.

What most people miss is that your adjusted basis isn’t just what you paid. It includes closing costs from when you bought the property, capital improvements you made over the years — a new roof, an addition, a kitchen remodel — and certain selling costs like the real estate commission. Those additions to basis directly reduce your gain. Also, if the property was ever used as a rental, you may owe depreciation recapture tax at up to 25% on the portion you previously deducted, which is a whole separate calculation under IRC Section 1250.

Working out your adjusted basis correctly is one of the most valuable things a CPA can do for you before a sale closes. The Reed Corporation helps clients reconstruct basis records going back decades, identifies every eligible improvement, and runs the full tax projection so you know your number before you sign anything.

do I have to pay capital gains tax when I sell my home if I lived in it?

If the home was your primary residence, you may qualify for the Section 121 exclusion — one of the best breaks in the tax code. Single filers can exclude up to $250,000 of gain from federal tax, and married couples filing jointly can exclude up to $500,000. To qualify, you generally need to have owned the home and lived in it as your main home for at least two of the five years before the sale. You don’t have to report the sale at all if your gain falls entirely within the exclusion.

Here’s where people get tripped up: the two-year residency test doesn’t have to be continuous, but the IRS looks at the full picture. If you rented out the home for a period, used it as a vacation property, or claimed a home office deduction, part of your gain may not qualify for the exclusion. After the Tax Relief Act of 2008, any gain attributable to periods of non-qualified use — meaning time when it wasn’t your primary residence after January 1, 2009 — is taxable regardless of the exclusion. That math can get complicated fast.

If you’re in New York, remember that the state doesn’t conform to the federal exclusion automatically in every scenario, and there may be city-level considerations too. The Reed Corporation reviews the full ownership timeline for clients selling their NYC-area homes to make sure you’re not leaving exclusion dollars on the table — or inadvertently triggering taxable gain you didn’t expect.

what is the capital gains tax rate on investment property sales in 2024?

For investment property held longer than one year, federal long-term capital gains rates for 2024 are 0%, 15%, or 20% based on your taxable income. High earners also owe the 3.8% Net Investment Income Tax (NIIT) under IRC Section 1411 if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). That means the effective federal rate on investment property gains can hit 23.8% before you factor in state taxes. New York State adds up to 10.9%, and New York City residents tack on another 3.876%.

Rental properties come with an additional layer called depreciation recapture. When you sell a rental, the IRS recaptures the depreciation deductions you took — or should have taken — during ownership and taxes that portion at a maximum rate of 25% under IRC Section 1250. So even if most of your gain qualifies for the 15% long-term rate, the depreciation recapture piece sits in its own higher bracket. For NYC investors who’ve owned property for ten or twenty years, this recapture number can easily run into the hundreds of thousands of dollars.

A lot of investors are genuinely surprised when they see the full tax stack — federal capital gains, NIIT, state tax, city tax, and recapture — all in one column. The Reed Corporation models this out for clients well before they list a property, so you can weigh whether a 1031 exchange, installment sale, or other structure makes more financial sense than a straight sale.

what expenses can I deduct to reduce capital gains on a property sale?

Reducing your taxable gain starts with building the highest defensible adjusted basis you can. Your original purchase price is the foundation, but you can add qualifying closing costs from the purchase — things like title insurance, recording fees, and legal fees. Capital improvements made during ownership also increase your basis: a new HVAC system, a bathroom addition, a finished basement. These are different from repairs, which are just maintenance and don’t add to basis. On the selling side, real estate commissions, attorney fees, transfer taxes, and certain settlement costs reduce your amount realized.

The distinction between an improvement and a repair matters a lot and it’s an area where the IRS can push back. A fresh coat of paint is a repair. Replacing the entire exterior and adding insulation could be an improvement under the tangible property regulations. Keep receipts, contractor invoices, and permits for everything — ideally from the day you buy the property. If you inherited the property, your basis is the fair market value at the date of death under the step-up rules of IRC Section 1014, which can dramatically reduce your gain.

Pulling together years of improvement records is one of those tasks that feels overwhelming but makes a real difference in the final tax bill. The Reed Corporation works through the full ownership history with clients, categorizes expenses correctly, and documents the adjusted basis in a way that holds up if the IRS ever asks questions. Starting that process before you sell gives you time to track down any missing records.

can I avoid capital gains tax on a property sale using a 1031 exchange?

Yes — a 1031 exchange under IRC Section 1031 lets you defer capital gains tax when you sell an investment or business property and reinvest the proceeds into a like-kind replacement property. To qualify, the replacement property must be identified within 45 days of the sale closing, and you must close on it within 180 days. Both properties need to be held for investment or business use, not personal use. There’s no dollar cap on how much gain you can defer, which makes this one of the most powerful tools available to real estate investors.

The ‘like-kind’ requirement is broader than most people expect — you can swap a commercial building for a residential rental, or a single-family rental for a strip mall — but the rules around boot (cash or unlike property you receive in the exchange) are strict. If you receive any boot, that portion is immediately taxable. You also can’t do a 1031 exchange on your primary residence or on property held for sale (think fix-and-flip inventory). New York has its own nonresident withholding requirements on property sales, and a 1031 doesn’t automatically exempt you from the state’s Form TP-584 process.

Timing is everything with a 1031 exchange — miss the 45-day identification window and the entire gain becomes taxable that year. The Reed Corporation coordinates with qualified intermediaries on behalf of clients, helps identify eligible replacement properties from a tax standpoint, and ensures the state-level filings in New York are handled correctly so the exchange doesn’t unravel on a technicality.

Contact Us