Direct answer: You may be able to defer, reduce, or—in limited cases—exclude capital gain on a rental-property sale through a properly arranged 1031 exchange, an installment sale, the Section 121 home-sale exclusion, documented basis and selling expenses, available capital or passive losses, or a charitable plan. There is no universal “rental property capital-gains loophole.” The right route depends on the property’s adjusted basis, prior depreciation, ownership history, contract terms, replacement plans, and timing. Several options must be in place before the sale closes.

First calculate the tax you are actually trying to avoid

A rental-property sale rarely produces one uniform bucket of capital gain. Start with the closing statement and depreciation schedules, not an online estimate based only on purchase and sale prices.

Amount realized generally equals the cash, debt relief, and fair market value of other property received, reduced by qualifying selling expenses. Adjusted basis generally begins with purchase price plus capital improvements and certain acquisition costs, then falls for depreciation that was allowed or allowable. Gain is the amount realized minus adjusted basis.

For the seller's line-by-line worksheet, use AE's rental closing-cost and mortgage-payoff guide. It separates sale expenses from historical basis, prorations, and debt so a small settlement-statement misclassification does not distort this broader strategy decision.

Tax layerWhy it matters
Section 1245 recaptureCost-segregated personal property and certain land improvements may create ordinary-income recapture. A capital loss does not automatically erase this bucket.
Unrecaptured Section 1250 gainGain attributable to prior straight-line depreciation on the building may be taxed at a federal rate of up to 25%.
Remaining Section 1231 gainThis can receive long-term capital-gain treatment, subject to the five-year Section 1231 lookback rules.
NIIT and state taxThe 3.8% net investment income tax and state tax may apply based on income, participation, residency, and property location.
Suspended passive lossesA fully taxable sale of the entire activity to an unrelated party can release suspended passive losses. A deferred exchange may not produce the same release.

Worked baseline: why the tax estimate changes the strategy

Assume an investor sells a rental for $900,000, pays $50,000 of selling costs, and has a $430,000 adjusted basis after $170,000 of accumulated depreciation. The preliminary gain is $420,000: $850,000 net amount realized minus $430,000 adjusted basis. But that does not mean all $420,000 receives the same rate. The return must separate any Section 1245 recapture from cost-segregated assets, unrecaptured Section 1250 gain, and the remaining Section 1231 gain. It should also test suspended passive losses, the Section 1231 lookback, NIIT, and state treatment.

That is why the best strategy cannot be selected from the gross gain alone. A taxpayer who needs cash, a taxpayer who wants another property, and a taxpayer with large suspended losses can rationally choose different paths from the same facts.

Which rental-property sale strategy fits your goal?

Your goalStrategy to testCritical constraint
Keep investing in real estate1031 exchangeQualified intermediary and exchange structure must be arranged before closing.
Exit while spreading collectionsInstallment saleRecapture can be due in year one; buyer credit risk and related-party rules matter.
Property was also your homeSection 121 exclusionOwnership/use tests, nonqualified use, and post-1997 depreciation limit the exclusion.
Give part or all to charityOutright gift or CRTTransfer before a binding sale; debt, appraisal, deduction limits, and trust distributions require specialist review.
Take cash in a taxable saleBasis, loss, and timing reviewRepairs are not capital improvements; loss character must match the gain being offset.

Strategy 1: Use a 1031 exchange when you want replacement real estate

Section 1031 can defer gain on business or investment real property exchanged for other qualifying real property. A delayed exchange generally requires an independent qualified intermediary to hold proceeds, written identification of replacement property within 45 days, and receipt of replacement property within 180 days or the return due date (including extensions), whichever comes first. The taxpayer cannot first take possession of the sale proceeds and then retroactively create an exchange.

To defer all gain, investors commonly acquire enough replacement property and avoid receiving cash or other non-like-kind property. “Equal debt” is not a separate statutory test: debt relieved and debt assumed are analyzed with cash and other consideration. Replacing net equity and acquiring sufficient replacement value is the practical planning model, but the exchange documents and actual consideration control. Cash retained, reduced replacement value, or net debt relief can produce taxable boot.

1031 example with partial boot

An investor sells for $900,000, has $300,000 of debt paid off, and has $550,000 of net exchange proceeds after costs. If the investor buys a $760,000 replacement property using $500,000 of exchange funds and new financing, the retained $50,000 may be taxable boot even though most of the transaction qualifies. The deferred gain reduces the basis in the replacement property; it does not disappear. Investors using repeated exchanges may continue deferral, and a later basis adjustment at death may change the result, but estate-law and basis rules must be evaluated at that time.

