How to Calculate Capital Gains on an Employee Stock Purchase Plan

by C. Taylor

An employee stock purchase plan presents an offer to purchase stock at a given price, which is usually the current market price when the offer was made. Even if you exercise your right to purchase stock several months later, you can use the lower of the original offer price or the fair market price when you exercise your purchase rights. Most ESPPs offer an additional discount to this purchase. The difference between the your actual cost and the stock's price is considered ordinary income and does not add to your capital gains when you sell the stock. Your capital gains include only for the difference between your cost basis and the selling price, minus any fees.

Look on your W-2 forms or your ESPP statements for the market price used when purchasing the stock and the stock sale price. Also, look for the number of shares purchased and any broker fees. If you cannot find the market price used when purchasing the stock, you can use your actual cost and either the income portion or discount rate.

Divide the income portion of the sale by the number of shares, and then add the result to the actual cost to derive the market price per share. As an example, if your actual purchase price was $17 for each of 100 shares and your employer reported $300 in income, divide $300 by 100. Add the resulting $3 to your actual per-share cost to derive the market price of $20. Alternatively, If you knew your discount rate was 15 percent, subtract 0.15 from 1 and divide the result into $17. This calculates the same $20 market price. If you already know the market price, then omit this step.

Multiply the market price used when purchasing times the number of shares to calculate your cost basis. In the example, $20 times 100 shares calculates your $2,000 cost basis.

Multiply the price at which you sold the stock by the number of shares and subtract any fees. Continuing with the example, if you sold each share for $30 with a total $50 broker fee, multiply $30 times 100 and subtract $50. Therefore, your sales price is $2,950.

Subtract the cost basis from the sales price to derive capital gains. In the example, $2,950 minus $2,000 results in a $950 capital gains.


  • If more than one year has passed between the purchase and sale of the stock, you enjoy lower long-term capital gains tax. If you held the stock for one year or less, then you must asses short-term capital gains tax.