GLOSSARY DEEP DIVE

Average Cost Basis: The Default Setting That Is Not Always Your Best Option

When you sell part of a fund position built up over years of purchases at different prices, the tax authorities need to know exactly which shares, and which cost, you sold. Average cost basis is the simplest way to answer that question, and it is often the automatic default at your brokerage, but simplest is not always cheapest at tax time.

Deep dive9 min readUpdated 2026

The core principle

Cost basis is what you paid for an investment, including reinvested dividends and any commissions, and it is the number subtracted from your sale proceeds to calculate a taxable gain or loss: gain or loss = proceeds − cost basis. When every share of a position was bought at the same price on the same day, this calculation is trivial. The complication arises when you have bought shares of the same fund repeatedly over months or years, at different prices, and then sell only part of the position: which specific shares, and therefore which specific cost, were sold?

Average cost basis resolves this by blending every purchase into a single average cost per share: average cost basis = total dollars invested / total shares owned. If you bought 100 shares at $20 ($2,000 total) and later bought another 100 shares at $40 ($4,000 total), your average cost basis is ($2,000 + $4,000) / 200 shares = $30 per share, and every share you sell, regardless of when it was actually purchased, is treated as if it cost exactly $30. This method has historically been common, and sometimes the automatic default, for mutual fund positions specifically; individual stocks and ETFs are more commonly tracked share lot by share lot.

Key idea Average cost basis is a blend, not a choice. It removes your ability to select which specific tax lot (a batch of shares bought at one time and price) to sell, which matters enormously when you want to control the size and timing of a taxable gain or loss.

The alternative is specific identification, sometimes called SpecID, which lets you choose exactly which lot of shares to sell at the time of the trade. Using the same example, if the fund is now trading at $35 a share, specific identification lets you choose to sell the $40 lot, realizing a $5-per-share loss ($35 sale price minus $40 cost), useful for tax-loss harvesting, or instead sell the $20 lot, realizing a $15-per-share gain, useful if you specifically want to realize a gain in a low-income year. Average cost basis, by contrast, would force every sale to use the blended $30 basis, realizing a $5-per-share gain ($35 minus $30) regardless of your actual preference.

How the math works

Example 1: Three purchases, one sale, two methods compared. An investor buys 200 shares at $25 ($5,000), then 150 shares at $45 ($6,750), then 150 shares at $30 ($4,500), for a total of 500 shares costing $16,250. Average cost basis is $16,250 / 500 = $32.50 per share. The fund now trades at $38, and the investor sells 150 shares. Under average cost, the taxable gain is 150 × ($38 − $32.50) = 150 × $5.50 = $825. Under specific identification, selling the 150-share lot bought at $45 instead produces a taxable loss of 150 × ($38 − $45) = 150 × (−$7) = −$1,050, a $1,875 swing in taxable outcome ($825 gain versus a $1,050 loss) purely from choosing which lot to report, on an identical actual trade of the same 150 shares at the same $38 sale price.

Example 2: The tax dollar impact of that swing. Continuing the example above, an investor in the 24% federal bracket for short-term gains, or the 15% bracket for long-term gains, faces very different bills depending on the method chosen and the holding period involved. If the specifically identified $45 lot had been held over a year, realizing the $1,050 loss instead of the $825 average-cost gain does two things at once: it eliminates the tax that would have been owed on the $825 gain (roughly $825 × 15% ≈ $124 at long-term rates) and it also creates a $1,050 loss that can offset other gains dollar for dollar, or up to $3,000 of ordinary income if no other gains exist that year, worth roughly $1,050 × 24% ≈ $252 in tax savings at a 24% ordinary rate. Combined, choosing specific identification over average cost in this single trade is worth on the order of $376 in this illustration, a real, immediate, and entirely legal tax savings from nothing more than an elected accounting method.

Key idea Specific identification never creates a tax benefit that would not otherwise eventually show up; it only gives you control over when and in what size gains and losses are realized. That control is precisely what makes tax-loss harvesting and gain timing possible, and average cost basis removes it entirely.

How it shows up in real portfolios

An investor who has been dollar-cost averaging into the same broad index fund inside a taxable brokerage account for fifteen years, with dozens of purchase lots at wildly different prices spanning multiple market cycles, has enormous flexibility available through specific identification when it eventually comes time to sell: choosing high-cost lots to minimize a gain when selling for a planned expense, or choosing low-cost lots deliberately when a gain is actually wanted, for example to realize income in a year when the investor's income is unusually low.

A high-earning professional planning a large charitable gift of appreciated stock is a case where cost basis tracking method matters differently: donating the specific lot with the lowest cost basis (the largest embedded gain) to a donor-advised fund captures the largest possible avoided capital gains tax while still deducting the full fair market value of the donated shares, a benefit that is completely unavailable if the position has been tracked only on an averaged basis and the specific lots can no longer be distinguished.

An investor participating in a workplace employee stock purchase plan (ESPP), who accumulates company stock through many small, regular payroll purchases at a discount, faces a particularly acute version of this issue, since ESPP shares generate dozens of small lots a year, each with its own purchase date and price relevant both for cost basis and for whether the plan's favorable tax treatment on the discount applies. Tracking each lot individually, rather than relying on an average, is often essential here simply to correctly apply the ESPP-specific tax rules, not just to optimize an ordinary capital gain.

A common, avoidable mistake happens when an investor consolidates several old brokerage accounts, each using a different cost basis method, into one new account, without carefully verifying that the transferred cost basis records survived the move intact. Brokerages are required to report cost basis to the IRS for most securities purchased in recent years (a rule phased in starting with stocks in 2011 and extended to mutual funds and most ETFs by 2012), but older "uncovered" shares purchased before those rules took effect can lack reliable basis records entirely, and a careless transfer can turn a documented $20 cost basis into an undocumented one that the IRS may treat far less favorably if records cannot be produced.

Actionable breakdown

  • Understand the two main methods.
    • Average cost: blends all purchases into one per-share figure.
    • Specific identification: lets you choose which lot to sell.
  • Check your brokerage's default method before your first sale.
  • Switch to specific identification before selling if you want control.
  • Elect the method at the time of trade; some brokerages lock it in after settlement.
  • Keep purchase records for any older, uncovered shares yourself.
  • Verify cost basis transferred correctly when moving accounts between brokerages.

Common pitfalls

  • Sticking with the default average cost method without checking alternatives. Many investors never realize a choice exists at all, and the brokerage default is not always the tax-optimal one for their situation.
  • Forgetting to elect a method before a sale settles. Some brokerages require the specific identification instruction at the time of the trade, not afterward, so waiting can lock in the average cost result by default.
  • Losing track of basis across multiple brokerages during consolidation. Transferred records are not always complete, especially for older, uncovered shares purchased before mandatory broker reporting rules took effect.
  • Ignoring the method entirely for small, routine sales. The dollar impact scales with position size and price dispersion between lots, so this matters far more for large or long-held positions than for small, recent ones.
  • Cost basis, the underlying figure this entire calculation depends on.
  • Capital gain, the taxable outcome cost basis method directly affects.
  • Capital loss, the other possible outcome, useful for tax-loss harvesting.
  • Tax loss harvesting, a strategy that depends heavily on specific identification.
  • Tax efficiency guide for the broader strategy this technique fits inside.

The bottom line

Average cost basis is simple and adequate for many small or routine sales, but checking specific identification before a large sale can meaningfully lower your tax bill.

Back to the full glossary