Cost Basis Methods: How FIFO vs Specific ID Changes Your Tax Bill
Elena bought the same stock five times between 2022 and early 2026, watching it climb from $40 to $150 and then settle back to $120. Now she wants to sell 250 of her 500 shares. She places one market order, and depending on a setting buried in her account preferences, that trade reports either a $15,000 capital gain or a $500 capital loss.
Same 250 shares. Same $120 price. Same day. The difference is which shares her broker decides she sold.
That decision is the cost basis method. Under First-In-First-Out (FIFO), the broker assumes the oldest shares left the account first — Elena’s cheap 2022 lot. Under Specific Identification (Specific ID), Elena names the lots herself and can sell her expensive 2026 shares instead. Specific ID beats FIFO whenever your later purchases cost more than your earlier ones, which describes almost anyone who kept buying into a rising position. It does nothing at all if you sell every share you own.
Key points
- On Elena’s 250-share sale, FIFO produces a $15,000 taxable gain and Specific ID produces a $500 loss — a $15,500 swing in reported income from an accounting election.
- The dollar advantage peaks in the middle of the range, around 200 to 300 shares sold, at $2,505 of tax at a 24% ordinary / 15% long-term rate pairing.
- Raise the bracket and the advantage grows: $360 at a 12%/0% pairing, $2,710 at 37%/20%, on the identical 400-share trade.
- Specific ID only counts if you name the lots at or before the trade, per IRS Publication 550. Picking winners after you see the 1099 is not an option.
- Sell the entire position and both methods land on the same $14,500 lifetime gain. Method changes order and timing, never the total.

Why the default hurts
Most brokers default individual stock accounts to FIFO. It is the tidiest assumption and the one the IRS falls back on absent instructions. It is also, for a long-held winning position, the worst one.

The logic is mechanical. Your oldest shares are usually your cheapest shares, because you bought them before the price ran. FIFO sells the cheapest shares first, and cheap shares carry the largest gain per share. So the default method systematically hands you the biggest tax bill available on any partial sale.
IRS Topic 703 defines basis as what you paid, adjusted for reinvested dividends, splits, and similar events. That adjusted number gets subtracted from your sale proceeds to produce the gain. Specific ID doesn’t change any share’s basis. It changes which basis figure the sale gets matched against — and with five lots on the books, there are five very different answers sitting there.
Elena’s lots
Everything below runs on one position:

