Capital Gains Tax on Rental Property: What You Owe When You Sell
Request the analysis Book a free scope call
How a rental sale is taxed, in three layers
Start with your adjusted basis: what you paid plus capital improvements, minus every dollar of depreciation. Subtract it from the sale price net of commissions and closing costs, and that is your gain. A house bought for $320,000 and depreciated $130,000 has a $190,000 basis, so a $649,000 net sale produces a $459,000 gain.
That gain is then split. The part equal to the depreciation is unrecaptured Section 1250 gain, taxed at your ordinary rate but capped at 25% (IRC 1(h)(1)(E), 2027).
Everything above it is long-term capital gain at 0%, 15% or 20%, with 20% starting above $633,600 of taxable income for joint filers (Rev. Proc. 2026-35, 2027); the capital gains hub has the full table. Then the 3.8% net investment income tax sits on top for most landlords.
In our first example, a North Carolina couple pays $78,521 federal, $13,642 of NIIT and $18,314 to North Carolina, an effective 24.1% of the gain.
Residential buildings depreciate over 27.5 years under IRC 168(c), so after 14 years roughly half the building cost has already been deducted and now sits in the 25% layer.
Selling a Rental? The Tax Bill Is Bigger Than Your Capital Gain. Linda and Mark, both 68, sell a California fourplex for $2,000,000. One year of tax: $592,113, about 36% of the $1,650,000 gain. The same sale paid over ten years: $363,684. About $228,429 less, if it is set up before closing.
Allowed or allowable: depreciation you skipped still counts
Some owners never claimed depreciation, or stopped when a tenant moved out for a few months. The tax law does not care. Basis is reduced by depreciation allowed, "but not less than the amount allowable" (IRC 1016(a)(2)). So the 25% layer is figured as if you took every deduction you were entitled to, and you pay tax on a benefit you never received.
The fix comes before the sale, not after. An automatic accounting method change on Form 3115 can usually catch up missed depreciation in the current year, as one deduction, instead of amending old returns. If you suspect a gap, have your CPA rebuild the depreciation schedule from the closing statement and every improvement invoice before you list. Our depreciation recapture analysis shows how that layer is built.
Not sure what your basis is after years of depreciation? Work it out in five lines on your real basis on a rental.
Suspended passive losses: the sale that finally frees them
Most landlords with day jobs cannot deduct rental losses beyond the $25,000 allowance, which phases out between $100,000 and $150,000 of modified AGI (IRC 469(i), fixed in statute since 1986). When you dispose of your entire interest in a passive activity in a fully taxable transaction, the suspended losses become nonpassive and offset wages, business income or anything else (IRC 469(g)(1)(A)).
In our second example, $48,000 of freed losses cuts the tax from $110,477 to $97,522, a difference of $12,955. Three conditions apply:
- Unrelated buyer. A sale to a family member or a controlled entity does not free the losses until the property leaves the related group (IRC 469(g)(1)(B)).
- Fully taxable. A 1031 exchange carries the losses forward with the replacement property; an installment sale releases them year by year in proportion to the gain recognized (IRC 469(g)(3)).
- Entire activity. If several rentals are grouped as one activity, selling one house does not count.
The 3.8% tax, and the real estate professional exception
Rental gain is net investment income for most owners, taxed at 3.8% on the lesser of that income or modified AGI above $250,000 for joint filers (IRC 1411, threshold not indexed, 2027). The exception is narrow.
You must qualify as a real estate professional, meaning more than 750 hours a year and more than half your working time in real property trades in which you materially participate (IRC 469(c)(7)(B)), and the rental must rise to a trade or business.
The regulations add a safe harbor: a real estate professional who spends more than 500 hours on the rental activity in the year, or did so in any five of the prior ten years, is treated as holding the property in a trade or business, so the gain escapes the 3.8% tax (Treas. Reg. 1.1411-4(g)(7)).
In our first example that status would remove $13,642. More on the tax itself on our NIIT on a sale page.
Moving into the rental before you sell
Moving in for two years to claim the $250,000 or $500,000 home sale exclusion works only in part since 2009. Gain is split by time, and the share tied to years after 2008 when the house was not your main home is "nonqualified use" that cannot be excluded (IRC 121(b)(5)).
The depreciation layer is never excluded either (IRC 121(d)(6)), and it is carved out before the time split (IRC 121(b)(5)(D)).
In our third example the owners rented for 12 years and lived there for 2. Only 2/14 of the non-depreciation gain, about $47,000, is excluded. Tax falls from $110,477 to $94,044, a difference of $16,434.
Two timing rules can change the math. A house received in a 1031 exchange must be owned five years before any exclusion is available (IRC 121(d)(10)).
And the opposite move, living in a home first and renting it out later, works far better: years after your last day of home use, within the five-year window, do not count as nonqualified use, so a sale within three years of moving out can still exclude everything except the depreciation.
The Section 121 and 1031 combination covers a property that was both.
Rental versus primary residence: the differences that matter
| Issue | Rental property | Primary residence |
|---|---|---|
| Exclusion | None, except the time-based share under IRC 121(b)(5) | Up to $250,000, or $500,000 joint, under IRC 121 (unchanged for 2027) |
| Depreciation layer | Taxed at up to 25% (IRC 1(h)(1)(E), 2027) | Only for any home office or prior rental use |
| Loss on sale | Section 1231 loss, deductible against ordinary income (IRC 1231) | Personal loss, not deductible |
| 1031 exchange | Available | Not available |
| NIIT (IRC 1411) | Usually applies (IRC 1411, 2027) | Only on gain above the exclusion |
Vacation homes that you also rent sit in between. To use one in a 1031, the IRS safe harbor asks for 24 months of ownership with at least 14 days of fair rental and limited personal use in each of the two years (Rev. Proc. 2008-16).
The four main exits: cash, 1031, installment sale, Opportunity Zone
Cash sale. The baseline above: all three layers in one year, suspended losses freed.
1031 exchange. Roll the full price into like-kind real property within the 45-day and 180-day deadlines (IRC 1031) and the gain, including the 25% layer, carries into the new property. Losses stay suspended. If you want out of management, a Delaware statutory trust is a common replacement. Start at our 1031 exchange analysis.
Installment sale. Carry a note and the gain is taxed as principal arrives, with the 25% layer coming out first under Treas. Reg. 1.453-12. Our installment sale of rental property page walks through the order, the mortgage over basis trap and how to secure the note.
Opportunity Zone fund. Investing the gain in a qualified opportunity fund within 180 days defers it (IRC 1400Z-2); P.L. 119-21 made the program permanent with new zone designations from 2027. Rental gain, including the 25% layer, can qualify as Section 1231 gain. See Opportunity Zones.
Owners who are older, or planning to hold until death, should also weigh holding for the basis step-up, which wipes out the depreciation layer for heirs (IRC 1014).
If you take cash out of a 1031 exchange, the boot is taxed this year, usually out of the 25% layer first. A cost segregation study on the replacement can offset part of it with bonus depreciation on the excess basis (Treas. Reg. 1.168(k)-2(g)(5), 2026 rules); see cost segregation after a 1031 with boot.
Some owners skip the exchange, pay the tax and buy a new rental at full basis with a cost seg in the same year; see bonus depreciation vs a 1031.
Before choosing the 1031, read 1031 exchange vs taxable sale: what owners miss (the loan rate reset, suspended losses, estate tax).
The state layer on a rental sale
Most states tax rental gain as ordinary income. North Carolina is a flat 3.99% for 2026 (NCDOR), which is the $18,314 in our first example; at California's top rate of 13.3% (FTB, 2025 schedule) the same sale would cost far more. Rentals in another state are taxed by that state too, often with withholding at closing for nonresident sellers; see our state-by-state table.
Want your own numbers across all four exits? Get the Big Sale Tax Analysis.
What to know
Every exit trades something. A 1031 keeps the gain and the suspended losses locked in the next property and keeps you a landlord.
An installment sale makes you the lender and still taxes any ordinary-income recapture (Section 1245, for example on cost-segregated parts) in year one; the 25% layer on the building is spread with the payments, taken first (Treas. Reg. 1.453-12).
Opportunity Zone funds carry fund risk and fees. Moving in shrinks the gain only modestly and costs you years of rent. The cash sale is simplest, and with freed losses it is often less painful than owners expect.
How much tax does this sale cause? A worked example
Married couple with $150,000 of wages. Single-family rental bought in 2012 for $320,000 ($64,000 land), sold in 2027 for $690,000 less $41,000 of selling costs. $130,000 of straight-line depreciation; $459,000 gain, of which $130,000 is the 25% layer.
Identical sale, but the couple carried $48,000 of passive losses they could never deduct; the full taxable sale releases them against other income (IRC 469(g)). Same house and price, but the owners moved in at the start of 2024 and sold in 2027.
Depreciation stopped at $112,000. Of the remaining $329,000 of gain, 12/14 is nonqualified use and taxable; 2/14 ($47,000) is excluded under Section 121. Suspended losses left out.
| Engine run | Cash sale, North Carolina, passive landlord | Same sale, $48,000 of suspended losses freed | Rented 12 years, then lived in it 2 |
|---|---|---|---|
| Filing status | Married, joint | Married, joint | Married, joint |
| State | North Carolina | North Carolina | North Carolina |
| Other income (wages, pension, interest) | $150,000 | $150,000 | $150,000 |
| Long-term capital gain | $329,000 | $329,000 | $282,000 |
| Unrecaptured Section 1250 gain (25% max) | $130,000 | $130,000 | $112,000 |
| Suspended passive losses released | $0 | $48,000 | $0 |
| Federal income tax on the sale | $78,521 | $67,390 | $67,151 |
| Net investment income tax (3.8%) | $13,642 | $11,818 | $11,172 |
| State income tax on the sale | $18,314 | $18,314 | $15,721 |
| Total tax caused by the sale | $110,477 | $97,522 | $94,044 |
| Effective rate on the gain | 24.1% | 21.2% | 23.9% |
| Gain kept after these taxes | $348,523 | $361,478 | $299,956 |
Step by step: Cash sale, North Carolina, passive landlord
The same example worked by hand from the 2027 federal tables (California: FTB 2026 schedule), so you can follow each line with a calculator. Rounded to the dollar.
- The gain. $329,000 long-term capital gain + $130,000 unrecaptured Section 1250 gain = $459,000. Other income that year: $150,000, married filing jointly.
- Without the sale. Taxable income is $150,000 less the $33,200 standard deduction = $116,800; regular federal tax on that is $14,779 (2027 brackets, Rev. Proc. 2026-35).
- With the sale. Taxable income becomes $575,800. The ordinary part ($116,800: other income, less the deduction) is taxed at ordinary rates: $14,779. Of the Section 1250 gain, $130,000 still fits in brackets below 25% ($29,171). The long-term gain: $329,000 at 15% = $49,350 (0% to $102,100 and 15% to $633,600 of taxable income, 2027). Regular tax with the sale: $93,300.
- Federal income tax caused by the sale. $93,300 less $14,779 = $78,521.
- Net investment income tax. 3.8% of the smaller of net investment income or income over $250,000 (IRC 1411, not indexed): net investment income from the sale is $459,000; income over the threshold is $359,000. 3.8% x $359,000 = $13,642.
- State. $459,000 of capital gain at 3.99% = $18,314. State tax caused by the sale: $18,314.
- Total. $78,521 + $13,642 + $18,314 = $110,477, which is 24.1% of the gain.
Computed November 21, 2026 by the Big Sale Tax engine (engine.js yearTax): federal brackets, 0/15/20% thresholds and AMT from Rev. Proc. 2026-35 (IR-2026-133, Nov 5 2026) and the One Big Beautiful Bill Act (P.L. 119-21); NIIT under IRC 1411 (thresholds not indexed); state tax from the engine's state table.
"Tax caused by the sale" = tax with the sale minus tax without it. Excludes selling costs, local taxes and estimated-tax timing. Education only.
How much tax would you owe? Run your own numbers
2027 federal law from the engine: 0/15/20% brackets (Rev. Proc. 2026-35), 25% cap on unrecaptured 1250 gain, ordinary rates on 1245 recapture, 3.8% NIIT over $200,000 single / $250,000 joint (IRC 1411), AMT, and your state's rules (California on the FTB 2026 schedules, because the 2027 schedule is not published yet).
What was sold and years held only matter in a few states: Washington exempts real estate, Ohio and New Mexico treat a business sale differently, Arizona subtracts 25% for assets bought after 2011 and Oklahoma deducts gain on Oklahoma property held 5 years or more.
Tax shown is the tax caused by the sale. Selling costs are subtracted in the price block above. Excludes local taxes other than Maryland's county tax (3.2% used).
Tick the active-owner box if you materially participate in the business. Education only.
Get this breakdown by email, plus the one-page Seller Tax Worksheet
We email you the numbers from this page (the gain and the federal, 3.8% and state pieces) with a one-page worksheet to fill in with your CPA: your gain line by line, the tax buckets, the 2027 thresholds and five questions to ask before you sign.
Also free: the book Same Sale, Different Tax, the same $1,000,000 gain taxed ten ways. Want it run on your sale? Book a free scope call to see whether the Big Sale Tax Analysis is worth it.

