Say, for example, I bought 10 shares of stock XYZ on January 1, 2018 and I buy another 10 shares of the same stock on April 1, 2018. Then I wait until January 1, 2019 to sell all the shares of my XYZ stock. Would the long term capital gain tax affect only the first 10 shares I bought since I've only held those shares for 1 year? Or would it affect all 20 shares that I sold?
The long/short term distinction is made per lot. So you would pay long-term gains tax on the profit made from the first lot of 10 shares, and short-term capital gains tax on profit made from the second lot of 10 shares.