Calculating Cost Basis ESPP

Calculating Cost Basis ESPP
••• boonchai wedmakawand/Moment/GettyImages

When purchasing stocks periodically throughout your career through an employer stock purchase plan, ESPP, calculating cost basis can get a little confusing. Stock purchase prices fluctuate with each purchase, so if you purchase stocks weekly through your employer for several years, you have many prices and quantities to track. Generally, you can either track the costs of specific shares and keep track of which you have sold or assume that your longest-held shares are the first sold. As with all IRS guidelines, they are subject to change, so please verify that current procedures remain the same before signing your income tax return.


  • If possible, update your stock purchases in a spreadsheet monthly to eliminate confusion or sorting through years of purchases, later. Keep all of your stock purchase records as long as you own your stock and for up to seven years after disposal of all shares.

Assessing Necessary Fees

Track each purchase, beginning with the first stock purchase, recording the dollars invested and the number of shares purchased. If fees were charged for the purchase, include those in the dollars invested. If you set up a spreadsheet and update it periodically with your stock purchases this method is not too hard.

However, if you have not done this, you will need to go through all of your records. If using spreadsheet software, set up a simple formula dividing the purchase price by the quantity purchased so you have a per share price.

Choosing Your Method

You can pick and track which particular individual shares to buy and sell over time, and use their exact cost basis when you sell. You generally will need to work with your broker to track the shares and make sure the right ones are sold when you make a sale. In order to complete this process, you will need:

  1. Purchase dates of stock
  2. Quantities of each purchase
  3. Purchase price at time of each purchase
  4. If dividends were reinvested, price of stock each time, and date
  5. Fees associated with purchases
  6. Current IRS Guidelines for Cost Basis

If you can't adequately identify the individual shares, you must use the "First in, First out" FIFO method of calculating the cost of each share when you make a partial sale of stock shares. The first stocks you purchased are deemed to be the first ones you will sell for cost basis purposes .

Working With Your Cost Basis

Subtract your cost basis from the sales price to determine if you have realized a gain or loss on the sale. Report this on your income tax. You can avoid paying excessive income taxes or income tax penalties by calculating your cost basis correctly.