- Lot A: 100 shares @ $40, January 2022. Long-term.
- Lot B: 100 shares @ $65, June 2023. Long-term.
- Lot C: 100 shares @ $90, March 2025. Long-term.
- Lot D: 100 shares @ $110, November 2025. Short-term.
- Lot E: 100 shares @ $150, February 2026. Short-term, and underwater.
Current price is $120. The sale date is August 31, 2026, which is what makes Lot C long-term and Lot D short-term. Per-share gains run +$80, +$55, +$30, +$10, and −$30 across the five lots.
No wash sales, no dividend reinvestment adjusting basis, no state tax. Rates are illustrative pairings — a 0%, 15%, or 20% long-term rate against a range of ordinary rates for short-term gains, matching the structure described at IRS Topic 409. They are there to make the arithmetic legible, not to predict your bracket.
Throughout, “Specific ID” means the lot order that minimizes taxable gain: highest basis sold first, cheapest shares left untouched.
The 250-share sale, worked by hand
FIFO consumes Elena’s lots oldest first until it has 250 shares:
| Lot | Shares | Basis/sh | Gain/sh | Lot gain |
|---|---|---|---|---|
| A | 100 | $40 | $80 | $8,000 |
| B | 100 | $65 | $55 | $5,500 |
| C (partial) | 50 | $90 | $30 | $1,500 |
| Total | 250 | $15,000 |
Specific ID runs the same 250 shares in the opposite direction:
| Lot | Shares | Basis/sh | Gain/sh | Lot gain |
|---|---|---|---|---|
| E | 100 | $150 | −$30 | −$3,000 |
| D | 100 | $110 | $10 | $1,000 |
| C (partial) | 50 | $90 | $30 | $1,500 |
| Total | 250 | −$500 |
Elena’s Lot E is the engine here. She bought at $150 in February 2026 and the stock is at $120, so those 100 shares carry a built-in $3,000 loss that FIFO would leave sitting in the account untouched for years. Selling them first wipes out the gain from Lot D and half of Lot C, and drops her into a small net loss.
Her portfolio value is identical either way. She sold 250 shares at $120 and received $30,000 in both cases. The only thing that changed is what the 1099-B says.
How the gap moves with sale size
Sweep the sale from 50 shares up to the whole 500 and the two methods trace very different curves.
| Shares sold | FIFO gain | Specific ID gain | Difference |
|---|---|---|---|
| 50 | $4,000 | −$1,500 | $5,500 |
| 100 | $8,000 | −$3,000 | $11,000 |
| 150 | $10,750 | −$2,500 | $13,250 |
| 200 | $13,500 | −$2,000 | $15,500 |
| 250 | $15,000 | −$500 | $15,500 |
| 300 | $16,500 | $1,000 | $15,500 |
| 350 | $17,000 | $3,750 | $13,250 |
| 400 | $17,500 | $6,500 | $11,000 |
| 450 | $16,000 | $10,500 | $5,500 |
| 500 | $14,500 | $14,500 | $0 |
Two features matter. The gap plateaus at $15,500 across the 200-to-300 range, then closes on both sides. And at 500 shares it vanishes entirely, because there is no longer a choice to make — every lot goes, so every basis figure gets used regardless of order.
That convergence is the honest ceiling on what Specific ID can do. It is a timing tool. Elena defers gain into future years by keeping her $40 lot on the shelf; she does not erase it. If she eventually liquidates, the $8,000 embedded in Lot A shows up then. What she buys is control over when, and the option to realize it in a year when her rate is lower or when she has losses elsewhere to absorb it.
What the choice is worth in tax dollars
Fix the sale at 400 shares. FIFO takes lots A through D: $16,500 of long-term gain plus $1,000 short-term. Specific ID takes E through B: $8,500 long-term, and a net $2,000 short-term loss. Now vary the rates.
| Ordinary rate (ST) | Long-term rate | FIFO tax | Specific ID tax | Saved |
|---|---|---|---|---|
| 12% | 0% | $120 | −$240 | $360 |
| 22% | 15% | $2,695 | $835 | $1,860 |
| 24% | 15% | $2,715 | $795 | $1,920 |
| 32% | 15% | $2,795 | $635 | $2,160 |
| 35% | 20% | $3,650 | $1,000 | $2,650 |
| 37% | 20% | $3,670 | $960 | $2,710 |
One assumption is doing real work in the Specific ID column: the $2,000 short-term loss is valued at the ordinary rate, which is only true if Elena has short-term gains elsewhere on her return for it to offset. With no other gains, the loss nets against her long-term gain instead and the benefit shrinks — at 24%/15%, her Specific ID tax would be $975 rather than $795. The direction never reverses, but the size depends on the rest of her return.
The pattern across brackets is the point. Lot selection is worth a few hundred dollars to a taxpayer in the 12% bracket and roughly $2,700 to one at 37%, on a trade that looks identical from the outside.
Selling to a gain target
Flip the question. Suppose Elena wants to raise cash but keep her realized gain under a ceiling — because a larger gain would push her into the next long-term rate tier, or trigger a Medicare premium adjustment two years out. How many shares can each method free up?
| Gain ceiling | Max shares, FIFO | Max shares, Specific ID |
|---|---|---|
| $1,000 | 12 | 300 |
| $2,500 | 31 | 327 |
| $5,000 | 62 | 372 |
| $10,000 | 136 | 443 |
| $15,000 | 250 | 500 (all) |
FIFO runs out of room almost immediately. Every share it sells is a Lot A share adding $80 of gain, so a $1,000 budget buys twelve shares and $1,440 of proceeds. Specific ID gets Elena 300 shares — $36,000 of cash — at exactly $1,000 of gain, because the first 200 of those shares carry a combined $2,000 loss that absorbs everything Lot C adds.
At the bottom row the columns collapse again for the same reason as before. Elena’s entire position only holds $14,500 of gain, so a $15,000 ceiling never binds under Specific ID at all.
Two things people get wrong
“Specific ID always saves money.” It saves money when your lots disagree with each other. Elena’s advantage came almost entirely from Lot E’s $30-per-share loss and Lot D sitting near breakeven. Delete those two lots and rerun the 250-share sale against lots A, B, and C only: FIFO reports $15,000, Specific ID reports $12,500, and the gap collapses from $15,500 to $2,500. On a position bought steadily into a rising market with no down lots, the method is worth choosing but it is not transformative.
“You can switch after you see the tax bill.” No. IRS Publication 550 requires identification at or before the trade — in practice, written or electronic instructions to your broker naming the lots, confirmed back to you in a statement. Sell without specifying and the default applies automatically, and that choice generally cannot be undone once the trade settles. The election is a pre-trade action disguised as a tax decision, which is exactly why so many people miss it.
What this does not tell you
This is arithmetic on one hypothetical position with five lots and one sale date. It leaves out:
- Net Investment Income Tax, state income tax, and the Alternative Minimum Tax, all of which stack on top of the federal number shown here.
- Wash sale adjustments. If Elena bought substantially identical shares within 30 days before or after selling Lot E at a loss, that $3,000 loss is disallowed and added to the replacement lot’s basis instead — which would gut the entire Specific ID advantage in the tables above.
- Mutual funds and ETFs at brokers defaulting to average cost, a materially different calculation with no per-lot choice to make.
- Options, futures, and instruments with their own basis or mark-to-market rules that don’t follow a share-lot model.
- This year’s actual bracket thresholds. The pairings above are illustrative; your marginal rate depends on your whole return, and a large gain can move you between tiers partway through the sale.
The estimate also breaks down if your broker doesn’t support Specific ID for the account type, if only average-cost tracking is available, or if a prior partial sale already consumed lots you were counting on having.
FAQ
What is the default cost basis method if I don’t choose one?
Most brokers default individual stock accounts to FIFO unless you select Specific ID before the trade settles, as described in IRS Publication 550. Funds often default to average cost instead. Check your broker’s account settings directly — the IRS doesn’t impose one universal default across all account types.
Does Specific ID cost more in broker fees?
No. The cost basis method has no effect on commissions, spreads, or any other trading cost. It changes only which lot’s basis gets subtracted from the sale price for tax reporting.
Can I use Specific ID to pick loss lots forever and never pay tax?
Only up to the shares you actually own at a loss. Elena had 200 shares across lots D and E carrying losses or near-breakeven gains. Once those are gone, every additional share sold produces a gain regardless of method, because the higher-basis inventory is exhausted.
How much can changing methods actually save me?
In these scenarios it ranged from $0, when selling the full position, to $2,505 at a 24%/15% rate pairing on a 200-to-300 share sale, and up to $2,710 at 37%/20%. Your own figure depends on the spread between your lot bases and how many shares you sell.
Does the method matter more than holding period?
They aren’t separate levers. In the 400-share table, Specific ID’s advantage comes precisely because it converts $2,000 of short-term gain into short-term loss while leaving the remaining gain long-term. Choosing lots changes the character of the income and the amount at the same time.
What should I check in my own account?
Pull your broker’s lot detail screen and write down purchase dates, share counts, and prices in the same layout used above. Confirm which method your account currently applies, and whether Specific ID is selectable before you place a partial sale rather than after. If any lot you’d sell at a loss sits within 30 days of a purchase of the same security, read the wash sale timing rules before assuming that loss is usable.
This article is general information, not financial advice. See our disclaimer.
Also worth reading: Qualified vs Ordinary Dividends: The Tax Rate Gap on the Same Payout
Also worth reading: RMD Penalty Math: What a 25% Excise Tax Costs If You Miss the Deadline
Sources
Related articles
- Short vs Long-Term Capital Gains: The Tax Gap From One Day See the exact tax dollars one extra day of holding saves at every income level, from $0 to $700,000, with the math shown.
- The Wash Sale Rule: When a Realized Loss Gets Disallowed Learn when the wash sale rule blocks a tax loss, how the 61-day window works, and how to calculate the disallowed amount.
- Stock Splits: Why 4x the Shares Is Worth the Same Work out exactly what a 4-for-1 split does to your share count, cost basis, dollar P/L and percentage return, using one $12,400 position tracked through split day.