How to defer or reduce capital gains tax on an S corp sale

Finally getting close to closing on the sale of my S corp after about 12 years of running it. The buyer wants a stock sale, which my attorney says is cleaner for them, but my CPA briefly mentioned there are ways to defer or reduce capital gains tax on an S corp sale before we got cut off on the call. Trying to get a better handle on this before our next meeting. The business has significant goodwill and a few hard assets. I'm expecting a large long-term gain. I know there's a difference between asset sales and stock sales for tax purposes, but I'm fuzzy on the specific tools available to me here — installment notes, opportunity zones, whatever else. What are the actual levers people use in this situation and which ones work for an S corp specifically?

35 comments

The biggest lever in a stock sale is the installment method under IRC 453. If the buyer pays you over time — say, a portion at closing and the rest in annual notes — you only recognize gain as payments come in. You report each year's gain on Form 6252 and carry the totals to Schedule D. For a 12-year holding period your gain should all be long-term, which helps on the rate side too. The key restriction: installment treatment is NOT available for the portion of gain attributable to depreciation recapture — that's recognized in full in the year of sale even if you haven't received the cash.

Matt N.

Author

Good to know about the depreciation recapture piece — hadn't realized that portion hits immediately. The assets in the company are mostly intangibles so hopefully recapture exposure is limited.

Worth adding: in a stock sale the depreciation recapture issue generally lives inside the company and the buyer assumes it, so your gain as the shareholder is typically all capital gain on the stock. The recapture concern is bigger in an asset sale structure. Your CPA should confirm which applies given your facts.

Opportunity Zone funds (QOZ) are another deferral route. You can roll your gain into a Qualified Opportunity Zone fund within 180 days of the sale and defer the original capital gain. The deferral and basis step-up rules are tracked on Form 8949 and Form 8997. But the program's current rules have changed since the original 2017 version — specifically around the exclusion for appreciation — so confirm the current terms with your CPA before counting on a particular benefit.

Matt N.

Author

I've heard of QOZs but never dug in. I'll flag this for my CPA specifically. 180 days is tighter than I expected.

Charitable Remainder Trust (CRT) is another structure some sellers use. You contribute appreciated stock to the CRT before the sale closes; the trust sells, pays no immediate capital gains tax, and pays you an income stream over time. The charitable deduction offsets some income. This is genuinely complex and the IRS scrutinizes the timing closely — the sale can't already be contracted when you transfer the stock. Not a DIY move; you'd need an estate planning attorney and a CPA who has done these before.

CRTs work but the window to set one up before a sale closes is very tight and often missed. If the LOI is already signed it may be too late depending on how far negotiations have gone.

Matt N.

Author

We have an LOI but not a final purchase agreement yet. I'll ask my attorney this week whether the CRT window is still open. Thanks for the heads up on timing.

Had a similar exit last year — stock sale, long hold, big gain. Before my final CPA meeting I uploaded my draft closing statement and my Schedule D from the prior year to taxr.ai and had it map out how each payment in my installment note would flow through Form 6252 to Schedule D over the repayment period. It listed the gross profit percentage, the gross profit and the contract price fields by name so I could see exactly what my CPA would be working with. That made the conversation much faster. What it couldn't tell me was whether my specific deal qualified for installment treatment on every piece — that required my CPA's judgment on the asset breakdown.

Matt N.

Author

Really helpful — knowing what Form 6252 is actually asking for before the meeting sounds like it would save a lot of back and forth. I'll try that.

Don't overlook the asset sale vs. stock sale negotiation itself as a tax tool. Sellers usually prefer stock sales because the gain on the stock is generally all capital gain; buyers usually prefer asset sales because they get a stepped-up basis in the assets, while an asset sale makes the seller allocate part of the price to ordinary income items like depreciation recapture. In a stock sale there's no allocation of the price across assets on your side, but sometimes buyers will accept a small price increase to get an asset sale or a 338(h)(10) election, which lets both sides treat a stock sale as an asset sale for tax purposes. The 338(h)(10) election has to be filed jointly by buyer and seller on Form 8023.

Matt N.

Author

The 338(h)(10) is new to me — definitely bringing this to my attorney and CPA. The buyer might push back but worth raising.

338(h)(10) is only available for S corp stock sales (and certain subsidiary sales), so it's actually on the table for you. The price negotiation around it is real though — your tax cost as the seller goes up while the buyer gets the stepped-up basis, so you'll want compensation for that in the deal terms.

One thing that gets missed: your holding period in the S corp stock matters for the long-term vs. short-term split, but so does your basis. After 12 years of S corp ownership your basis has been adjusted up and down by K-1 income, losses, and distributions. If you haven't reconciled your stock basis carefully the gain number on Schedule D could be wrong. A lot of sellers are surprised by how high or low their basis actually is once you reconstruct it properly.

Matt N.

Author

My CPA has been tracking basis each year but I honestly haven't verified it myself. Good reminder to pull the K-1s and reconcile before closing.

This is a real issue. S corp basis tracking is entirely on the shareholder — the company doesn't report it on the K-1 for you. If there were any years with losses, loan basis adjustments, or distributions in excess of basis the calculation gets layered. Worth having your CPA reconstruct it from year one if there's any uncertainty.