Related parties, vacation homes, partnership interests, dealer property, and a planned cash-out refinance can create additional issues. Coordinate the intermediary, closing attorney, lender, and tax advisor before the relinquished-property closing. See AE’s 1031 exchange guide for the identification rules and timeline.

Strategy 2: Use an installment sale when the buyer will pay over time

Section 453 generally spreads eligible gain as principal is collected after the sale year. The taxable gain is not simply equal to each payment. Compute the gross-profit percentage—gross profit divided by contract price—and apply that percentage to each principal payment. Interest is reported separately. Depreciation recapture under Sections 1245 and 1250 is generally recognized in the year of sale even if cash arrives later; the remaining unrecaptured Section 1250 gain follows the installment-sale ordering rules.

Installment-sale example

Assume a debt-free property sells for $600,000 with a $240,000 adjusted basis and $60,000 of selling expenses. Gross profit is $300,000 and the contract price is $600,000, producing a 50% gross-profit percentage before separately accounting for recapture. If the seller receives $120,000 of principal in year one, $60,000 is installment gain—not $120,000. Stated or imputed interest is interest income. Any required recapture is added to year-one income.

An installment note adds buyer-default risk, interest-rate rules, possible acceleration if the note is sold, pledged, canceled, or transferred, and special related-party restrictions. It is a financing and collection decision as much as a tax decision.

Strategy 3: Test Section 121 if the rental was also your principal residence

Section 121 can exclude up to $250,000 of qualifying gain, or up to $500,000 on certain joint returns, when the ownership and use tests are met. Converting a rental to a principal residence is not an automatic two-year cure. Post-2008 periods of nonqualified use can allocate part of the gain outside the exclusion, and gain attributable to depreciation allowed or allowable after May 6, 1997 is not excludable.

  • Rental first, residence later: Eight post-2008 rental years followed by two residence years can cause 80% of the otherwise eligible gain to be treated as nonqualified-use gain. Depreciation remains outside the exclusion.
  • Residence first, rental later: If the owner lives in the home, then rents it after the last period of qualified use and sells while still meeting the two-of-five-year test, that later rental period is generally excluded from the statutory nonqualified-use definition. Depreciation from the rental period is still taxable.

The sequence of use matters. Reconstruct move-in dates, rental periods, prior home-sale exclusions, and depreciation before assuming the property qualifies.

Strategy 4: Charitable planning can work—but only before the sale is fixed

An outright contribution of appreciated property to a qualified charity can avoid recognition of the donor’s built-in gain and may produce a charitable deduction, subject to fair-market-value, adjusted-gross-income, appraisal, substantiation, and carryforward rules. Debt on the property can create bargain-sale treatment and other complications. A contribution after a binding sale obligation may be treated as an assignment of income.

A charitable remainder trust may sell contributed property without immediate trust-level capital-gain tax, but it does not make the economic gain vanish. Distributions to the donor are taxed under statutory tier rules, the trust is irrevocable, charity must receive the remainder interest, and self-dealing and appraisal rules apply. This is appropriate only when charitable intent, cash-flow objectives, and transaction timing align.

Strategy 5: Use losses and suspended passive losses in the correct buckets

Capital losses can offset capital gains, with net capital-loss deductions against ordinary income generally limited to $3,000 per year for individuals and the balance carried forward. But loss harvesting does not necessarily offset ordinary Section 1245 recapture. Character matters.

Separately, a fully taxable disposition of an entire passive activity to an unrelated person may free suspended passive losses under Section 469(g). Those losses can make a taxable sale more attractive than a 1031 exchange in some cases. Confirm whether the taxpayer sold the entire activity, whether activities were grouped, and whether the buyer is related before counting on the release.

Strategy 6: Opportunity-zone timing is unusually limited in 2026

Under the original Qualified Opportunity Zone rules, eligible gain invested in a qualified opportunity fund within the applicable 180-day window could be deferred, and qualifying appreciation in the fund could potentially be excluded after a 10-year holding period. However, the original deferred gain is generally required to be included by December 31, 2026. A 2026 investment therefore offers little remaining deferral of that original gain, even if the long-term exclusion for fund appreciation could still be relevant. Do not treat a 2026 opportunity-zone investment as a generic multi-year deferral without reviewing the investment date, eligible-gain rules, and the current post-2026 regime.

Strategy 7: Increase basis only for costs the tax law permits

