Cost Basis Methods: FIFO, Spec ID, and Average Basis Explained

When you sell shares of a stock or exchange-traded fund (ETF) that you purchased in multiple transactions over time, your taxable profit depends directly on your cost basis method. Cost basis is the original purchase price of an asset, adjusted for stock splits, dividends reinvested, and corporate actions. If you sell only a fraction of your position, tax regulations dictate which specific shares you are treated as having sold, directly determining whether you realize a massive taxable gain, a minimal gain, or a deductible tax loss.

The Internal Revenue Service (IRS) establishes First-In, First-Out (FIFO) as the default accounting method for equities, but active tax planning allows investors to choose Specific Share Identification (Spec ID) or Average Basis (for mutual funds). Understanding the legal boundaries, broker notification deadlines, and mathematical differences between these options can dramatically reduce your taxable capital gains.

Key Takeaways

  • FIFO is the IRS default: If you do not specify which shares to sell at or prior to trade settlement, the IRS presumes you sold your oldest shares first, which typically generates the highest capital gains for long-term winning positions.
  • Specific Identification provides maximum tax control: Under IRS regulations, designating exact tax lots enables strategies like Highest-In, First-Out (HIFO), minimizing current taxes or strategically harvesting capital losses.
  • Average Basis is legally restricted: Average cost accounting is permitted exclusively for open-end mutual fund shares and dividend reinvestment plans (DRIPs); it is generally not available for individual equities or standard ETF shares.

What Is Cost Basis and Why Does It Matter?

At its core, capital gain or loss is calculated with a straightforward formula:

Capital Gain / Loss = Net Sale Proceeds − Adjusted Cost Basis

Adjusted cost basis reflects what you paid for the security plus transaction fees and commissions, adjusted over time for corporate reorganizations, stock splits, and return of capital distributions. Under SEC filings such as the Vanguard Index Funds SEC Prospectus, investment managers explicitly disclose to shareholders: “Your cost basis in the Fund will be decreased by the amount of any return of capital that you receive.” This downward adjustment increases the taxable gain or reduces the loss recognized when those shares are subsequently liquidated.

If you purchase 100 shares of a company in a single lot and sell all 100 shares at once, your cost basis is indisputable. But modern investors rarely buy everything on a single date. Through recurring dollar-cost averaging, dividend reinvestment plans, and strategic rebalancing into core index funds like VTI or VOO, an investor’s portfolio often contains dozens of distinct tax lots acquired at varying prices and dates.

The Three Core Cost Basis Methods

When you decide to sell 100 shares out of a 500-share holding spread across multiple purchase lots, your brokerage must assign a cost basis to the liquidated shares. The three primary frameworks recognized under federal tax law are:

1. First-In, First-Out (FIFO)

FIFO is the mandatory baseline established under Treasury Regulation § 1.1012-1(c)(1). Under this method, the earliest shares you acquired are treated as the first shares sold. In an appreciating market, your oldest shares typically carry the lowest purchase price. Consequently, selling under FIFO realizes the largest capital gains, accelerating your tax liability into the current tax year. The primary benefit of FIFO is simplicity: all custodians track it automatically, and older lots are far more likely to qualify for lower long-term capital gains tax rates (held longer than one year).

2. Specific Share Identification (Spec ID)

Specific Share Identification gives the investor total control over which exact tax lot is liquidated. As documented in IRS Publication 550 (Investment Income and Expenses): “if you adequately identify the shares you sold, you can use the adjusted basis of those particular shares to figure your gain or loss.”

Using Spec ID, investors can instruct their custodian to apply specialized selection rules:

  • Highest-In, First-Out (HIFO): Sells the most expensive shares first, minimizing current taxable capital gains or maximizing realized capital losses.
  • Last-In, First-Out (LIFO): Sells the most recently acquired shares first, useful when recent lots were bought at near-market prices and older lots carry deep unrealized gains.
  • Tax-Sensitive / MinTax: Automated broker algorithms that prioritize short-term losses first, followed by long-term losses, long-term gains, and lastly short-term gains.

3. Average Basis (Average Cost)

Average basis aggregates the total dollar purchase cost of all identical shares held in an account and divides it by the total number of shares owned. While intuitive, federal tax law under Treasury Regulation § 1.1012-1(e) restricts the average basis method to shares of Regulated Investment Companies (RICs)—meaning open-end mutual funds—and shares acquired through a dividend reinvestment plan (DRIP). You cannot legally use average basis on individual common stocks (such as Apple or Palantir) or on standard exchange-traded funds held in a brokerage account.

Worked Example: Comparing FIFO vs. Spec ID vs. Average Basis

