Key Takeaways
- Your cost basis method decides which shares you are treated as selling, and therefore how much gain or loss you report. Most brokers default to first in, first out, which is often the most expensive choice.
- Specific lot identification gives you control over every sale. It has to be set up with your broker before the trade settles, not at tax time.
- Average cost is available only for mutual funds and dividend reinvestment shares, and once you sell a fund under average cost, those shares are locked into it.
- The right lot to sell changes with your situation. High-basis lots minimize gains in a high-income year; low-basis lots are the ones to harvest at 0 percent or give to charity.
- Brokers report basis for covered shares on Form 1099-B, but older shares, gifted shares, and equity compensation shares often need correction on Form 8949.
Two investors sell the same 100 shares of the same fund on the same day for the same price and report different taxable gains. Neither is wrong. The difference comes from their cost basis methods, which determine which of the shares bought over the years are considered sold. For anyone who has bought a position more than once, that choice is worth real money on every sale.
Most people never make the choice. Their broker applies a default, usually first in, first out for stocks and often average cost for mutual funds, and the 1099-B arrives with the gain already calculated. In a rising market, the default tends to sell the oldest, cheapest shares first and produce the largest possible gain. This guide explains each cost basis method, walks through the numbers, shows how the choice interacts with tax-loss harvesting and charitable giving, and covers the reporting rules. It is educational, not individualized advice.
What Cost Basis Is and Why the Method Matters
Cost basis is what you paid for an investment, including commissions, adjusted for events such as reinvested dividends, stock splits, return of capital distributions, and wash sales. When you sell, your gain or loss is the sale price minus the basis. The IRS covers the fundamentals in Topic 703, Basis of Assets.
If you bought all of your shares in one transaction, basis is simple. The complication comes from buying the same security at different prices over time, which describes nearly every investor who dollar-cost averages, reinvests dividends, or adds to positions over years. Each purchase creates a tax lot with its own basis and its own holding period. When you sell part of the position, something has to decide which lots are sold. That is the cost basis method.
The method does not change your total gain over the life of the position. What it changes is when the gain is recognized and at what rate, and with 0, 15, and 20 percent capital gains brackets, a 3.8 percent surtax, and a step-up in basis at death, timing is most of the game.
The Cost Basis Methods Explained
Brokers offer several methods, and the names vary slightly by firm. These are the ones that matter.
First in, first out (FIFO)
FIFO treats the oldest shares as sold first. It is the IRS default for stocks and ETFs when no other method is specified, and it is the default at most brokers. In a market that has risen over your holding period, the oldest shares have the lowest basis, so FIFO produces the largest gain. Its one advantage is that the oldest shares are almost always long-term, so you avoid short-term rates by accident.
Specific lot identification
Specific identification lets you choose exactly which lots to sell on each trade. Most brokers implement it through a menu at the time of the order, or through a standing default such as highest cost first, lowest cost first, or a tax-optimized order that sells losses first, then long-term gains, then short-term gains. The IRS requires that you identify the lots to the broker no later than the settlement date and that the broker confirm the identification in writing, which the trade confirmation does. You cannot pick lots retroactively when preparing your return.
Average cost
Average cost divides the total basis of all shares by the number of shares, so every share carries the same basis. It is permitted only for mutual fund shares and shares held in a dividend reinvestment plan, not for individual stocks or ETFs. Many fund companies and brokers apply it to mutual funds by default. It is simple, but it removes your ability to choose lots. Once you sell any shares of a fund using average cost, the shares you held at that time stay on average cost. You can switch methods prospectively for shares bought afterward, but the old shares are locked.
Last in, first out and highest cost first
LIFO sells the newest shares first, which can minimize gains in a rising market but often produces short-term gains taxed at ordinary rates. Highest cost first sells the lots with the largest basis regardless of date, which can also select short-term lots. Both are forms of specific identification applied as a standing rule, and the tax-optimized versions most brokers offer are usually better than either alone.
Try it: the free Wealth Checkup takes a couple of minutes and shows you where you stand. Or explore investment management at Attend.
The Same Sale Under Three Methods
Suppose you bought 100 shares of a fund at $50 in 2016, 100 more at $80 in 2020, and 100 more at $120 in 2024. The fund is now at $150 and you sell 100 shares to raise $15,000.
Under FIFO, you sell the 2016 lot. Gain is $100 per share, or $10,000. Under average cost, your basis is $250 divided by 3, or $83.33 per share, and the gain is $6,667. Under specific identification choosing the highest cost lot, you sell the 2024 shares for a gain of $30 per share, or $3,000.
For a Georgia resident in the 15 percent federal bracket paying the 3.8 percent surtax and state tax of a little over 5 percent, the combined rate is roughly 24 percent. The FIFO sale costs about $2,400 in tax. The specific lot sale costs about $720. The $1,680 difference is not a permanent saving, since the low-basis shares are still there with their gain intact, but it is tax deferred at no cost, and deferred gains can later be harvested at 0 percent, given to charity, or passed to heirs with a stepped-up basis.
Choosing the Right Lot for the Situation
The highest-basis lot is not always the right one. The best choice depends on the purpose of the sale and what else is happening on your return that year.
- Raising cash in a high-income year: sell the highest-basis long-term lots. Check that a high-basis lot is not short-term, since a slightly larger long-term gain is often cheaper than a smaller short-term one.
- Harvesting losses: sell only the lots with a loss, leaving profitable lots untouched. Our guide to tax-loss harvesting explains how to pair this with a replacement purchase and avoid wash sales.
- Harvesting gains in a low-income year: sell the lowest-basis long-term lots first, because they carry the most gain per dollar and the gain is taxed at 0 percent.
- Giving to charity: donate the lowest-basis long-term lots. You deduct full market value and the embedded gain disappears.
- Gifting to family: give lots that suit the recipient. A low-basis lot to an adult child in a low bracket works well; a lot with a loss should be sold by you first, since the recipient cannot use the loss.
- Rebalancing inside a taxable account: use a tax-optimized order so losses offset gains within the same trade batch.
- Late in life: consider not selling the lowest-basis lots at all, since basis steps up to market value at death for heirs.
How Cost Basis Is Reported to the IRS
Since 2011 for stocks, 2012 for mutual funds and dividend reinvestment shares, and 2014 for options and most bonds, brokers must track basis and report it to the IRS on Form 1099-B. These are called covered shares. Shares bought before those dates, and shares transferred in without basis information, are noncovered. For noncovered shares the broker reports only the proceeds, and you are responsible for the basis from your own records.
Sales are reported on Form 8949, sorted into categories by whether the basis was reported to the IRS and whether the holding period was short or long, and the totals flow to Schedule D. When the broker's basis is wrong, you report the broker's figure and then enter an adjustment with a code, rather than simply changing the number. Publication 550 explains the adjustment codes and the rules for each type of investment.
Errors are common in three places. Equity compensation shares from RSUs, ESPPs, and option exercises often show a basis on the 1099-B that omits the compensation already taxed on your W-2, which overstates the gain unless you adjust it, as our RSU tax planning guide describes. Shares transferred between brokers sometimes arrive with no basis or the wrong acquisition date. And wash sale adjustments are not tracked across accounts or between spouses, so the broker's figure can be too low.
Gifts, inheritances, and other special cases
Gifted shares carry the donor's basis and holding period, with one exception: if the shares were worth less than the donor's basis on the date of the gift and you later sell at a loss, your basis for the loss is the lower gift-date value. Inherited shares receive a basis equal to fair market value on the date of death, or on the alternate valuation date six months later if the estate elects it, and are always treated as long-term. Reinvested dividends create a new lot at each reinvestment and were already taxed when received, so failing to add them to basis means paying tax twice. Stock splits divide basis across the new shares, and spin-offs allocate basis between the two companies according to published figures.
Setting Up Your Accounts Correctly
The practical steps take a few minutes and pay off for years.
- Change the default cost basis method in each taxable account from FIFO to specific identification, using a tax-optimized order if the broker offers one. Check stocks, ETFs, and mutual funds separately.
- For any mutual fund you have never sold, switch away from average cost before the first sale, or you lose the choice for those shares.
- When placing a sale, review the lots the system has selected and override them if the situation calls for a different choice.
- Keep confirmations and year-end statements for noncovered shares, and reconstruct basis now rather than in the year you sell.
- Before transferring accounts between brokers, download the full lot history and confirm the receiving broker imported it correctly.
- Coordinate lot selection across both spouses' accounts, since wash sales and gain harvesting are measured at the household level.
Cost basis methods are one of the few tax decisions that cost nothing to get right and something on every sale to get wrong. Switching to specific identification, checking the lots on each trade, and keeping records for shares your broker does not track are habits rather than strategies, but they compound. They also make the larger moves possible: harvesting losses cleanly, realizing gains at 0 percent, and giving the right shares to the right recipients. Lot-level tax management is built into the way our investment management service handles taxable accounts, and it feeds directly into the tax planning we do each fall.
Frequently Asked Questions
What is the best cost basis method for taxes?
Specific lot identification is the most flexible, because it lets you choose the lot that fits the situation: high-basis lots to minimize gains in a high-income year, low-basis lots to harvest at 0 percent or give to charity, and loss lots to harvest losses. FIFO is the default at most brokers and usually produces the largest gain.
Can I change my cost basis method after I sell?
No. Lot identification has to be communicated to the broker by the settlement date, and the broker's confirmation is your record. You can change the default method for future sales at any time, but shares of a mutual fund already sold under average cost lock the remaining shares held at that time into average cost.
Why does my 1099-B show a different basis than I expected?
Common reasons include equity compensation shares reported at the purchase price without the income already taxed on your W-2, reinvested dividends that were not added, shares transferred from another broker without basis, or a wash sale adjustment. You report the broker's figure on Form 8949 and enter an adjustment with the appropriate code rather than changing the number.
Does the cost basis method matter in an IRA or 401(k)?
No. Sales inside tax-deferred and Roth accounts are not taxable events, so lot selection has no effect there. Cost basis methods only matter in taxable brokerage accounts.
What is the cost basis of inherited stock?
Inherited securities receive a basis equal to their fair market value on the date of death, or on the alternate valuation date if the estate chooses it. The holding period is automatically long-term. That step-up is why low-basis shares are often the last ones an older investor should sell.

Tony leads Attend Wealth, a fee-based wealth management firm in Atlanta serving professionals, families, physicians, and business owners. Advisory services are held to a fiduciary standard. More about Attend
Talk It Through with an Advisor.
A complimentary conversation about your situation. Ask whatever is on your mind, walk away with a straight answer, and keep the notes either way.
Book Your Complimentary Consult