Who you will talk to
Hans Goldstein · Sacramento, California
Hans Goldstein: Tax & Exit Planning, an independent practice. Enrolled Agent, admitted to practice before the Internal Revenue Service. CA Insurance License #4273294, NPN 20602398.
- What happens first
- You fill in the short form for a free scope call, about 5 minutes. Hans reviews every one personally and replies within 1 business day. If it is a fit, you get a link to book the call.
- The scope call
- Fifteen minutes, free: price, timeline, what you are selling and what the money is for. Scope means you hear whether the analysis is worth it for your sale.
- What you get
- A written side-by-side comparison of your cash-sale baseline against every path that fits, year-by-year numbers, a written recommendation, and a review meeting with you and, if you like, your CPA and attorney.
- What it costs
- The scope call is free. The Big Sale Tax Analysis is $5,000 per household per transaction, only if you decide it is worth it. No retainer, no hourly billing, no obligation to use any strategy.
- How Hans is paid
- The $5,000 fee pays for analysis only and is not reduced or credited if you buy anything. You are never required to buy anything. No referral fees are paid to or received from brokers, CPAs or attorneys. Hans is also a licensed insurance producer with a separately owned insurance business. That business is not part of this engagement, and the analysis does not recommend insurance products. If you later choose an installment sale funded through an insurance company, that company pays Hans a commission through his separate insurance business. He may be compensated by that business if you use an insurance-funded installment sale. Hans is an Enrolled Agent (EA), admitted to practice before the Internal Revenue Service. He is not a CPA, attorney or registered investment adviser; the analysis models tax effects and does not recommend specific securities. Read the disclosures.
Book a free scope call or call 213-340-2018. Hans answers or calls back the same business day.
Related calculators, tables and guides
- 1031 exchange vs installment sale: Keep owning real estate, or get out on a schedule: same sale three ways
- Capital gains tax calculator: Start from price, costs and basis; federal, NIIT and state for a 2027 sale
- Installment sale tax (Section 453): How the gain spreads over the years you are paid, with a calculator
- Capital gains tax by state: Tax on a $1,000,000 gain in all 50 states and DC, with sources and a CSV
- Capital gains tax statistics 2027: 62 dated figures with their IRS and Treasury sources, plus a CSV
Frequently asked questions
How much tax will I pay when I sell my rental property?
Can I avoid paying capital gains tax on a rental property?
What are the tax differences between selling a rental property and a primary residence?
Is depreciation recapture on a rental always taxed at 25%?
What happens to suspended passive losses when I sell a rental?
What are the tax implications of selling a rental property at a loss?
Sources
- IRC 1(h)(1)(E), 25% rate on unrecaptured 1250 gain (Cornell LII)
- IRC 1016(a)(2), allowed or allowable (Cornell LII)
- IRC 469, passive activity losses (Cornell LII)
- IRC 1411, net investment income tax (Cornell LII)
- Treas. Reg. 1.1411-4, real estate professional safe harbor (Cornell LII)
- IRC 121, home sale exclusion and nonqualified use (Cornell LII)
- Rev. Proc. 2008-16, dwelling unit 1031 safe harbor (IRS)
- IRC 1031 (Cornell LII)
- IRC 1400Z-2, Opportunity Zone deferral (Cornell LII)
- IRS Publication 527, Residential Rental Property
- NCDOR tax rate schedules
- Treas. Reg. 1.453-12: unrecaptured Section 1250 gain in an installment sale (eCFR)
Figures as of October 10, 2026; each rate and limit above names its source and year. Education only, not legal or tax advice.
Keep reading
Installment sale of rental property
Selling a rental on a note: recapture first, the 3.8% tax on gain and interest, suspended losses released year by year, and the mortgage-over-basis trap.
ReadDepreciation recapture
Which rate applies to the depreciation you took, how much comes back, and what a 1031 or an installment sale does to it.
Read1031 exchange
Defer the whole gain by trading investment real estate for more real estate, if you can find it and close inside 180 days.
ReadSection 121 plus 1031
A former home that became a rental can use both the home sale exclusion and a 1031 exchange on the same sale under Rev. Proc. 2005-14.
ReadCommercial property
Office, retail and industrial sales: why cost segregation comes back at ordinary rates, how the 1231 lookback works, and what states hold back at closing.
ReadSecond home
A vacation home gets no Section 121 exclusion, but rental history, a 1031 safe harbor or moving in can change the bill.
Read