The short answer
An office building that sells below its peak, or even below what you paid, can still produce a taxable gain, because years of 39-year depreciation have lowered your adjusted basis; that gain is mostly unrecaptured section 1250 gain taxed at up to 25 percent, and a 1031 exchange defers it. If the price is below your adjusted basis, the sale is a loss, and an exchange is the wrong tool: section 1031 recognizes no loss, while a taxable sale usually gives a section 1231 loss that can offset ordinary income and releases suspended passive losses. A lender-driven exit can produce gain with no cash at all, so run the numbers before you choose the buyer.
At a glance
| Building life | 39-year straight line for nonresidential real property, section 168(c) |
|---|---|
| Gain within depreciation | Taxed as unrecaptured section 1250 gain at a maximum 25% |
| Loss in an exchange | Not recognized: section 1031(a) covers gain and loss alike |
| Loss in a cash sale | Net section 1231 losses are not capital losses, section 1231(a) |
| Five-year lookback | Later section 1231 gains are ordinary up to recent net losses, section 1231(c) |
| Nonrecourse loan in a deed in lieu | Full balance is amount realized, whatever the value, Reg. section 1.1001-2 |
| Departed tenants' buildouts | Treated as disposed of when abandoned at lease end, section 168(i) |
Below peak is not the same as below basis: compare the price with adjusted basis, not with what you paid
Gain is the net sale price minus adjusted basis, and adjusted basis is what you paid plus improvements minus the depreciation you have taken. Office buildings are depreciated over 39 years under section 168(c), so after a decade or more the basis can sit well below the purchase price. A sale that feels like a loss on paper may still be a gain on the return.
Hypothetically, an owner bought a building 12 years ago for $10,000,000, with $8,000,000 allocated to the structure. Depreciation of about $205,000 a year has reduced the basis by roughly $2,460,000, to about $7,540,000. Three possible net prices tell three different stories.
- Net price $9,000,000: a gain of about $1,460,000, even though the building sold for $1,000,000 less than it cost.
- Net price $7,540,000: no gain and no loss.
- Net price $6,500,000: a loss of about $1,040,000.
When there is a gain, nearly all of it may sit in the 25 percent layer
When the gain is smaller than the depreciation you claimed, all of it is unrecaptured section 1250 gain, which IRS Topic 409 says is taxed at a maximum 25 percent rate. In the $9,000,000 example, that is up to about $365,000 of federal tax on $1,460,000 of gain, plus up to about $55,500 of the 3.8 percent net investment income tax where it applies, before any state tax. None of that gain enjoys the 15 or 20 percent rates, because the price never rose above the original cost.
That makes the exchange worth more per dollar of gain than it is for a building that appreciated, and it is why an office owner selling below peak should still price the deferral. Before you do, clean up the fixed-asset register. Under section 168(i)(8)(B), improvements you built for a tenant are treated as disposed of when they are irrevocably abandoned at the end of that tenant's lease, so the undepreciated cost of a departed tenant's buildout can be written off rather than carried in the basis. The partial asset disposition page explains the mechanics.
When the price is below basis, a taxable sale usually beats an exchange
The exchange statute is symmetrical: section 1031(a)(1) shields losses from recognition exactly as it shields gains. An office building sold at a loss through an intermediary therefore loses the loss: it is folded into the replacement's basis and recovered slowly through depreciation, if at all.
A taxable sale treats it better. A building used in a trade or business and held more than a year is section 1231 property, and section 1231(a)(2) says that when a year's section 1231 losses exceed its section 1231 gains, they are not treated as capital losses, so the net loss is ordinary and not subject to the $3,000 capital loss limit. Suspended passive losses from the building are also released by a fully taxable disposition of your entire interest under section 469(g). The excess business loss limit in section 461(l) can cap how much of a business loss offsets other income in one year, carrying the rest forward as a net operating loss.
Section 1231(c) adds a long tail: for five years, net section 1231 gains are treated as ordinary income up to the net section 1231 losses you have not yet recaptured. If you expect to sell another property at a gain within that window, the loss year and the gain year need planning together. Money from a loss sale can still go into real estate without an exchange; investing in a DST without a 1031 and cash investors with no exchange cover that path.
Pair a loss building with a gain property in the same year only after checking how the netting falls
Section 1231 nets all of a year's section 1231 gains and losses. An owner who sells the office building at a $1,000,000 loss and a warehouse at a $1,500,000 gain in the same year has a $500,000 net gain, taxed as long-term capital gain after any section 1231(c) recapture, and the office loss has quietly lost its ordinary character.
Exchanging the warehouse and selling the office building for cash keeps the two apart: the warehouse gain is deferred and does not enter the netting, and the office loss stays a net section 1231 loss. Timing the two sales in different years can matter as much as the prices, so map both before either goes under contract.
Loan maturity, a deed in lieu or a short sale can produce gain without any cash
Many office owners are selling because a loan is coming due and the building will not refinance. If the lender takes the building back, Reg. section 1.1001-2 counts a nonrecourse loan in full as the amount realized, whatever the building is worth, so a $9,000,000 nonrecourse balance on a $7,540,000 basis produces about $1,460,000 of gain with no money changing hands. A recourse loan is split differently: the amount realized is the building's value, and any debt forgiven above that is cancellation-of-debt income, taxed under its own rules and exclusions.
A short sale through a broker can produce a cleaner result than a deed in lieu, or a worse one, depending on the loan type and what the lender forgives. Get the loan documents to your CPA and tax counsel before you negotiate with the lender. Once the lender is involved, the order of events, and whether any cash reaches you at all, is harder to change.
How office buyers build their price: leases, leasing costs and the work a new owner must fund
Office buyers price a multi-tenant building from the leases in place, how long they have to run, and what it will cost to fill the vacant floors: tenant improvement allowances, leasing commissions and free rent. Those costs come straight off the price, and credits at closing for unfunded allowances you already promised reduce the cash you receive and therefore the size of the replacement you need. An owner-occupant selling to an investor can instead sign a lease and sell on that rent, which the sale-leaseback guide covers.
The buyer pool matters too. Owner-users price on what it would cost them to build or lease elsewhere; investors price on income; converters price on what the building could become. Ask your broker which buyer the price assumes, because each brings a different timeline to closing and to your exchange.
A worked comparison at $9,000,000 with a $6,000,000 loan: the debt is the hard part
Hypothetical, round numbers, continuing the example above. The building nets $9,000,000 and a $6,000,000 loan is paid off at closing, so only about $3,000,000 reaches the intermediary. That is the office seller's usual shape after a weak decade: modest equity, a large loan and a gain made almost entirely of depreciation.
To defer the whole $1,460,000 gain, the replacement must cost at least $9,000,000 and carry at least $6,000,000 of debt, or the owner must add cash to cover any shortfall, under Reg. section 1.1031(d)-2. Buying a smaller, unleveraged replacement with the $3,000,000 leaves $6,000,000 of debt relief as boot, which would make the whole gain taxable, since boot is recognized up to the realized gain.
One way through is a barbell: part of the equity in a high-leverage structure that carries most of the required debt, and the rest in income-producing trusts with moderate loans. Another is a partial exchange that accepts some tax in return for less leverage. Which is better depends on your income needs and appetite for debt, and the figures should be checked by your CPA against your own basis and state before you sign the purchase agreement.
If the gain is worth deferring, the replacement usually leaves office behind
All US investment real estate is like kind, so office equity can move into industrial, multifamily, medical office or net-leased retail. Interests in traditional DSTs spread the equity across sponsors and property types with minimums the firm lists at $100,000 to $250,000 per trust; the firm's industrial and medical office pages describe two common landing spots. A DST interest is illiquid and sponsor-controlled, its payments are not assured, and investors can lose principal.
Owners paying off a large office loan must also replace the debt. A small allocation to a high-leverage, zero cash flow trust on the firm's cash out DST page can carry that debt so the rest of the equity stays unleveraged. Owners selling a retail center at the same time should read selling a strip center or retail building, and those with a medical tenant base, physicians selling a medical office building.
Related questions
I paid more for the building than I am getting. Can I still owe tax?
Yes, if the depreciation you claimed is larger than the drop in price. Compare the net price with your adjusted basis, not with the purchase price; the difference is the gain, and most of it is taxed at up to 25 percent.
Can I do a 1031 exchange on a building I am selling at a loss?
You can, but you would lose the use of the loss, because section 1031 recognizes neither gain nor loss. A taxable sale usually produces an ordinary section 1231 loss and frees suspended passive losses, which is the better result for most owners.
What if my lender takes the building back?
With a nonrecourse loan, the full balance is treated as the amount realized, so you can owe tax on a gain even though you receive nothing. With a recourse loan, any forgiven debt above the building's value is cancellation-of-debt income instead. Talk to tax counsel before agreeing to a deed in lieu.
Does the five-year section 1231 lookback affect my next sale?
It can. For five years after a net section 1231 loss, later net section 1231 gains are ordinary income up to the loss not yet recaptured. Deferring the later gain with an exchange keeps it out of that calculation until a future taxable sale.
We occupy the building ourselves. Does that change anything?
Owner-occupied business property qualifies for an exchange the same way, and the gain and loss rules are the same. The office building property page covers selling the building with the business.
Sources
Checked against these publications on November 8, 2026. Rules and figures change; confirm the current version with your CPA or attorney before you act. This page is general information, not tax or legal advice.
- 26 U.S.C. section 1031, Exchange of real property held for productive use or investment
- 26 U.S.C. section 1231, Property used in the trade or business and involuntary conversions
- 26 U.S.C. section 469, Passive activity losses and credits limited
- 26 U.S.C. section 461, General rule for taxable year of deduction (excess business losses)
- 26 U.S.C. section 168, Accelerated cost recovery system (recovery periods; lessor improvements)
- Treas. Reg. section 1.1001-2, Discharge of liabilities
- Treas. Reg. section 1.1031(d)-2, Treatment of assumption of liabilities
- IRS Topic No. 409, Capital gains and losses



