Specific Lot Identification: Pick Which Shares You Sell and Save
TL;DR: When you sell part of a position bought at different prices, the lots you choose decide your gain. Set your broker's default to specific identification or highest-cost-first, and confirm the lots at the time of sale to keep gains small and losses useful.
Educational only, not tax, legal, or investment advice. Examples are illustrations, not predictions. Rules and limits change; verify current figures and talk to a qualified professional about your situation.
If you have bought the same fund every month for ten years, you do not own one position. You own 120 little positions, each with its own price and date. When you sell some shares, the tax code needs to know which ones. That choice, the cost basis method, can turn the same sale into a big gain, a small gain or even a loss.
This guide compares the main methods, explains how to set specific identification at a broker, shows when highest-in, first-out (HIFO) is smart and when it is not, covers the special average cost rule for mutual funds, and works an example. It fits into the broader capital gains tax planning playbook and the tax planning guide.
CPA Warning Label: FIFO is the tax method for people who enjoy paying tax on their oldest, cheapest shares. That is not a club you need to join.
FIFO vs average vs spec ID
| Method | How it works | Where allowed | Tax effect |
|---|---|---|---|
| First-in, first-out (FIFO) | Oldest shares sold first | Default for stocks if you do not specify | In rising markets, oldest shares often have the lowest basis, so gains are largest |
| Average cost | Basis is the average of all shares | Mutual funds, dividend reinvestment plans, and many brokers' fund default | Middle-of-the-road; simple but inflexible |
| Specific identification | You name the exact lots at the time of sale | Stocks, ETFs, mutual funds (if adequately identified) | Most control; can minimize gains or harvest losses |
| HIFO, LIFO, tax-sensitive | Broker-automated versions of specific ID | Offered by many brokers | Systematic choice without picking each lot |
According to IRS Publication 550, if you cannot adequately identify the shares you sold, the basis is that of the shares acquired first. Specific identification requires that you tell the broker which shares to sell at the time of the sale and receive written confirmation within a reasonable time.
How to set it at your broker
Change the default
Most brokers let you set a default cost basis method for each account, and sometimes for each security. Look for "cost basis method," "tax lot method" or "lot relief method" in account settings. Options often include FIFO, LIFO, HIFO, average cost, "tax-sensitive" and "specific lot."
Choose lots at the time of trade
When you place a sale, the order screen often offers "choose specific lots." You see each lot's purchase date, cost, quantity and whether the gain or loss is short-term or long-term. Pick the lots, then submit. The confirmation should show the lots selected.
Timing rules
- You must identify lots no later than the settlement date of the sale. You cannot decide in April which lots you sold in October.
- For mutual funds, if you elect average cost, the election generally applies to all shares of that fund in that account. Switching away from average cost is possible prospectively; check the broker's rules and Publication 550.
- Shares transferred between brokers bring basis information with them for covered securities purchased after the cost basis reporting rules began (2011 for stocks, 2012 for most funds). For older shares, keep your own records.
HIFO strategy
Highest-in, first-out sells the lots with the highest cost first. In a portfolio that has mostly gone up, that usually produces the smallest gain, or a loss, on each sale. For people funding retirement spending from a taxable account, HIFO stretches the low-gain shares across many years.
When HIFO is not best
- Short-term vs long-term. The highest-cost lots may be recent and short-term. A small short-term gain taxed at 24% can cost more than a slightly larger long-term gain at 15%. Tax-sensitive methods weigh the holding period too.
- 0% bracket years. If you have room in the 0% long-term bracket, you may want to sell the lowest-basis long-term lots instead, using cheap room to clear out the biggest embedded gains. See 0% capital gains harvesting.
- Charitable giving. Your lowest-basis lots are the best ones to give to charity or a donor-advised fund. Keep them for that purpose and sell the high-basis lots for spending.
- Estate planning. Very low-basis lots held until death get a step-up in basis, so it can make sense to never sell them.
Harvesting with lot ID
Specific ID lets you harvest losses even in a position that is up overall. If you bought a fund at the peak and it has since dipped below that price, those lots may be underwater while older lots show gains. Selling only the underwater lots books a loss. Watch the wash sale rule: any purchase of the same fund within 30 days, including reinvested dividends, can disallow part of the loss.
Mutual funds
Mutual funds have a special option: average cost basis. Many fund companies make it the default. It is easy because you do not track lots, but it removes the ability to pick high-basis lots or harvest underwater lots in a rising position.
Things to know
- Average cost uses the average basis of all shares in the account, recalculated as you buy more.
- Under the cost basis rules for covered shares, changing from average cost to another method is generally prospective: shares already acquired may stay under average cost. Read your broker's disclosure before switching.
- Individual stocks generally cannot use average cost (dividend reinvestment plan shares are the exception), and broker support for ETFs varies; without it they use FIFO by default or another method you choose.
- Reinvested distributions create new lots. Over years, a fund with reinvested dividends can have hundreds of lots, which makes spec ID especially valuable.
When average cost is fine
If you plan never to sell a fund before retirement and will spend down the whole position, the difference between methods may be small over your lifetime. If you want precise control over gains each year, use specific ID from the start.
Record keeping and common mistakes
Specific identification only works if the records exist. For covered securities, brokers track basis and report it to the IRS on Form 1099-B. For older noncovered shares, shares received as gifts or inheritances, and shares moved between brokers before the reporting rules, the burden is on you. Keep the original purchase confirmations or statements, records of reinvested dividends, and any basis adjustments from wash sales, return of capital distributions or corporate actions such as spin-offs.
Mistakes to avoid
- Setting HIFO and forgetting about the charity plan. An automated method can sell the very lots you meant to keep. Review lots before each large sale.
- Double-taxing stock compensation. For RSUs and ESPP shares, the broker's reported basis may exclude the income already on your W-2. Adjust basis on Form 8949 so you are not taxed twice.
- Ignoring inherited lots. Inherited shares should carry the date-of-death value as basis. If the broker shows the decedent's original cost, request a basis update.
- Trading in the wrong account. Lot selection matters only in taxable accounts. In an IRA or 401(k), the method does not affect your tax.
Example
Illustration: selling $30,000 of an index fund
Robin needs $30,000 from a taxable account in 2026 and holds 600 shares of an ETF now priced at $100. The lots:
| Lot | Purchased | Shares | Cost per share | Term |
|---|---|---|---|---|
| 1 | 2016 | 200 | $40 | Long-term |
| 2 | 2021 | 200 | $90 | Long-term |
| 3 | April 2026 | 200 | $105 | Short-term |
Robin sells 300 shares for $30,000:
- FIFO: 200 shares from Lot 1 ($12,000 gain) plus 100 from Lot 2 ($1,000 gain) = $13,000 long-term gain. At 15%, about $1,950.
- Average cost (if it were allowed for this ETF): average cost about $78.33; gain about $6,500.
- HIFO: 200 shares from Lot 3 (a $1,000 short-term loss) plus 100 from Lot 2 ($1,000 long-term gain). Net zero gain, no tax, and the short-term loss nets against the gain first.
Same sale, same $30,000 of cash, gains ranging from $0 to $13,000. If Robin later wants to donate shares, Lot 1's $40 basis makes it ideal for a donor-advised fund.
Illustration only. Wash sales, state taxes and your brokerage's rules can change the result.
Not to be confused with 1031 identification
Real estate investors also hear about "identification," but that is a different rule: the 45-day window to identify replacement property in a like-kind exchange. See 1031 identification rules.
FAQ
What is specific lot identification?
It is a cost basis method where you tell your broker exactly which shares to sell, by purchase date and price, at the time of the sale. It lets you control the size and type of your gain or loss.
What is the default cost basis method?
For stocks and ETFs, FIFO generally applies if you do not identify specific shares. Many mutual fund companies default to average cost.
Can I change lots after the trade?
No. You must identify the lots by the settlement date. Brokers record the lots selected and report them on Form 1099-B.
Is HIFO always the best method?
No. It can create short-term gains and uses up high-basis lots. In 0% bracket years, or if you plan to donate low-basis shares, a different choice may save more over time.
Sources & fact-check notes
- IRS Publication 550, Investment Income and Expenses (accessed 2026-10-27)
Figures checked October 27, 2026. Rules and limits change; verify with the official source before acting.