ESPP discount calculator: ordinary income vs capital gain on the sale
Your plan sold you shares at a discount and you sold them later. Enter the numbers and see how the gain splits.
How it works: you pay the market price less the discount. The discount is shares times the market price times the percent. The sale brings shares times the sale price. The total gain is the sale minus what you paid. Then it is split in two. In the first way, the whole discount is ordinary income, and the rest is capital gain or loss. In the second, ordinary income is the smaller of the discount and the total gain. Pick the way your own paperwork describes.
A gain in total can still be a loss in the capital part
The default buys 100 shares at a market price of $50 with a 15% discount. You pay $4,250.00. The discount is $750.00. The stock falls to $45 and you sell for $4,500.00. You made $250.00 in all. In the first way, $750.00 is ordinary income and the capital part is a $500.00 loss. The loss does not wipe out the income line.
The usual mix-up
The discount is a gift from the plan, but it is not tax free. The market can move after the buy. The tax label on the discount does not move with it. Employee stock options vs trading options covers the cousin. See cost basis and gifted stock cost basis for how basis works.
Follow along