Missing basis is often the most fixable problem in a taxable sale. Review the original closing statement, capital improvements, assessments for local improvements, casualty adjustments, and acquisition costs. Also capture allowable selling expenses such as broker commissions and certain legal and transfer costs. Ordinary repairs, mortgage principal, and personal labor do not become basis merely because they were expensive.

What can be deducted from gain when you sell a rental property?

Direct answer: Eligible costs of selling generally reduce the amount realized, while eligible acquisition costs and capital improvements increase adjusted basis. These are different entries in the gain calculation—not a blanket current-year deduction for every charge on the closing statement. Mortgage principal paid off at closing is not itself a selling expense or a basis increase. Depreciation allowed or allowable reduces basis even if it was missed on earlier returns. The IRS Publication 544 gain example shows selling expenses reducing amount realized and improvements increasing basis.

Closing-statement itemWhere to test itReview question
Broker commission, sale advertising, title or legal work to convey the property, and qualifying transfer chargesPotential selling expenses that reduce amount realizedWas the charge incurred to sell, rather than to finance, own, or improve the property?
Original purchase price, eligible acquisition settlement costs, and documented capital improvementsAdjusted basis, net of required basis reductionsWas the improvement already depreciated or included in the asset ledger? Avoid counting it twice.
Mortgage principal payoff or cash received after the lender is paidNeither is the gain figure by itselfDid the payoff merely settle the seller's debt, or did the buyer assume debt as part of consideration?
Property-tax, rent, security-deposit, repair, interest, and utility prorationsClassify each separately; do not label the entire net settlement as selling expenseWhich period and party does the item belong to, and was it previously deducted or included in basis?

The IRS Publication 523 selling-expense worksheet names commissions, advertising, and legal fees for a home sale; use it as a classification reference, not as a substitute for the rental-property rules in Publication 544. Publication 551 explains acquisition basis and settlement costs, while the IRS mortgage-payoff FAQ illustrates why paying debt from sale proceeds does not make the payoff a gain-reducing cost.

Sale-year worksheet: Suppose the contract price is $900,000, the seller pays $45,000 in broker commission and $8,000 in qualifying sale legal and transfer costs, and adjusted basis after depreciation is $430,000. Preliminary gain is $417,000: $900,000 less $53,000 of selling expenses less $430,000 of adjusted basis. If a $300,000 mortgage is paid from closing proceeds, the seller's cash is lower, but the payoff does not turn the $417,000 gain into $117,000. If an old $40,000 improvement was omitted from the basis ledger, reconstruct its cost and depreciation history before changing the $430,000 basis; simply adding the full $40,000 at sale would risk understating gain. The final tax still depends on Section 1245, unrecaptured Section 1250, Section 1231, passive losses, and state rules.

Before signing the return: Match every settlement line to the purchase agreement, invoices, prior Schedule E deductions, fixed-asset ledger, and lender payoff. Separate cash-flow items from tax gain, reconcile tenant and tax prorations, and confirm whether any cost-segregated assets were separately disposed of. If depreciation history is wrong, review the allowed-or-allowable depreciation issue on sale and the rental basis correction path before treating a missing deduction as more basis. For an exchange rather than a cash sale, use the 1031 closing-cost and boot guide; exchange treatment of a charge is a different question.

Have the draft closing statement and depreciation ledger reviewed together, before an incorrect payoff or improvement entry flows into the sale-year return.

Book a Return Review Call

Depreciation reduces basis even when the owner failed to claim it. If prior depreciation was missed, reporting a larger basis on sale is not the correction. Depending on the years and accounting-method facts, the taxpayer may need Form 3115 or an amended-return analysis before filing the sale-year return.

Decision tree: what to do before accepting an offer

  1. Do you want more investment real estate? If yes, model a 1031 exchange and engage the qualified intermediary before closing. If no, continue.
  2. Will the buyer pay over time? If yes, compare an installment note with a cash sale after isolating year-one recapture and credit risk.
  3. Was the property your principal residence? Reconstruct the five-year window, nonqualified use, and depreciation to test Section 121.
  4. Do you have genuine charitable intent? Explore an outright gift or CRT before a binding sale exists.
  5. Are there losses or missing basis records? Reconcile passive-loss carryovers, capital-loss carryovers, improvements, and depreciation asset by asset.
  6. None of those apply? Model a fully taxable sale, including federal character buckets, NIIT, state tax, estimated payments, and cash needed at closing.

