Selling a Business With Real Estate: Capital Gains Tax, Price Allocation and Opportunity Zone Options
Selling a business capital gains tax when real estate is included: how the price is allocated, how each asset is taxed, keeping the building, and OZ deferral.
When a business owner sells and the business owns or occupies real estate, a real estate agent is often working alongside a business broker, an attorney and a CPA. The real estate is frequently the biggest single asset, and how it’s handled changes the seller’s tax bill and options. This guide covers what agents should know.
It’s part of our series for agents. The hub is OZ talking points for your next listing appointment. For the investor side, see Opportunity Zones after selling a business.
Asset sale or entity sale
- Asset sale: the buyer buys the business’s assets, including the real estate. The price is allocated among the assets, and both sides report the allocation on Form 8594 (IRC §1060).
- Entity sale: the buyer buys the stock or LLC interests. The seller usually has capital gain on the shares, though part of a partnership interest sale can be ordinary income (IRC §751). The real estate stays inside the entity.
Which structure is used is a negotiation for the seller’s attorney and CPA. Your job is to know where the real estate sits and what it’s worth.
How each asset is taxed in an asset sale
| Asset | Usual treatment |
|---|---|
| Inventory and receivables | Ordinary income |
| Equipment, vehicles, fixtures | Mostly ordinary-income recapture under §1245 |
| Building | §1231 gain; the depreciation part at up to 25% |
| Land | §1231 or capital gain; no recapture |
| Goodwill built by the owner | Usually long-term capital gain |
| Non-compete payments | Ordinary income |
A higher allocation to the real estate and goodwill usually helps the seller, and a higher allocation to equipment usually helps the buyer. An appraisal of the real estate gives both sides a defensible number. The depreciation recapture calculator shows how the building portion breaks down.
Keep the building, or sell it?
Many owners keep the real estate and lease it to the buyer:
- The seller keeps rental income and a property they can sell, exchange or leave to heirs later.
- The buyer needs less cash at closing.
- Taxes are split between two sales in different years.
If the real estate does sell, it can be exchanged under §1031, but only the real property part: equipment, goodwill and other business assets don’t qualify (IRC §1031(a)). Timing rules are in the 1031 exchange 45-day rule.
Where an Opportunity Zone fund fits
A business sale often produces gain that a 1031 can’t touch, such as goodwill or the gain on shares. That’s where a qualified opportunity fund fits:
- The seller can invest an amount equal to the eligible capital gain and §1231 gain in a fund within 180 days (IRC §1400Z-2).
- Ordinary income, including §1245 recapture and inventory, isn’t eligible (Treas. Reg. §1.1400Z2(a)-1(b)(11)).
- An installment sale or earnout changes the timing; each payment can start its own 180-day period. The 180-day deadline calculator handles installment and partnership cases.
- For investments on or after January 1, 2027, the gain is deferred five years with a 10% basis step-up (30% for a qualified rural fund), and the fund’s appreciation can be excluded after 10 years. See the Opportunity Zone tax benefits guide.
A seller can also split the deal: exchange the building under §1031 and put the goodwill gain into a fund. Compare the options in the 1031 vs DST vs Opportunity Zone calculator. Owners of some C corporations may also qualify for the small business stock exclusion (IRC §1202), which the CPA should check first.
Agent checklist
- Who owns the real estate: the business, the owner personally, or a separate LLC?
- Is there an existing lease between the owner and the business? Is it at market rent?
- Will the buyer buy, lease, or need an option on the real estate?
- Get a real estate appraisal or broker opinion that both sides can use in the allocation.
- Coordinate dates with the business broker; the closing date starts the 1031 and Opportunity Zone clocks.
Related reading
- Capital gains tax on commercial property
- Capital gains tax on investment property
- OZ talking points for agents (series hub)
Sources: IRC §1060; IRS Form 8594; IRC §751; IRC §1245; IRC §1231; IRC §1031; IRC §1202; IRC §1400Z-2; Treas. Reg. §1.1400Z2(a)-1; IRS Publication 544.
Not tax advice.
Frequently asked questions
How is the sale of a business with real estate taxed?
Can a 1031 exchange cover the sale of a business?
Can the gain from selling a business go into an Opportunity Zone fund?
Should the owner keep the real estate and lease it to the buyer?
Get the OZ 2.0 Investor Guide
One email when major OZ 2.0 events happen — Treasury guidance, state filings, rule changes. Unsubscribe anytime.
Tools: 180-day rule calculator · Depreciation recapture calculator · 1031 vs DST vs Opportunity Zone calculator · all Opportunity Zone tools