To see how cost basis selection directly impacts your tax bill, consider an investor who accumulated 300 shares of a growing company or fund across three distinct purchases:

  • Lot 1 (January 2024): 100 shares purchased at $40 per share (Total Cost: $4,000)
  • Lot 2 (July 2024): 100 shares purchased at $70 per share (Total Cost: $7,000)
  • Lot 3 (January 2025): 100 shares purchased at $100 per share (Total Cost: $10,000)

Total holdings: 300 shares, total cumulative cost basis of $21,000, resulting in an average cost of $70 per share. Today, the stock trades at $110 per share. The investor decides to sell 100 shares, generating gross proceeds of $11,000 ($110 × 100 shares).

Method Lot Liquidated Gross Proceeds Cost Basis Assigned Realized Capital Gain Estimated Tax (15% Rate)
FIFO (Default) Lot 1 ($40/sh) $11,000 $4,000 $7,000 $1,050
HIFO (Spec ID) Lot 3 ($100/sh) $11,000 $10,000 $1,000 $150
Average Basis (Mutual Funds Only) Blended ($70/sh) $11,000 $7,000 $4,000 $600
Source: Internal Revenue Code § 1012 and IRS Publication 550 tax lot calculations. Estimated taxes reflect an illustrative 15% long-term capital gains bracket.

The difference is stark: under FIFO, the investor pays $1,050 in taxes immediately. By electing Specific Share Identification and selecting the highest-cost lot (HIFO), the immediate tax liability drops to just $150—saving $900 in current-year cash outflows. While this defers taxes rather than eliminating them permanently, compounding that retained capital over years can yield meaningful wealth benefits, as explored in our guide on Price Return vs. Total Return.

Visualizing the Tax Lot Decision Framework

The diagram below illustrates how investor order instructions interact with custodian default rules and tax forms upon share disposition:

Cost Basis Method Decision Architecture Flowchart mapping investor lot selection through broker systems to Form 1099-B tax reporting. Multiple Tax Lots Shares acquired over time Spec ID Chosen Prior to Settlement? NO YES FIFO Default Applied Oldest lots sold first Specific Identification HIFO / Designated Lot Form 1099-B & Form 8949 Covered cost basis reported to IRS
Figure 1: Workflow comparing default FIFO disposition with proactive Specific Share Identification.

IRS Rules and Broker Confirmation Requirements

To legally validate Specific Share Identification under Treasury Regulation § 1.1012-1(c)(3), an investor must satisfy two strict procedural requirements:

  1. Timely Specification: You must specify to your broker or custodian the particular shares to be sold at or before the time of execution or trade settlement. Under current T+1 settlement rules, trade execution and settlement occur in rapid succession.
  2. Written Confirmation: You must receive a written confirmation from your broker acknowledging your tax-lot specification within a reasonable timeframe.

Under FINRA Rule 2210 (Communications with the Public), broker-dealers are obligated to provide fair and balanced communications, and member firms implement these rules by offering automated cost-basis election settings on trade tickets and account preference portals.

Covered vs. Non-Covered Securities

Under the Emergency Economic Stabilization Act of 2008, Congress mandated that brokers report adjusted cost basis directly to the IRS on Form 1099-B:

  • Covered Securities: Equities purchased on or after January 1, 2011, and mutual funds/ETFs acquired on or after January 1, 2012. For these shares, custodians transmit cost basis and acquisition dates directly to the IRS. If you do not proactively select a lot, the custodian’s default (typically FIFO) becomes your official reported tax basis.
  • Non-Covered Securities: Securities purchased prior to the mandatory reporting dates. For non-covered lots, brokers only report gross proceeds on Form 1099-B; the taxpayer bears sole responsibility for calculating and substantiating cost basis to the IRS on Form 8949.

Common Cost Basis Mistakes to Avoid

When implementing tax-lot strategies during annual tax planning or portfolio rebalancing, keep these critical traps in mind:

  • The Post-Settlement Trap: You cannot retroactively re-designate lots after settlement. If your trade settles under your broker’s default FIFO method, the IRS will disallow an amended tax return that attempts to retroactively claim HIFO or Spec ID.
  • The Wash Sale Disallowance: Under Internal Revenue Code § 1091, if you sell a lot at a loss using Spec ID but purchase “substantially identical” securities within 30 days before or after the sale, the loss is disallowed and added to the cost basis of the newly acquired shares.
  • Accidentally Locking in Average Basis: If you elect average basis on a mutual fund and later sell a portion of those shares, you cannot revoke the average basis election for those remaining shares without written IRS consent. For investors who wish to retain lot flexibility, keep separate accounts or stick with Spec ID from day one.

For foundational guidance on structuring core long-term investment accounts, visit our central Start Here investment guide.

Sources & Further Reading

Disclosure: This article is for informational purposes only and is not investment advice.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

We don’t spam! Read our privacy policy for more info.