Everyone I work with and people at other companies that I’ve talked to didn’t know this and have been double paying every year.
Note that not every situation is the same so please double check everything for you personally.
Anyway, to summarize, when you receive stock from an Employee Stock Purchase Program, your company generally includes the discount (e.g. 15% of the total or whatever your program is, and possibly more if you have a lookback provision) on your W-2 income. However when you sell the stock, and you import your consolidated 1099 from the brokerage, it will also include that discount in the capital gains income. The cost basis will be the cost of the stock when it was deposited.
Therefore if you just click through everything and submit your taxes without changes, that discount will be doubly included in your income.
What you want to do is look in your consolidated 1099 for a ‘supplemental information’ section, though sometimes it’s sent as a separate document. This will tell you the ‘true’ cost basis which is the reported basis plus the W-2 reported addition. This is not included automatically in the reported 1099 data because not ALL W-2s include the discount. So you need to manually edit that 1099 and change the cost basis to the one in the supplemental.
Voila, you reduced your tax burden by potentially thousands of dollars.
Note that if you did not sell right away (my preference is to do so), you may have additional profit/loss that isn’t included in the discount and is just additional capital gains/losses. The cost basis could still be higher or lower than your sell price in that case.
EDIT: I see several people saying the discount is listed on their W-2 as code DD (in the box 12 area). That is NOT related to the ESPP. It’s the cost of your employer sponsored healthcare. The discount is likely to be included in the Box 1 amount but not broken down on the form. I would expect to see it in Box 14 if anything, but this is definitely not always the case. For example, my employer does not put anything there.