When you sell, your gain or loss is the amount you receive minus your basis. If you do not say which shares you sold, the oldest shares in that account count as sold first. This default is called first in, first out (FIFO). To pick specific lots instead (specific identification), name them to your broker by the settlement date and get its written confirmation. The average cost method is allowed only for mutual fund shares and dividend reinvestment plan shares.
For shares you get as pay, basis is what you paid plus the income already taxed. RSU shares start with a basis equal to their value when delivered, so their basis is not zero. NSO shares start at the exercise price plus the spread taxed at exercise.
Brokers report basis to the IRS for stock acquired since January 1, 2011. For equity awards granted after 2013, though, the broker must leave out the income already taxed. If you use that basis unchanged, the same income is taxed twice. The fix is on Form 8949, with code B in column (f). If the basis was reported to the IRS, keep it in column (e). Enter the missing income in column (g), as a negative number.
Sources
- 26 U.S.C. § 1012, Basis of property: cost
- IRS, Publication 551, Basis of Assets
- 26 C.F.R. § 1.1012-1, Basis of property
- IRS, Instructions for Form 8949
Reviewed and updated September 2026. General information, not advice for your situation.