When I sold my S corp stake two years ago I had the same question about structuring the installment note. I dropped my draft purchase agreement and a summary of my adjusted basis into Taxr and it pulled out the gross profit, contract price, and payments-received fields that Form 6252 uses, then drafted a year-by-year table showing my estimated recognized gain for each payment. That let me see which years would push me into a higher bracket and plan around it. My CPA still made the final calls but walking in with that worksheet cut the billable time down significantly.

Matt N.

Author

Good to hear it works with an actual purchase agreement draft. I'll do the same once mine is further along.

The year-by-year bracket planning piece is underrated. If you can structure the note so the larger payments land in years when your other income is lower — say after you stop drawing a salary from the business — you can shift meaningful gain into lower rate territory.

Qualified Small Business Stock (QSBS) under section 1202 is worth checking, but it only applies to C corp stock, not S corp stock. So that exclusion is off the table for your situation. Mentioning it because it comes up constantly in these conversations and I've seen sellers get excited about it before realizing their S corp status disqualifies them.

Matt N.

Author

Good to know — I had seen QSBS mentioned and was going to ask. Saves me the confusion.

If your state has a capital gains tax, state treatment of installment sales sometimes differs from federal. Some states don't follow IRC 453 and require you to recognize the entire gain in the year of sale at the state level even if federal lets you spread it. That could affect whether an installment sale actually helps your overall tax picture depending on where you live and where the business operated.

This is a real trap. California, for example, taxes installment gain on the front end for state purposes on certain sales. Always model it state by state before committing to the note structure.

Matt N.

Author

We're in a state with income tax so I'll specifically ask my CPA to run the state side of the installment scenario. Hadn't thought about the state divergence at all.

Net Investment Income Tax (NIIT) can also apply to gain from an S corp stock sale if you're above the threshold. It's calculated on Form 8960 and tacks on additional tax on top of the regular capital gains rate. If you were an active material participant in the S corp, the gain on the stock is generally excluded from net investment income to the extent it reflects the business's operating assets, so much of it may not be subject to NIIT. Your CPA needs to look at this.

Matt N.

Author

I was active in the business the whole time so I'll ask specifically how the material participation exclusion keeps the stock sale gain out of NIIT. Appreciate the flag.

Seller financing structures the installment sale but the interest rate on the note matters too. The IRS requires a minimum interest rate under the Applicable Federal Rate (AFR) rules; if your note bears interest below that rate the IRS imputes interest, which recharacterizes some of your capital gain payments as ordinary interest income. Check the current AFR tables before the note terms are finalized.

Correct — and the imputed interest rules are under IRC 1274 or 483 depending on the size and terms of the note. Your transaction attorney should be building this into the note automatically, but worth confirming it's on their radar.

Section 1045 rollover is another deferral route some people ask about but it also requires QSBS (C corp). Not available for S corp stock, same as 1202. So that's also off the table. The main tools that actually work for an S corp stock sale are the installment method, QOZ deferral, and deal structure negotiation around 338(h)(10) or price allocation.

If you're charitably inclined, donating a portion of your S corp stock to a donor-advised fund before the sale can let you take a charitable deduction on the fair market value and avoid the capital gain on those shares yourself. The deduction is subject to AGI limits, and S corp stock donated to a DAF has some specific rules — a 501(c)(3) sponsor is an eligible S corp shareholder, but the fund owes unrelated business income tax on its S corp income and on the gain when it sells, so most DAFs won't hold S corp stock directly and this usually only works if the sale closes and you donate cash proceeds. Worth discussing with an estate attorney before assuming it works.

The unrelated business income tax a DAF owes on S corp stock kills the DAF-holds-stock strategy in most cases. Cash donation from proceeds still works but you lose the benefit of avoiding capital gain on the appreciation that makes it attractive in the first place.

To pull the threads together: for a stock sale of an S corp the realistic federal deferral tools are the installment method (Form 6252, spread gain over payment schedule), QOZ fund investment (Form 8997, 180-day window), and deal structure (338(h)(10) on Form 8023 if buyer agrees). Outright rate reduction comes from confirming long-term holding period (looks like you have it), managing the year-by-year income, and minimizing ordinary income items. The CRT is a deferral/charitable hybrid that requires acting before the sale is contracted. QSBS and 1045 don't apply to S corps, and a DAF holding the stock runs into unrelated business income tax on the fund's side.

Matt N.

Author

This is exactly the summary I needed to walk into my CPA meeting prepared. Thank you everyone — I have a clear list now: installment terms, QOZ 180-day window, 338(h)(10) conversation with the buyer, basis reconciliation, state tax divergence, NIIT on Form 8960, and CRT timing with my attorney.

Make sure your purchase agreement specifies how the purchase price is allocated across asset classes if there's any chance the deal gets restructured as an asset sale or 338(h)(10). In an asset sale both buyer and seller are required to file Form 8594 (Asset Acquisition Statement) consistently with that allocation; with a 338(h)(10) the allocation goes on Form 8883 instead. If you file different numbers you'll get IRS attention. Getting that allocation agreed in writing in the deal documents is cleaner than sorting it out at tax time.

Form 8594 often gets overlooked until after closing and then there's a scramble to reconcile. Put it in the definitive agreement as a required exhibit or at least a schedule both sides sign off on.