Sale of S Corporation Stock Mid-Year: Basis, Income Allocation, and Gain

Selling S corporation stock mid-year has three tax implications you have to work through in order: finalize your stock basis as of the sale date, agree with the buyer on how the corporation’s annual pass-through income gets split between you, and report the resulting gain or loss at the correct character and rate. The allocation method alone can shift thousands of dollars between the parties, and a wrong basis figure can turn a modest gain into a large one. What follows covers federal treatment; state rules layer on top.

Finalizing Your Stock Basis as of the Sale Date

Your stock basis is the running total of your tax investment in the corporation. It begins with what you paid for the shares (cash plus the adjusted basis of any property you contributed) and moves every year with the corporation’s activity. Before the sale closes, you need this number pinned down as of that date, because it drives whether you have a taxable gain or a deductible loss.1Internal Revenue Service. S Corporation Stock and Debt Basis

Adjustments run in a specific order, and the order matters:

  • Increases first: your share of ordinary business income, separately stated income items (interest, capital gains), tax-exempt income, and any additional capital you contributed during the year.
  • Distributions next: subtract cash and property distributions you received.
  • Non-deductible expenses: subtract your share of items like penalties or the disallowed half of meals.
  • Losses last: subtract your share of losses and deductions, but only down to zero. Basis never goes negative.

Income lifts basis before distributions and losses pull it down. Skip the sequence and a routine distribution can look fine on paper while actually exceeding basis and generating gain you didn’t expect.

When a distribution does exceed your stock basis, the excess is capital gain on your personal return. With no accumulated earnings and profits from a prior C corporation period, distributions are tax-free up to basis and gain above that. If the corporation carries accumulated E&P, distributions above the accumulated adjustments account can be dividends before the excess-over-basis rule takes over.2Office of the Law Revision Counsel. 26 USC 1368 – Distributions A large distribution shortly before closing needs to be run through these rules, since any gain from an excess distribution also cuts the basis you have left to offset gain on the stock itself.

One distinction trips people up: debt basis is not part of this calculation. A direct loan you made to the corporation creates a separate debt basis that can absorb pass-through losses, but only stock basis matters when you sell the shares.1Internal Revenue Service. S Corporation Stock and Debt Basis

Splitting the Year’s Income Between You and the Buyer

The S corporation files one annual return, but a mid-year sale means two people owned those shares at different times. The code offers two ways to divide the year’s income, losses, and deductions between you and the buyer. The choice shows up on each party’s K-1 and, through that, on each party’s basis calculation.

Per-Day Allocation (the Default)

Without an election, the corporation totals its annual income and loss as if nothing changed, divides by the days in the tax year, and assigns each day to whoever held the stock that day.

Simple, but it can drift from economic reality. If most income lands in the second half of the year, after you sell, part of it still comes to you based on your days of ownership. A big post-sale loss works the other direction and flows partly to you. Sellers sometimes prefer the default when they expect the corporation to generate losses or tax-exempt income after closing, because those items still reach the seller and either preserve or add to basis.

Closing of the Books Election

The alternative is a Section 1377(a)(2) election that treats the tax year as two separate periods, one ending on the sale date and the other starting the next day. The corporation performs an interim closing of the books to fix the actual income and deductions in each period.3Office of the Law Revision Counsel. 26 USC 1377 – Definitions and Special Rule

The election is only available when a shareholder’s entire interest terminates. Sell part of your shares and keep the rest, and this method is off the table. The corporation and all “affected shareholders” must consent, meaning you and whoever you transferred the shares to. If instead you sell your shares back to the corporation, the affected group grows to everyone who held stock at any point in the year.3Office of the Law Revision Counsel. 26 USC 1377 – Definitions and Special Rule

Once filed, it’s irrevocable. It’s the better answer whenever income is heavily concentrated on one side of the sale date, because each party is then taxed only on income earned during their own ownership. Which method to use is a standard point in the purchase agreement, since it moves real money between buyer and seller.

Calculating Your Gain or Loss

With basis finalized (including whatever income allocation you settled on), the formula is straightforward: sale price minus adjusted stock basis. The sale price includes cash plus the fair market value of any non-cash consideration. Positive is taxable gain; negative is deductible loss.

S corporation stock is a capital asset, so the result is capital in character. Holding period sets short-term versus long-term. One year or less gets ordinary rates; more than a year gets the preferential long-term rates.

A net capital loss first offsets other capital gains, then up to $3,000 of ordinary income each year ($1,500 if married filing separately).4Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses Anything left carries forward indefinitely.5Internal Revenue Service. Topic No. 409 Capital Gains and Losses

One boundary to know: S corporation stock does not qualify for the Section 1202 qualified small business stock exclusion. Section 1202 requires original issuance by a C corporation, so S shares are out regardless of company size or industry.

Rates and the 3.8% Net Investment Income Tax

For 2026, long-term capital gains rates depend on taxable income and filing status. Single filers pay 0% on taxable income up to $49,450, 15% up through $545,500, and 20% above that. For joint filers, the 15% bracket starts at $98,900 and the 20% bracket at $613,700. Short-term gains fold into ordinary income and can be taxed as high as 37%.

On top of the capital gains rate, higher-income sellers face the 3.8% net investment income tax when modified adjusted gross income tops $200,000 (single) or $250,000 (joint). Those thresholds aren’t indexed, so they catch more taxpayers each year.6Internal Revenue Service. Net Investment Income Tax

Gain on S corporation stock is generally net investment income for this purpose.7eCFR. 26 CFR 1.1411-4 – Definition of Net Investment Income There is an exception: gain attributable to a trade or business in which you materially participated (and that isn’t a financial trading operation) can be excluded. Proving material participation at the individual level takes documented hours. Passive investors should assume the surtax applies to the full gain. At the top bracket, the combined federal rate on long-term gain can hit 23.8%.

