Choosing Which Shares to Sell
Someone selling part of a long-held position is making two decisions and usually only notices one. How much to sell is obvious. Which specific shares leave β bought in which year, at which price β decides the gain, and if no instruction is given the broker decides for you, generally in the way that realises the most.
- Specific identification:: Name the lots at the time of sale and the gain is computed against those lots.
- FIFO by default:: With no instruction, the oldest shares are treated as sold first β usually the lowest basis.
- Average cost for funds:: Mutual funds can use an average basis method, which is simpler and less precise.
- Timing is the constraint:: The identification must be made by settlement, not reconstructed when the return is prepared.
Where the AI summary above gets this wrong
"Your broker calculates the cost basis for you, so there is nothing to decide."
That's surface-true. Here's what it misses:
- The default costs money in a long-held position β First in, first out sells the oldest shares, which in a position held for years are usually the cheapest. That maximises the realised gain on every partial sale. For someone drawing income from a taxable account, the difference across a retirement is substantial.
- The choice has to be made before settlement β Specific identification is not a decision made at tax time. It has to be communicated to the broker at or before the sale settles, and confirmed in writing. Deciding in April which lots you meant to sell in September is not available.
- Average cost is a one-way door for that fund β Electing average cost for a mutual fund position generally binds the treatment of that holding, and it removes the ability to pick high-basis lots later. It is convenient and it forfeits the lever, which matters most in exactly the accounts where the lever is worth using.
01 The three methods
Specific identification lets you nominate which lots are sold. Where the aim is to realise as little gain as possible, that means the highest-cost lots; where the aim is to harvest a loss, the opposite. It is the only method that gives you control.
First in, first out is the default where nothing is specified. The oldest shares go first, which in an appreciated position means the cheapest go first and the gain is at its largest.
Average cost is available for mutual funds and averages the basis across all shares of that fund. It removes the arithmetic and the choice together, and once elected for a holding it generally governs that holding.
Shows: the difference in realised gain between selling the oldest shares by default and specifically identifying the highest-cost lots for the same proceeds. Ignores: the tax rate applied to that gain, whether the identified lots are short-term or long-term, state tax, and the wash sale rule where a loss is involved.
Source: Publication 550
02 Making the identification stick
The identification has to be made at the time of the sale and confirmed by the broker. Most platforms offer a lot selection screen during the trade, or a standing default that can be set to something other than first in, first out.
Setting that standing default is the single most useful administrative change available in a taxable account. Highest cost first, or a tax-efficient setting where the broker offers one, converts every future sale into the low-gain version without any further attention.
Keep the confirmation. Brokers report basis to the IRS for covered shares, and where the reporting does not match what you identified, the confirmation is the evidence. The same record-keeping discipline that harvesting losses requires applies here on the gain side.
Source: Publication 551
03 Where the choice matters most
Three situations reward attention. Drawing regular income from a taxable account: identifying high-basis lots each time keeps realised gains low year after year, which feeds directly into the order accounts are drawn in.
Harvesting losses: you need the specific lots that are underwater, not an average that shows a gain. Average cost can make a harvestable loss invisible in a fund position that is up overall.
And holding for a step-up: where the intention is to leave appreciated shares to heirs, the low-basis lots are the ones to keep. Selling high-basis lots now and holding the rest for the basis reset at death is the shape of an efficient plan.
This is a setting, not a strategy, and it takes about four minutes. Log into the brokerage account, find the cost basis default, and change it from first in, first out to highest cost. Every sale you make for the rest of your life then realises less gain by default, and you never have to think about it again. I have never met anyone who regretted changing it and I have met plenty who wished they had done it a decade earlier.
FAQ
Can I choose which shares to sell for tax purposes?
Yes, by specific identification, provided you nominate the lots at the time of sale and the broker confirms it. Without an instruction the default is first in, first out.
What happens if I do not specify which lots to sell?
The oldest shares are treated as sold first. In a position that has risen, those are usually the lowest-basis shares, so the realised gain is at its maximum.
Can I change from average cost back to specific identification?
Changing the method for a fund position you have already elected average cost on is restricted, and any change generally applies going forward rather than retroactively. It is worth choosing deliberately at the outset.
Sources
Regulator references
- Publication 550 Β· Internal Revenue Service Β· 2026The identification rules for shares sold and how average cost applies to funds.Last verified: 2026-09-07
- Publication 551 Β· Internal Revenue Service Β· 2026How basis is established and adjusted for different kinds of property.Last verified: 2026-09-07
- Topic 409: capital gains and losses Β· Internal Revenue Service Β· 2026The short-term and long-term distinction the identification choice controls.Last verified: 2026-09-07
Calculator unit tests Β· the assertions this page's worked example is checked against, and their last result
Changelog
- 2026-09-07 β initial publish (new format)
Run this rule against your situation
See what this rule does to your own projection β month by month, to age 90.
Join the Waitlist