Capital Gains on the Sale of an S Corporation
Selling an S-corporation creates a tax trap: the choice between an asset sale and a stock sale determines whether you pay ordinary income rates on inventory, accounts receivable, and equipment (asset sale) or capital gains rates on the equity itself (stock sale). Buyers prefer asset sales for their step-up in basis; sellers prefer stock sales to avoid double taxation. The S-corp structure itself offers no deferral on the gain—it passes through to shareholders at ordinary or capital rates depending on the sale mechanics.
The Two Paths: Stock Sale vs. Asset Sale
When you sell an S-corporation, you face a fundamental choice: sell your stock (your ownership interest), or sell the assets (the business itself). The tax outcome differs dramatically.
A stock sale is clean, in theory. You report the sale price of your shares minus your cost basis as a capital gain. You pay long-term capital gains rates (0%, 15%, or 20%) if you held the shares for over one year. No wages. No ordinary income. This is the seller’s preferred approach.
An asset sale is messier. You sell the individual assets—inventory, equipment, customer lists, goodwill, real estate, and cash. Each asset class is taxed differently. Inventory and accounts receivable typically produce ordinary income (taxed at your marginal rate, up to 37%). Equipment generates depreciation recapture (ordinary income up to 25%, then capital gains). Land and intangible assets are taxed as capital gains. The total is the sum of all these components.
The catch: buyers strongly prefer asset sales because they get to step up the basis of the assets to their purchase price, reducing their depreciation deductions and capital gains when they later sell or dispose of those assets. In contrast, a stock sale buyer inherits your old basis, giving the buyer no tax benefit. As a result, buyers will discount the purchase price to compensate for the lack of a basis step-up. Sellers who insist on stock sales often receive a lower valuation.
The Built-In Gains Tax: The S-Corp Triple Whammy
S-corporations created from C-corporation conversions are subject to the built-in gains tax—a special 21% corporate-level tax on appreciated assets sold within five years of conversion. This tax applies even in a stock sale.
Example: You operated as a C-corp with appreciated inventory and fixed assets worth $2 million (basis $500,000). You converted to an S-corp on January 1, 2024. On September 1, 2024, you sell the stock for $2 million. You have a capital gain of $1.5 million. Normally, you’d pay long-term capital gains tax at your individual rate (say, 20%), or $300,000.
But the built-in gains tax fires: the S-corp itself must pay 21% on the $1.5 million of appreciation, which is $315,000. This tax is paid at the S-corp level and reduces what flows to you. Additionally, the remaining $1.185 million flows to you as capital gain, taxed again at your individual rate. In effect, you pay corporate tax plus shareholder tax on the same appreciation—double taxation—even in a stock sale.
The built-in gains tax sunset after five years. If you sell in year six or later, it doesn’t apply. But if you convert and sell quickly, you’re hit with both layers.
Asset Sales: Ordinary Income on Operating Assets
In an asset sale, you compute the gain on each asset category separately.
Inventory and accounts receivable: These produce ordinary income (also called “recapture income”). If you bought inventory for $100,000 and sell it as part of the asset sale for $180,000, the $80,000 gain is ordinary income, taxed at your marginal rate (22%, 24%, 32%, 35%, or 37%, depending on your income level).
Depreciated property (equipment, buildings): Equipment that you’ve depreciated has basis reduced by your prior depreciation deductions. If you bought machinery for $200,000, depreciated it to a basis of $80,000, and sell it for $150,000, you have a $70,000 gain. The gain is split: depreciation recapture of up to $120,000 (the cumulative depreciation) is ordinary income at a 25% rate. Any gain above recapture is capital gains. In this example, the $70,000 gain is entirely recapture (you only depreciated $120,000 in total), so it’s all ordinary income.
Real property (land and buildings used in business): If you’ve taken depreciation on the building but not the land, only the building gain is subject to recapture. Land gains are capital gains. Suppose a rental building’s land has a basis of $100,000 and fair value of $300,000 (gain of $200,000, capital gain), and the building has a basis of $200,000 and fair value of $400,000 (gain of $200,000, of which $150,000 is recapture at 25% and $50,000 is capital gain).
Goodwill and intangible assets: These are typically capital gain (or loss) in an asset sale, though certain intangibles purchased or created in the business may be treated differently under Section 1245 and Section 1250 recapture rules.
Allocation and Purchase Price Allocation (PPA)
In any asset sale, the buyer and seller negotiate a purchase price allocation—a detailed breakdown assigning the total purchase price to each asset category. The IRS scrutinizes these allocations to prevent sellers and buyers from colluding to shift gains to lower-taxed categories.
The allocation must be consistent between buyer and seller, and it drives the taxation. If the buyer and seller agree that land is worth $500,000 of the $2 million sale price, the remaining $1.5 million is split among inventory, equipment, goodwill, and intangibles. A higher allocation to goodwill (capital gains treatment) benefits the seller; a higher allocation to inventory (ordinary income treatment) benefits the buyer. The purchase price itself is usually determined first, and then the allocation is negotiated within that total.
Stock Sales and the Built-In Gains Gotcha
A stock sale appears simpler: you sell your shares for a gain and pay capital gains tax. But S-corps are transparent for tax purposes, so appreciation in the underlying assets must be considered.
If your S-corp has never been a C-corp, no built-in gains tax applies. You simply report the stock gain at capital rates. Your cost basis in the stock is usually your original investment plus any retained earnings passed through to you over the years.
However, if the S-corp was converted from a C-corp, the built-in gains tax kicks in on the appreciated assets, regardless of whether you’re selling stock. The S-corp computes the built-in gains and pays the tax before distributing proceeds to you.
Also, sellers should be aware that in a stock sale, certain pre-conversion earnings in C-corp years can trigger “excess net passive income” tax if distributions exceed 25% of gross receipts. This is rare but can occur in stock sales of converted S-corps that retained significant cash.
Structuring to Minimize Tax
The interplay between buyer and seller preferences creates room for negotiation. If a buyer insists on an asset sale and you’re a shareholder, you might:
Price for the buyer’s tax benefit: Agree to a slightly lower price in exchange for accepting an asset sale, recognizing that the buyer’s basis step-up is worth something.
Use an installment sale: If you’re taking a note from the buyer rather than cash up front, you can spread the gain recognition over multiple years, reducing your annual income and possibly keeping you in a lower tax bracket.
Time the sale around the five-year built-in gains window: If your S-corp was converted from a C-corp, selling in year six or later avoids the built-in gains tax entirely.
Minimize recapture by careful depreciation: Some taxpayers use Section 179 deductions aggressively in early years, which accelerates depreciation and ordinary income later. Others preserve depreciation deductions by spreading them over longer useful lives. This doesn’t change the math fundamentally, but it can smooth income over time.
Seller Financing and Earnouts
When you receive an earnout—contingent payments based on future performance—or seller financing, the treatment depends on whether the sale is a stock or asset sale. In a stock sale, the earnout is typically additional stock gain. In an asset sale, earnouts are allocated to the asset categories, generating a mix of capital and ordinary income.
Seller notes (promissory notes you receive in place of cash) also defer gain recognition. If you receive a $1 million note due in installments, you can potentially use the installment sale method to spread gain recognition across multiple years.
See also
Closely related
- How to calculate capital gains on a stock sale — the stock gain formula applied to S-corp shares
- Depreciation recapture (investor) — ordinary income treatment on depreciated property gains
- Cost basis — your basis in S-corp stock and assets
- Section 179 deduction — accelerated depreciation affecting later recapture
Wider context
- Capital gains tax (investor) — capital gains rates for S-corp sales
- Long-term capital gain tax (investor) — preferential rates if you held stock over one year
- Tax bracket (investor) — marginal rates for ordinary income on asset sales
- Marginal tax rate (investor) — your rate on the next dollar of recapture income