Employee stock purchase plans (ESPP) allow you to purchase stock from a company that employs you, usually at a discount of up to 15 percent. When you sell your stock, the difference between your stock basis and the purchase amount is considered taxable capital gains. Because of the discount, you cannot use the stock's purchase price as the stock basis. Instead the fair market price is used, and any difference between that and the discounted price counts as taxable income.

Contact your employer's ESPP manager and ask for the purchase price, number of shares purchased and any broker's fees incurred in the transaction. This information may also be available on a distributed information form.

Look in box 1 of your W-2 form, which the employer should submit at the beginning of the year following the purchase. The amount in box 1 should represent the stock's bargain element, which is the difference between the purchase price and the fair market value. Box 1 may also include salary, which is repeated in box 3 except without the bargain element included. If this is the case, subtract the amount in box 3 from box 1 to derive the bargain element.

Multiply the number of shares by the purchased price, then add the bargain element. If you incurred a broker's fee during the transaction, subtract it from this total. This gives you the total cost basis.

Divide the total cost basis by the number of shares to derive the cost basis per share.