Employee stock purchase plan sales get taxed in two pieces: a slice of ordinary income reported on your W-2, and a capital gain or loss on top of it. Which slice is bigger depends on when you sell. The ESPP tax examples below use one consistent set of numbers so you can see exactly how a qualifying sale and a disqualifying sale produce very different bills on the same shares.
The Base Scenario
Every example uses a Section 423 plan with a lookback and a 15% discount:
- Grant (offering) date: January 1, 2024, stock price $50
- Purchase date: June 30, 2024, stock price $60
- Purchase price: 85% × $50 (the lower of the two prices) = $42.50 per share
The lookback is where most of the benefit sits. Because the stock climbed between January and June, the plan calculates your discount from the lower January price, giving you a bigger break than a plain 15%-off-today purchase would.1Office of the Law Revision Counsel. 26 USC 423 – Employee Stock Purchase Plans
Two numbers from this setup will come back repeatedly:
- The grant-date discount: $50 − $42.50 = $7.50 per share
- The purchase-date spread: $60 − $42.50 = $17.50 per share
Which one becomes your ordinary income depends entirely on how long you hold the shares before selling.
The Two Holding Periods
A sale qualifies for the better tax treatment only when both of these clocks have run out before you sell:1Office of the Law Revision Counsel. 26 USC 423 – Employee Stock Purchase Plans
- Two years from the grant (offering) date
- One year from the purchase date
In the base scenario, the one-year-from-purchase date is June 30, 2025, and the two-year-from-grant date is January 1, 2026. The later one controls, so the earliest qualifying sale date is January 1, 2026. Sell any day before that and the entire transaction becomes a disqualifying disposition.
Qualifying Sale with Appreciation
Sell on February 1, 2026, at $75 per share. Both holding periods are satisfied, so the IRS caps your ordinary income at the lesser of:2Internal Revenue Service. Stocks (Options, Splits, Traders) 5
- The grant-date discount: $50 − $42.50 = $7.50
- The actual gain: $75 − $42.50 = $32.50
Ordinary income is the smaller figure: $7.50 per share. That amount appears as wages on your W-2 for 2026.
Add the $7.50 to the $42.50 you originally paid, and your adjusted cost basis becomes $50.00. The remaining $25.00 of gain ($75 − $50) is a long-term capital gain, taxed at 0%, 15%, or 20% depending on your total taxable income.3Internal Revenue Service. Topic No 409, Capital Gains and Losses
You made $32.50 per share, but only $7.50 of it got taxed at ordinary rates. The qualifying holding period converted $25.00 of what would otherwise be ordinary income into long-term capital gain.
Qualifying Sale at a Loss
Same timing, but the stock drops and you sell on February 1, 2026, at $40 per share. Both holding periods are still met.
- Grant-date discount: $7.50
- Actual gain: $40 − $42.50 = −$2.50 (a loss)
- Ordinary income: lesser of $7.50 or −$2.50 = $0
No gain means no ordinary income to report. Your cost basis stays at the $42.50 you paid, and the full $2.50 per share is a long-term capital loss, deductible against other capital gains or up to $3,000 of other income in the current year.4Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses
Disqualifying Sale with Appreciation
Now sell on October 15, 2024, at $75 per share. That’s less than four months after the purchase date, so the sale is disqualifying.
The ordinary-income cap disappears. The entire purchase-date spread is wages:
- Ordinary income: $60 − $42.50 = $17.50 per share
- Adjusted basis: $42.50 + $17.50 = $60.00
- Remaining gain: $75 − $60 = $15.00, a short-term capital gain
Short-term capital gains are taxed at ordinary income rates because the shares were held under a year.3Internal Revenue Service. Topic No 409, Capital Gains and Losses Ordinary income from a disqualifying disposition is also subject to Social Security and Medicare taxes, which do not apply to qualifying-sale ordinary income.
Compare the two sales at $75:
- Qualifying: $7.50 ordinary + $25.00 long-term capital gain
- Disqualifying: $17.50 ordinary + $15.00 short-term capital gain (taxed at ordinary rates)
Same company, same sale price, very different tax outcome.
Disqualifying Sale After a Price Drop
This is the scenario that catches people off guard. Sell on October 15, 2024, at $55 per share, which is below the $60 purchase-date price but still above the $42.50 you paid.
- Ordinary income: $60 − $42.50 = $17.50 (still the full purchase-date spread)
- Adjusted basis: $42.50 + $17.50 = $60.00
- Capital result: $55 − $60 = −$5.00, a short-term capital loss
You pocketed $12.50 per share in actual gain ($55 − $42.50), yet the IRS taxes $17.50 as ordinary income and only lets you claim a $5.00 capital loss to offset it. The ordinary income number is anchored to the purchase-date market price, not to what the stock did afterward.
A qualifying sale at the same $55 price would have looked very different. Ordinary income would be the lesser of the $7.50 grant-date discount or the $12.50 actual gain, so $7.50. The remaining $5.00 would be a long-term capital gain. The qualifying holding period eliminates the mismatch between the taxable amount and what you actually earned.
Side-by-Side Summary
Four sales, same $42.50 cost basis, same shares:
- Sell at $75 after holding periods met: $7.50 ordinary income, $25.00 long-term capital gain
- Sell at $40 after holding periods met: $0 ordinary income, $2.50 long-term capital loss
- Sell at $75 before holding periods met: $17.50 ordinary income, $15.00 short-term capital gain
- Sell at $55 before holding periods met: $17.50 ordinary income, $5.00 short-term capital loss
In every disqualifying case, the ordinary income piece is the full $17.50 purchase-date spread regardless of the sale price. In every qualifying case, the ordinary income is capped at $7.50 or lower.
Why the Cost Basis on Your 1099-B Is Wrong
Working the examples above is only half the job. The other half is making sure you don’t pay tax twice on the ordinary-income piece when you file.
Your broker reports the sale on Form 1099-B, and the cost basis they list is almost always just the discounted price you paid ($42.50 in these examples). It ignores the ordinary income already added to your W-2. If you copy the broker’s basis straight onto Form 8949, the ordinary-income portion gets taxed twice: once as wages and again as a bigger capital gain.
The fix goes on Form 8949.5Internal Revenue Service. Instructions for Form 8949 If the broker did not report basis to the IRS, enter the correct adjusted basis (purchase price plus the W-2 ordinary income) in column (e). If the broker did report basis to the IRS, which is the more common case, enter the broker’s figure in column (e), put the difference as a negative adjustment in column (g), and use code “B” in column (f) to flag it.
For the qualifying sale at $75, the broker will typically show a $42.50 basis. The correct basis is $50.00. The $7.50 adjustment prevents the ordinary income from being taxed a second time. For the disqualifying sale at $75, the broker’s $42.50 becomes $60.00 after adjustment, a $17.50 correction.
The IRS has the 1099-B with the lower basis on file. If you skip the adjustment, you overpay, and no notice will ever arrive telling you so. The mistake only runs one direction.