Suspended Losses Are Usually Forfeited

If your share of the corporation’s losses exceeded your combined stock and debt basis in earlier years, the excess was suspended and carried forward. Many sellers assume the sale is what finally unlocks them. It isn’t.

Suspended losses carry forward only “with respect to that shareholder” and are treated as arising in the following year. Sell your entire interest, and you have no basis in the next year for those losses to hit. The losses are permanently forfeited. The only exception is a transfer between spouses or incident to divorce, where the suspended losses ride with the stock to the new owner.8Office of the Law Revision Counsel. 26 USC 1366 – Pass-Thru of Items to Shareholders

If your suspended losses are meaningful, run the numbers on contributing additional capital before the sale to restore basis and free the deduction. Whether it pays depends on your marginal rate and the amount you’d need to put in, but walking away from a large stockpile of suspended losses without checking is a common and expensive miss.

Installment Sales When the Buyer Pays Over Time

If payments are spread across two or more tax years, you can use the installment method and pay tax on the gain as each payment comes in rather than all at once.9Internal Revenue Service. Form 6252, Installment Sale Income

The installment method is available for closely held S corporation stock. Stock traded on an established securities market doesn’t qualify; those sellers recognize the full gain in the year of sale regardless of the payment schedule.10Office of the Law Revision Counsel. 26 USC 453 – Installment Method

You report installment income on Form 6252 for the sale year and every year until the last payment. The form generates a gross profit percentage applied to each payment, spreading gain proportionally. A loss on the sale can’t use the installment method; losses are recognized entirely in the sale year.

One nuance: installment reporting only defers the gain on the stock. Your share of the corporation’s pass-through income for the part of the year you owned the shares is still taxable in the year of sale.

Section 338(h)(10) and 336(e) Deemed Asset Sales

Many S corporation deals allow the buyer and seller to jointly elect under Section 338(h)(10) to treat the stock purchase as if the corporation sold all its assets and liquidated. The transaction is recharacterized entirely: the corporation is deemed to sell assets at fair market value, distribute the proceeds to you, and wind up.

The buyer gets a stepped-up basis in the corporation’s assets, unlocking larger depreciation and amortization deductions. Your side changes too. Instead of one capital gain on stock, you recognize gain on a deemed asset sale, which can include ordinary income from depreciation recapture on equipment and other depreciable property. Because the trade-off tends to favor the buyer, sellers typically negotiate a higher price to make up for the less favorable character.

The election requires the buyer to be a corporation that acquires at least 80% of the target’s voting power and value within a 12-month period. All S corporation shareholders must consent, including any who aren’t selling. The parties file Form 8023 jointly by the 15th day of the 9th month after the acquisition date.11Internal Revenue Service. Instructions for Form 8023

A related election under Section 336(e) plays a similar role without requiring the buyer to be a corporation. Individuals and partnerships can be purchasers, and the seller and the target corporation make the election without needing the buyer’s agreement. When the buyer isn’t a corporation, 336(e) is the only path to asset-sale treatment.

Built-In Gains Tax for Former C Corporations

If the corporation was previously a C corporation, or picked up assets from one in a tax-free transaction, an entity-level tax can apply to built-in gains recognized during the five-year period that starts with the first tax year of S status.12Office of the Law Revision Counsel. 26 USC 1374 – Tax Imposed on Certain Built-In Gains The tax lands on the corporation, but it cuts the after-tax income flowing through to shareholders.

It applies when the corporation disposes of assets it held at conversion and the sale price beats the asset’s basis on the conversion date. The rate is 21%. Assets acquired after the S election generally aren’t subject to it.12Office of the Law Revision Counsel. 26 USC 1374 – Tax Imposed on Certain Built-In Gains

This touches a mid-year stock sale in two places. A Section 338(h)(10) election that creates a deemed asset sale can trigger the built-in gains tax on converted C corporation assets, shrinking net proceeds. And even without that election, if the corporation sells appreciated assets during the year before the stock changes hands, the built-in gains tax reduces the income flowing through on your final K-1. Past the five-year recognition period, the tax no longer applies.

Reporting the Sale

You and the corporation have separate filings, and mismatches between them tend to invite IRS letters.

What You File

Report the stock sale on Form 8949 with acquisition date, sale date, proceeds, and adjusted basis.13Internal Revenue Service. Instructions for Form 8949 Net gain or loss flows to Schedule D of your Form 1040.14Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets Installment sellers also file Form 6252 for the sale year and each year a payment comes in.

Your share of the corporation’s pass-through income for the portion of the year you owned the stock is reported separately, using the final Schedule K-1. Don’t combine the K-1 income with the gain on the stock sale; they’re independent.

What the Corporation Files

The corporation issues you a final Schedule K-1 (Form 1120-S) showing your allocated share of income, losses, deductions, and credits through the date your ownership ended, with the “Final K-1” box checked.15Internal Revenue Service. Schedule K-1, Form 1120S (Final) The numbers on it depend entirely on which allocation method was used.

If a closing-of-the-books election was made, the corporation attaches an election statement to its Form 1120-S for the year. The statement declares the year is being treated as two separate tax periods under Section 1377(a)(2), is signed by a corporate officer, and includes written consent from all affected shareholders.16GovInfo. 26 CFR 1.1377-1 – Pro Rata Share Without the documentation, the IRS falls back on per-day allocation, which can reallocate income in ways nobody at the closing table wanted.

Retain the interim balance sheet and income statement prepared at the termination date along with the working papers behind the basis calculation. The taxpayer carries the burden on both basis and allocation, so records built at the time are worth more than reconstructions later.