Documents to gather for a rental-property sale review

  • Original purchase closing disclosure, settlement statement, and allocation between land and building
  • Every federal and state depreciation schedule, including cost-segregation reports and Form 3115 adjustments
  • Invoices and permits for capital improvements, casualty records, and prior partial dispositions
  • Current loan payoff, proposed purchase agreement, broker estimate, and expected selling costs
  • Prior-year Forms 8582, capital-loss carryovers, and Section 1231 gain or loss history
  • Occupancy timeline if the property was ever a principal residence or vacation home
  • Proposed replacement-property, installment-note, charitable, or opportunity-fund documents
  • Ownership agreements if an LLC, partnership, trust, or multiple owners hold the property

Common mistakes that make the tax harder to reduce

  • Closing first and trying to create a 1031 exchange afterward
  • Calling every payment “capital gain” without separating recapture, unrecaptured Section 1250 gain, Section 1231 gain, and interest
  • Assuming two years of residence makes all earlier rental gain excludable
  • Ignoring depreciation that was allowable but never claimed
  • Using capital losses against an ordinary-recapture estimate without checking character
  • Assuming suspended passive losses will be released in a related-party sale or a tax-deferred exchange
  • Transferring property to charity after the sale is already binding
  • Entering an installment arrangement without underwriting the buyer or documenting adequate interest

Primary sources

These strategies change the timing and character of income in different ways; some add investment, liquidity, or compliance risk. Review the proposed transaction with a real-estate tax advisor and, where appropriate, an attorney, qualified intermediary, appraiser, or charitable-planning specialist before signing.


Review the Sale Before Your Options Expire

Bring the purchase and proposed sale statements, depreciation schedules, improvement records, and any replacement-property plan. AE will map the taxable gain, recapture, loss carryovers, and strategy deadlines before you close.

Book a Return Review Call

This article is for informational purposes only and does not constitute legal or tax advice. Consult a qualified tax professional regarding your specific circumstances. AE Tax Advisors, 935 Lake Elmo Dr, Suite B, Billings, MT 59105. Phone: (631) 614-5762.

Frequently Asked Questions

Can rental losses offset my W-2 income?

Not by default. Rental activities are passive per se under IRC Section 469(c)(2). The exceptions are qualifying as a real estate professional under Section 469(c)(7), using the short-term rental exception where average customer use is seven days or less with material participation, or the limited $25,000 allowance that phases out between $100,000 and $150,000 of modified AGI.

How is rental property depreciated?

Residential rental buildings are generally depreciated straight line over 27.5 years using the mid-month convention; nonresidential real property generally uses 39 years. Land is not depreciable. A supportable cost segregation study may identify components with shorter recovery periods, but bonus-depreciation eligibility and percentage depend on the asset and placed-in-service law.

Should I hold rental property in an LLC or an S-Corp?

The answer depends on liability, financing, ownership, state law, exit plans, and tax classification. Rental income is often excluded from self-employment tax, so an S election may not deliver the payroll-tax benefit expected. Holding appreciating real estate in an S corporation can also make later distributions tax-costly. Review the complete facts with tax and legal advisors.

Can I deduct travel to my rental property?

Travel with a genuine business purpose—such as inspection, maintenance, or tenant matters—may be deductible when the tax-home and substantiation rules are met. Records should show the business purpose, dates, destination, cost, and work performed. Material-participation treatment depends on the actual work and surrounding facts.

Can I completely avoid capital gains tax when I sell a rental property?

Sometimes gain can be excluded or offset, but most strategies defer or reduce tax rather than erase it. A 1031 exchange defers qualifying gain; Section 121 may exclude qualifying home-sale gain but not post-1997 depreciation; losses and basis adjustments work only under their own rules. Calculate each tax-character bucket before choosing a strategy.

Does a 1031 exchange avoid depreciation recapture?

A properly structured 1031 exchange can defer qualifying gain, including depreciation-related gain, to the extent the exchange is tax deferred. Cash, non-like-kind property, or other boot can trigger current gain, and the deferred gain generally carries into the replacement property's basis.

Can capital losses offset depreciation recapture on a rental sale?

Not automatically. Capital losses offset capital gains, but Section 1245 recapture is generally ordinary income. Unrecaptured Section 1250 gain, Section 1231 gain, and ordinary recapture must be separated before determining which losses can offset which income.

When should I start tax planning for a rental property sale?

Start before signing a binding contract and well before closing. A 1031 exchange requires the qualified intermediary and exchange structure before proceeds are received, while charitable transfers and installment terms also depend on pre-sale documents and timing.

Business Owners: Are You Overpaying on Taxes?

Get Your Free Tax Assessment