Home>Finance>How To Calculate Cost Basis For Stock Sold From An Employee Stock Purchase Plan
Finance
How To Calculate Cost Basis For Stock Sold From An Employee Stock Purchase Plan
Table of Contents
Your cost basis is the purchase price you actually paid (the discounted price) plus the ordinary income you recognized from the bargain element, which is the discount you received on the purchase date. This adjusted basis is often higher than what’s reported on your 1099-B, so you must adjust it on Form 8949 to avoid being double-taxed on the discount.
The simple cost basis formula for a qualifying disposition
For a qualifying disposition, meaning you held the shares at least two years after the offering date and at least one year after the purchase date, the formula is straightforward. Start with the actual discounted price you paid per share (the amount taken from your paycheck). Then add the bargain element, which is the difference between the fair market value (FMV) on the purchase date and that discounted price. The sum is your adjusted cost basis per share. For example, if your ESPP gave you a 15% price reduction on a purchase-date FMV set by the market at the time of your offering, you paid a per-share amount determined by your plan’s rules. Your bargain element is the spread between that FMV and your purchase price, so your adjusted basis equals the full FMV on the purchase date. When you sell later for a gain, your taxable gain reflects only the appreciation above that FMV, because the spread was already taxed as ordinary income in the year of purchase or the year you acquired the shares, depending on your plan’s terms. This matches the logic used throughout retirement & investment taxes (the hub for this topic: Retirement & Investment Taxes: What to Know and How to Handle It), where the goal is to avoid taxing the same income twice.
In plain terms, you don’t pay a levy on investment growth on the price reduction itself, you already paid ordinary income tax on it, so your basis must reflect that prior taxation. This is the single most common error when filing ESPP sales, and fixing it can save you from paying Uncle Sam twice on the same dollars.
What changes in a disqualifying disposition
If you sell the shares before meeting those holding-period rules, you have a disqualifying disposition. The cost basis calculation changes in one critical way: the entire price reduction, not just the bargain element, becomes taxable as ordinary income in the year of sale, and your basis is still the discounted price plus that same bargain element, but the price reduction is no longer deferred to a levy on investment growth treatment. In practice, this means your cost basis remains the same as in a qualifying disposition (discounted price + bargain element), but the ordinary income portion is reported on your W-2 or Form 1099-NEC, not on Schedule D. However, the bigger difference is that you lose the preferential rate on investment appreciation for the price reduction amount. For instance, if you bought at a reduced price when FMV was higher, then sold six months later for a modest gain, your price reduction is ordinary income, and your gain on appreciation is only the sale proceeds minus your adjusted basis. The tax impact is harsher because the price reduction is taxed at your marginal rate, which for most people exceeds the long-term rate on investment appreciation. This distinction matters when you’re planning your sale timing, especially if you’re also juggling other investment decisions like how are traditional IRA contributions and withdrawals taxed, the same principle of ordinary income vs. a levy on investment growth applies.
Why your 1099-B is probably wrong
Most brokers report the cost basis on your 1099-B as the discounted purchase price, the amount you actually paid, not the adjusted basis that includes the bargain element. This is because the IRS requires brokers to report the actual amount you paid, not the tax-adjusted figure. The result is an artificially low basis that makes your gain on appreciation look higher per share than it really is. To correct this, you must file Form 8949 and enter adjustment code B in column (g), which tells the IRS you’re increasing your basis by the ordinary income amount already reported. Write the adjustment amount in column (h) as a positive number, and the result flows to Schedule D. Failing to do this means you’ll pay a levy on investment growth on the price reduction a second time, once as ordinary income and again as part of your gain. This is a common audit trigger, but it’s also easily fixed. The same logic applies if you’re comparing strategies like a Roth IRA vs traditional IRA tax comparison at different income levels, where the type of tax treatment (ordinary vs. a levy on investment growth) changes your effective rate. For ESPPs, the 1099-B correction is non-negotiable for accuracy, and it’s a habit worth building before you also consider my 401k taxes if i leave my job before retirement, both involve understanding how basis and distributions interact.
The single most common error when filing ESPP sales is paying capital gains tax on the discount a second time because your 1099-B reports only the discounted purchase price as your cost basis, not the tax-adjusted figure that includes the bargain element you already paid ordinary income tax on.
Frequently asked questions
What if my broker already adjusted the cost basis for the ESPP discount?
Some brokers now report an adjusted basis that includes the bargain element, usually with a code in Box 6 of the 1099-B. If so, do not add the adjustment again, you’d overstate your basis. Check the box labeled “cost basis adjustment” or “non-dividend distribution” on your statement.
How do I handle ESPP shares sold in a disqualifying disposition if I forgot to adjust my W-2?
Your W-2 should already include the ordinary income from the price reduction, but if it doesn’t, you’re required to report it on Line 1h of Schedule 1. The gain on appreciation calculation on Schedule D uses the same adjusted basis, just ensure the ordinary income portion is not double-counted.
Can I use the average cost method for ESPP shares if I sold multiple lots?
Yes, but only if your broker supports it and you meet the holding period for a qualifying disposition. For disqualifying dispositions, you must use specific identification to match each lot’s purchase date, because the ordinary income amount varies by lot. Most brokers default to FIFO unless you elect otherwise. For a deeper dive into how these rules interact with your overall financial picture, see the broader topic of retirement & investment taxes: what to know and how to handle it, which covers the full range of strategies and pitfalls beyond just ESPP cost basis.