Tools › Investing › Saving and Planning › Capital Gains and Tax Lots › Example

Which lots a sale takes and the gain that results: six lots, 120 shares sold, first in first out against the other methods

ToolCapital Gains and Tax Lots
SourceIllustrative data: six made-up purchase lots (not market data). Rules as described in Internal Revenue Service (2026). Investment Income and Expenses (Including Capital Gains and Losses). Publication 550, for use in preparing 2025 returns, chapter 4 (holding period; identification of shares; Table 4-2).
LevelUndergraduate

Problem

An investor holds six lots of one stock bought between March 2022 and July 2026 and sells 120 shares at 122.00 on 10 November 2026. Under first in, first out, which lots are taken, what is the gain or loss on each, is it short-term or long-term by the one-year holding rule, and what is the tax at illustrative rates of 24 % (short-term) and 15 % (long-term)? What does the same sale give under last in first out, highest cost and lowest cost?

Inputs to Enter

  • Lots (date, shares, cost per share): 2022-03-15, 50, 82.00; 2023-06-20, 40, 95.50; 2024-11-05, 60, 118.25; 2025-08-12, 30, 131.40; 2026-02-18, 45, 104.75; 2026-07-09, 25, 126.00
  • Sale date 2026-11-10, 120 shares at 122.00; method first in, first out; specific-lot list 2, 4, 6, 5
  • Illustrative tax rates: short-term 24 %, long-term 15 %
Open the Capital Gains and Tax Lots tool (loaded with this example)

Answers

  • FIFO takes 50 shares of lot 1, 40 of lot 2 and 30 of lot 3: gains 6,100.00 − 4,100.00 = 2,000.00, 4,880.00 − 3,820.00 = 1,060.00 and 3,660.00 − 3,547.50 = 112.50
  • Holding periods 1,701, 1,239 and 735 days; lot 1 is long-term from 2023-03-16 (the count starts the day after purchase), so all three gains are long-term
  • Short-term 0.00, long-term 3,172.50; check 14,640.00 − 11,467.50 = 3,172.50; tax 0.15 · 3,172.50 = 475.88; proceeds left 14,164.13
  • Lots that remain: 130 shares, cost basis 15,353.25, unrealised gain at 122.00 of 506.75
  • Last in, first out (lots 6, 5, 4, 3): short-term 676.25, long-term −207.00, tax 0.24 · 469.25 = 112.62
  • Highest cost first (lots 4, 6, 3, 5): short-term −13.75, long-term −57.00, a net loss of 70.75 and no tax on the sale; lowest cost first (lots 1, 2, 5): 517.50 and 3,060.00, tax 583.20
  • Advanced: average cost 26,820.75 / 250 = 107.2830 a share, gain 1,766.04; with a purchase of 20 shares 14 days after the sale, last in first out has 80.00 of loss disallowed as a wash sale and added to the basis of the new shares

Notes

The tool's default inputs are this case; press Submit. The lots are made up. The tool also reproduces the printed examples of Publication 550: Table 4-2 (FIFO basis 5,000; average basis 4,660.98, printed 4,662 with the average rounded to 22.20), the holding-period example and the wash-sale examples (test_capital_gains_tax_lots.php), and is checked against an independent Python reference. The page illustrates general U.S. federal rules and the entered tax rates; it is not tax advice.