Every stock or fund purchase is treated as a separate tax lot, with its own purchase price and date. If you sell only part of a holding, it can pay to choose the lots with the highest cost basis that you have owned for more than a year. By default, brokers often sell the oldest shares first, and those are frequently the cheapest, which can produce the largest taxable gain.
Subscribe for more tips like this in your inbox daily.
Fidelity, Schwab and Vanguard generally use first in, first out for stocks unless you select a different method. The IRS follows the same approach when you do not identify the shares you sold.
For example, imagine you bought a stock three times, each purchase more than a year ago: 100 shares at $20, then 100 at $45, and then 100 at $70. If you now sell 100 shares at $90, first in, first out uses the $20 lot and creates a $7,000 gain. If you choose the $70 lot instead, the gain falls to $2,000 — $5,000 less — even though the sale price is the same and the tax rate does not change.
To select specific lots for a single sale, open the lot details in your brokerage account. Those details show the date and cost of each purchase. Then choose the lots you want when placing the sell order. This is called specific identification, and it overrides your default method for that transaction.
You can also change the default method for the account in the broker's settings under cost basis, the term for what you paid. A highest-cost method sells your priciest shares first, but it does not take holding period into account. If those shares were bought within the past year, the gain is short-term and taxed at your ordinary income rate rather than the lower long-term capital gains rate. A tax-focused method, which Schwab calls Tax Lot Optimizer and Vanguard calls MinTax, sells loss lots first, then long-term gains before short-term gains.
Mutual funds often default to average cost instead. That gives every share a blended price, which means there is no high-cost lot to target. If you want a different method, switch the fund before your first sale from it. Once you sell under average cost, the shares you still own remain locked in at the averaged price, and the new method applies only to later purchases.
Set a highest-cost or tax-optimized default for each taxable brokerage account before your next sale, because any sale without lot selection will use that setting.
Advertiser Disclosure: Many or all of the offers that appear on this site are from companies that compensate us, and some companies pay for sponsored content. That compensation may influence which products we cover and where and how they appear on a page, including the order in which they appear. We do not include every company or offer available in the marketplace.
More from Digilifetrends
She Wants to Invest $400,000 in an Annuity to Avoid Market Swings. Using Pretax IRA Money Instead of After-Tax Savings Would Make Another $12,240 of Her Social Security Taxable
An advisor guides an older couple through critical financial and estate planning decisions, such as asset protection for long-term care.
4 min read · Published 2026-11-29Savvy Senior: Should you convert a traditional IRA to a Roth IRA?
Dear Savvy Senior,
3 min read · Published 2026-11-29