Calculating Cost Basis ESPP

How to Calculate the Gross Profit Rate
Written By
Julia Fuller
Julia Fuller
Published: Jun 18, 2018
Updated: Aug 30, 2022
2 minute read

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.

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 .

Advertisement

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.

Tips

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

Warnings

Avoid paying excessive income taxes or income tax penalties. Calculate your cost basis correctly.

Julia Fuller

Julia Fuller began her professional writing career eight years ago covering special-needs adoption. She holds a bachelor's degree in accounting from Marywood College, is co-owner of GJF Rental Properties as well as a livestock and grain…

Sponsored
PocketSense Logo

PocketSense is the ultimate guide to managing your money, with expert information on how to decode your taxes, keep track of spending and stay financially responsible.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.