Capital Gains Tax on Rental Property: The Complete Guide
Capital gains tax on rental property stacks three separate layers: long-term capital gains at 0%, 15% or 20%, depreciation recapture at up to 25%, and the 3.8% Net Investment Income Tax. This guide shows the full calculation with a worked example and the four ways to reduce the bill.
Capital Gains Tax on Rental Property: The Complete Guide
Selling a rental property looks profitable on the closing statement, and then the tax bill arrives. Capital gains tax on rental property is not one number. It is three stacked layers: long-term capital gains, depreciation recapture, and for many sellers the 3.8% Net Investment Income Tax.
Most investors price in the first layer. Far fewer price in the second. Every year you owned the property you were entitled to a depreciation deduction, and the IRS tracked all of it. At sale it takes back up to 25 cents of every dollar of that depreciation, whether or not you ever claimed the deduction.
This guide shows how each layer is calculated, walks through a complete sale with real numbers, and covers the four legal ways to reduce what you owe.
How Capital Gains Tax on Rental Property Works
Capital gains tax on rental property is the tax on the difference between your net sale proceeds and your adjusted cost basis. Unlike a primary residence, an investment property gets no exclusion, and the portion of the gain created by depreciation deductions is taxed separately at up to 25%.
The sequence matters. You do not calculate one gain and apply one rate. You calculate the total gain, split it into the part attributable to depreciation and the part attributable to appreciation, then apply a different rate to each.
There is no $250,000 or $500,000 exclusion here. That exclusion belongs to a primary residence, and converting a rental to a residence before selling does not erase the recapture. For the wider set of rules, including primary residence treatment, see our guide to capital gains tax on real estate.
The Three Tax Components on a Rental Property Sale
Component 1: Capital Gains Tax
Holding period decides which rate schedule applies. Held 12 months or less, the entire gain is ordinary income at 10% to 37%. Held more than 12 months, long-term rates apply.
| Long-term rate (2026 tax year) | Single filer taxable income | Married filing jointly |
|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 |
| 20% | Above $545,500 | Above $613,700 |
Most rental investors land in the 15% band. State tax applies on top of the federal rate and the spread is wide: 0% in Florida and Texas, up to 13.3% in California.
Component 2: Depreciation Recapture, the Tax Most Investors Forget
Each full year you held the property, you were entitled to deduct 1/27.5 of the building value. That deduction lowered your taxable rental income every year, and it lowered your cost basis by the same amount. At sale, the IRS recaptures that benefit and taxes it at a maximum federal rate of 25%.
Read the next sentence twice. Recapture applies to depreciation you were allowed to claim, not only depreciation you actually claimed. An investor who never filed a depreciation schedule still owes recapture on the full allowable amount at sale. Skipping the deduction does not avoid the tax, it just means you paid for it twice.
The arithmetic is unforgiving on long holds. A $200,000 building generates $7,272 of allowable depreciation a year. Ten years in, that is $72,720 of accumulated depreciation and a $18,180 recapture bill, owed before the capital gains calculation even begins. For the mechanics of how that annual number is set, including the building and land split, see rental property depreciation.
Component 3: Net Investment Income Tax
The NIIT adds 3.8% on investment income once Modified Adjusted Gross Income passes $200,000 for a single filer or $250,000 for a married couple filing jointly. These thresholds are not indexed to inflation, so more sellers cross them every year.
A large sale often pushes an investor over the line in the sale year alone, even if normal income sits well below it. The gain itself counts toward MAGI. At the top of the schedule, 20% capital gains plus 3.8% NIIT produces a 23.8% federal rate on the appreciation portion.
How to Calculate Capital Gains on Rental Property, Step by Step
Step 1: Calculate your adjusted cost basis.
Start with the original purchase price. Add acquisition costs (closing costs, title, inspection, legal fees) and every capital improvement that added value or extended useful life: roof, HVAC, kitchen, additions. Then subtract total depreciation taken or allowable over the holding period, and the result is your adjusted cost basis.
Step 2: Calculate net sale proceeds.
Take the contract sale price and subtract selling costs: broker commissions, which typically run 5% to 6%, plus closing costs, transfer taxes and attorney fees. Selling costs reduce the taxable gain, so they belong in the calculation, not in a separate mental bucket.
Step 3: Split the gain into its two parts.
Net sale proceeds minus adjusted cost basis equals total gain. Allocate the first slice of that gain, up to the amount of accumulated depreciation, to depreciation recapture. Whatever remains is long-term capital gain.
Step 4: Apply the rates separately.
Multiply the recapture slice by up to 25%. Multiply the long-term gain slice by your bracket rate (0%, 15% or 20%). If your MAGI clears the NIIT threshold, add 3.8%, then add state tax, and the sum of those lines is your bill. To model the appreciation side on its own first, run it through our capital gains tax calculator for real estate.
Worked Example: The Full Tax Calculation
A single-family rental bought in 2016 and sold in 2026, held a full ten years.
| Line item | Amount |
|---|---|
| Purchase price (building $144,000 / land $36,000) | $180,000 |
| Capital improvements (roof replacement) | $20,000 |
| Depreciation claimed ($144,000 / 27.5 x 10 years) | ($52,364) |
| Adjusted cost basis | $147,636 |
| Sale price | $310,000 |
| Commissions and closing costs | ($21,000) |
| Net sale proceeds | $289,000 |
| Total gain | $141,364 |
Now split the gain and apply the rates:
| Tax layer | Calculation | Tax owed |
|---|---|---|
| Depreciation recapture | $52,364 x 25% | $13,091 |
| Long-term capital gain | $89,000 x 15% | $13,350 |
| NIIT (MAGI over threshold) | $89,000 x 3.8% | $3,382 |
| Total federal tax | $29,823 |
State tax rides on top of that figure. In Texas or Florida the bill stops at $29,823. In California, the $141,364 gain is taxed as ordinary income at up to 13.3%, adding as much as $18,801 for a total near $48,600.
Here is the part that catches people. An investor who thought about this sale as "a $141,000 gain at 15%" budgeted roughly $21,000. An investor who only remembered the appreciation above purchase price budgeted closer to $13,000. The real federal number is $29,823, and depreciation recapture plus NIIT is what moved it.
How the Holding Period Changes the Bill
Under 12 months. The entire gain is ordinary income, up to 37% federal. This is the most expensive outcome available and the reason flips get taxed harder than holds. If you are modeling a short hold, the exit tax belongs in the underwriting from day one.
12 to 24 months. Long-term rates apply at 15% or 20%. Accumulated depreciation is small on a hold this short, so recapture is a minor line.
Five to ten years and beyond. The capital gains rate is as low as it gets, but recapture grows every year you hold. A 20-year hold on a $144,000 building accumulates $104,727 of depreciation and roughly $26,182 of recapture tax.
That last point is not an argument against long holds. The depreciation deductions you took along the way were worth more than the 25% you give back, because they offset rental income at your ordinary rate for years and the recapture is deferred until sale. Long holds still win. They just produce a bigger closing-table surprise if nobody tracked the numbers.
Four Ways to Reduce Capital Gains Tax on a Rental Property Sale
1031 exchange. The strongest tool available. Reinvest the proceeds into like-kind replacement property and all three layers, capital gains, recapture and NIIT, are deferred rather than paid. You have 45 days from closing to identify replacement property and 180 days to close. Miss either window and the full bill is due.
Installment sale. Carry the financing yourself and the gain is recognized as payments arrive instead of all at once. Spreading a $141,000 gain across five years can keep you in the 15% band and below the NIIT threshold in each of them. Depreciation recapture, however, is generally reported in full in the year of sale.
Suspended passive losses. Passive losses from rentals that you could not deduct in prior years are released when you dispose of the activity in a fully taxable sale. Those losses offset the gain directly. Many investors have five figures of suspended losses sitting on prior-year returns and never apply them.
Hold and pass to heirs. At death, basis steps up to fair market value. Accumulated appreciation and the entire depreciation recapture liability are wiped out for the heirs, including gain carried forward through earlier 1031 exchanges. Capital gains planning is one of several moves that work together, covered in our real estate tax strategy guide.
State Capital Gains Tax on Rental Property
| State treatment | Top rate on the gain | Examples |
|---|---|---|
| No state income tax | 0% | Florida, Texas, Tennessee, Nevada |
| Taxed as ordinary income, high rate | Up to 13.3% | California |
| Taxed as ordinary income, moderate rate | Up to 10.9% | New York |
The state line is often larger than any federal strategy you can execute. Selling a California rental and exchanging into an Indiana rental defers the federal tax and removes California's ongoing claim on future rental income at the same time.
Why Your Cost Basis Decides the Bill
Every number above depends on one input: an accurate adjusted cost basis. Get the depreciation figure wrong and the recapture line is wrong. Leave out a $20,000 roof because the invoice is in an email from four years ago and you have just handed the IRS an extra $3,000 in federal tax on a gain that was never real.
This is the common failure. Investors remember the purchase price and the sale price. They do not have a clean, year-by-year record of acquisition costs, capital improvements versus repairs, and depreciation taken. At sale, the basis gets reconstructed from bank statements and memory, and reconstruction always favors the IRS.
ProPilot tracks the deal from acquisition forward: purchase price, closing costs, capital improvements as you log them, and the ownership timeline that sets the depreciation schedule. When you decide to sell or start a 1031, the adjusted cost basis is already current and your CPA gets a record instead of a shoebox. If you prefer to keep the ledger side separate, our comparison of real estate accounting software covers the alternatives.
Your basis should be current before you list, not reconstructed after you sell. Try it free for 7 days.
FAQ
How is capital gains tax calculated on a rental property sale?
Subtract your adjusted cost basis (purchase price plus improvements minus depreciation) from net sale proceeds to get the total gain. The portion equal to accumulated depreciation is taxed as recapture at up to 25%. The remainder is long-term capital gain at 0%, 15% or 20%. High earners add 3.8% NIIT.
What is depreciation recapture tax on real estate?
Depreciation recapture is a tax assessed at sale on the depreciation deductions you took during ownership, at a maximum federal rate of 25%. It applies to depreciation you were allowed to claim even if you never claimed it. A 10-year hold on a $200,000 building produces roughly $18,180 of recapture tax.
How do I avoid capital gains tax when I sell a rental property?
A 1031 exchange defers the entire bill, capital gains and recapture, if you identify replacement property within 45 days and close within 180. Installment sales spread the gain, suspended passive losses offset it, and heirs receive a stepped-up basis. The primary residence exclusion does not apply to a rental.
Does the 2-out-of-5-year primary residence rule help if I lived in my rental?
Partially, and less than most investors expect. Qualifying use can shelter part of the appreciation, but depreciation taken after May 6, 1997 is still recaptured in full. The exclusion never covers the recapture portion.
Do I pay capital gains tax if I sell at a loss?
No. A sale below adjusted cost basis produces a loss on business property, which is generally deductible against ordinary income rather than limited to capital losses. Remember that depreciation lowers your basis each year, so a property can sell below purchase price and still produce a taxable gain.
Conclusion
Capital gains tax on a rental sale is three calculations, not one. In the example above, a $141,364 gain produced $13,091 of depreciation recapture, $13,350 of capital gains tax and $3,382 of NIIT, for $29,823 federal before any state tax. Recapture and NIIT accounted for more than half of it.
Two numbers determine your own version of that outcome: total depreciation taken or allowable, and adjusted cost basis. Both are knowable years before you sell, and both are what a 1031 decision, an installment structure or a hold-to-step-up plan gets built on. Deciding in the week between accepted offer and closing is deciding without them.
Run your own numbers before you list, not after. A 1031 has a 45-day clock that starts at closing, which means the planning has to happen first.
Keep your basis, improvements and depreciation timeline current from the day you buy. Try ProPilot free for 7 days.