Skip to content
Menu
Finabase Learn

Taxes · Capital gains and losses

Cost basis methods: FIFO, specific ID, average cost, HIFO and LIFO

How the lot you sell is chosen for tax year 2026, with one four-lot sale worked through FIFO, LIFO, HIFO and average cost and the tax at two incomes.

On this page
  1. The default: first in, first out
  2. Specific identification
  3. Average cost: funds and DRIPs only
  4. Covered and noncovered securities
  5. One sale, four methods
  6. Pitfalls
  7. How Finabase does it
  8. Frequently asked questions
  9. Summary
  10. Check your understanding

When you own several lots of the same stock or fund, bought on different dates at different prices, a partial sale raises a question the tax return has to answer: which shares did you sell? The answer sets the basis subtracted from the proceeds, and with it the size of the gain, whether it is short- or long-term, and the tax. The same sale can produce a $5,000 gain or a $2,500 loss depending on the lots it uses.

Treasury regulations give a default, first in, first out, and two alternatives: identifying specific lots, and averaging the cost of fund and dividend-reinvestment shares. Brokers sell a menu of names on top of these, such as HIFO, LIFO and "tax-sensitive," which are all ways of identifying specific lots in advance. This page explains each method, the rules for making an identification valid, how covered and noncovered securities differ, and then runs one invented position through four methods with the 2026 tax at two incomes.

All of this is US federal law, tax year 2026. The method that suits a given investor depends on their whole tax picture, and a tax professional is the one to decide it. Basis itself, the number each lot carries, is covered in Adjusted cost basis: splits, DRIPs, return of capital and spin-offs.

The default: first in, first out

Treasury Regulation §1.1012-1(c)(1) sets the rule: if you sell shares bought on different dates or at different prices and do not adequately identify the lot, the shares sold are charged against the earliest lot you purchased, both for basis and for holding period. Publication 550 says the same and adds that, outside of certain mutual fund shares, you cannot use an average price per share instead.

For brokers, the 2026 instructions for Form 1099-B spell out the order when a customer gives no instructions: first any shares whose acquisition date is unknown, then the shares bought first, whether covered or noncovered.

FIFO is simple and needs no paperwork. In a market that has risen over years it also sells the cheapest shares first, so it tends to realize the largest gains, though usually long-term ones.

One quirk applies to any method. Under §1.1012-1(c)(1)(ii), shares bought at separate times on the same day in a single order, confirmed as one fill at an average price, have an averaged basis unless you notify the broker in writing that you want the actual cost of each part.

Specific identification

You may choose the lot. Publication 550 and §1.1012-1(c)(3) describe an adequate identification for shares held by a broker: you tell the broker which shares to sell at the time of the sale, and the broker confirms it in writing within a reasonable time. An emailed or on-screen confirmation counts (§1.1012-1(c)(9)), and it can arrive on a periodic statement.

Timing. Section 1.1012-1(c)(8) says the identification is made at the time of sale if it is made no later than the settlement date. You cannot choose lots while preparing your return in March; the choice has to exist by the business day after the trade under today's T+1 settlement.

Standing orders. The same paragraph treats a standing order or instruction for specific identification as an adequate identification made at the time of sale. This is the legal basis for the methods brokers advertise:

Broker label What it does IRS status
FIFO Oldest lot first The default rule
LIFO Newest lot first Standing specific ID
HIFO Highest-cost lot first Standing specific ID
Lowest cost Lowest-cost lot first Standing specific ID
Tax-sensitive / minimum Losses first, short before long, then gains Standing specific ID
Lot-by-lot at the trade You pick the lots on each order Specific ID
Average cost One average basis for all shares in an account Separate method, funds/DRIPs

The exact rules behind each broker's "tax-sensitive" label differ by firm. What matters for the return is that the broker records the identification and reports the basis of the lots it names on Form 1099-B.

Average cost: funds and DRIPs only

Section 1.1012-1(e) permits the average basis method for identical shares left with a custodian when they are either shares of a regulated investment company, which includes mutual funds and most ETFs, or shares acquired after 2010 in a dividend reinvestment plan that meets the regulation's definition (one that reinvests at least 10% of every dividend). It is not available for ordinary stock held outside a DRIP.

  • How it works. Divide the total basis of all identical shares in the account by the number of shares. Every share sold carries that average. Publication 550's example: 300 shares bought for $4,800 in total give an average of $16, and a sale of 150 shares has a basis of $2,400.
  • Holding period. Averaging the cost does not average the dates. The shares sold are treated as the ones acquired first, so one sale can be partly long-term and partly short-term.
  • DRIP shares are kept apart. Shares in a DRIP are not identical, for averaging, to shares with the same CUSIP held outside the DRIP.
  • Per account. For sales after 2011, average basis is computed separately for each account.

Electing it. For covered shares you notify the custodian in writing, electronically if you like, and the election applies to sales after the notice. The 1099-B instructions also let a broker make average basis its default for eligible shares when the customer gives no other instruction, which is why many fund accounts show average cost unless you change it. For noncovered shares you elect it on your return by reporting a sale with average basis.

Changing methods for funds. Under §1.1012-1(e)(9), an average-basis election can be revoked only until the earlier of one year after the election or the first sale after it, and the revocation restores the pre-averaging basis of each lot. After that, you can still change from average basis to another method, but only prospectively: each share keeps the averaged basis it had at the moment of the change, and future sales identify among those shares. Section 1.1012-1(c)(10) adds that a basis method is not a method of accounting, so a change needs no IRS consent form.

Covered and noncovered securities

Brokers report basis to the IRS only for covered securities. The 2026 1099-B instructions define them by acquisition date:

Security Covered if acquired for cash in the account
Stock (other than stock eligible for average basis) after 2010
Mutual fund shares and DRIP stock eligible for average basis after 2011
Most bonds and other debt, options, securities futures after 2013
Complex debt (variable-rate, inflation-indexed, contingent, convertible) after 2015

Shares that came from a split, stock dividend or reorganization are covered if their basis comes from covered shares. Transferred shares stay covered when the transfer statement says so. For noncovered lots the broker may leave the basis box empty and check box 5, and the basis is yours to prove.

Noncovered lots still follow the same identification rules. In a mixed position the order of lots matters for reporting too: the 1099-B instructions' own example (2027 edition) sells lots bought in April 2010, April 2026 and August 2026 in one trade and needs separate 1099-B entries for the noncovered 2010 shares and for the covered long-term and covered short-term shares.

One sale, four methods

An invented investor owns 400 shares of an invented index mutual fund (a fund, so that average cost is allowed) in four lots of 100:

Lot Bought (trade date) Price Cost On November 16, 2026
A March 12, 2019 $40 $4,000 long-term
B June 8, 2022 $120 $12,000 long-term
C February 10, 2025 $95 $9,500 long-term
D August 17, 2026 $110 $11,000 short-term

On November 16, 2026 she sells 150 shares at $100, for proceeds of $15,000.

  • FIFO sells all of lot A and 50 shares of lot B: $10,000 − $4,000 = $6,000 gain, plus $5,000 − $6,000 = $1,000 loss. Net $5,000 long-term gain.
  • LIFO sells all of lot D and 50 of lot C: a $1,000 short-term loss and a $250 long-term gain. Netting across classes leaves a $750 net loss, short-term in character.
  • HIFO sells all of lot B ($120) and 50 shares of lot D ($110): a $2,000 long-term loss and a $500 short-term loss. Net $2,500 loss.
  • Average cost: total cost $36,500 ÷ 400 shares = $91.25 a share. Basis of 150 shares: $13,687.50. Gain $1,312.50, all long-term, because the shares sold are treated as the oldest (lot A and half of lot B).
One sale of 150 fund shares at $100, four basis methods: gain or loss $5,000 (LT $5,000) FIFO −$750 (ST −$1,000, LT $250) LIFO −$2,500 (ST −$500, LT −$2,000) HIFO $1,313 (LT $1,313) Average cost Invented fund, four 100-share lots bought 2019–2026 at $40, $120, $95, $110; sold Nov 16, 2026.
One sale of 150 shares of an invented fund at $100 on November 16, 2026 under four methods. ST = short-term, LT = long-term. Illustrative.

The 2026 tax at two incomes

Take a single filer with no other capital gains or losses in 2026, and compare her federal income tax with and without the sale, at $60,000 and at $300,000 of other taxable income. A net loss is deducted against ordinary income up to $3,000; a net long-term gain is taxed at 15% at both incomes, since $60,000 is above the 0% ceiling of $49,450 and $300,000 is below the 20% threshold of $545,500.

Method Net result Change in 2026 tax at $60,000 At $300,000
FIFO $5,000 LT gain +$750.00 +$750.00
LIFO $750 net loss −$165.00 −$262.50
HIFO $2,500 net loss −$550.00 −$875.00
Average cost $1,312.50 LT gain +$196.88 +$196.88

At $60,000 the losses save 22 cents per dollar, the ordinary rate at that height; at $300,000 they save 35 cents. The higher earner would also owe the 3.8% net investment income tax on a gain (her modified AGI is above $200,000), which this table leaves out.

What the table does not show

The lower tax today is not a free saving. Every dollar of basis used now is a dollar not available later. After HIFO, the investor still owns lots A, C and half of D with a low average cost, and a later sale of them realizes the gains FIFO would have realized now. What changes is when the gain is taxed, at which rate (short or long), and whether some of it is never realized, for example because the shares are held until death and their basis is stepped up. Whether accelerating losses and deferring gains helps depends on future income, future rates and how long the shares are held, which is a judgment for the investor and a tax professional.

Two traps sit next to lot selection:

  • Short-term lots. HIFO and LIFO reach for recent lots, which are often short-term. A short-term gain from a recent high-priced lot can cost more than a larger long-term gain.
  • Wash sales. Selling a recent lot at a loss while you bought more within 30 days, or while dividends reinvest, can disallow part of the loss. See Wash sale examples: eight worked cases with basis and Form 8949.

Pitfalls

  • Choosing after the fact. An identification has to exist by settlement. A note written when preparing the return is not one.
  • Switching a fund away from average cost. Lots keep the averaged basis they had at the change; you do not get the original lot costs back after the revocation window.
  • Two accounts, one fund. Average basis is per account. Shares of the same fund at two firms are averaged separately, and FIFO at one firm ignores the other.
  • Missing basis on old lots. For noncovered shares the broker may report no basis. The basis is then yours to prove, and a figure you cannot support is open to challenge.
  • Lost DRIP lots. Each reinvestment is a lot. Leaving them out of basis taxes the dividends twice; Dividends and DRIPs: key dates, yield and reinvestment explains how they are bought.

How Finabase does it

A Finabase portfolio records each buy as a lot and matches every sell against the earliest open buys first (FIFO), adjusted for splits. There is no lot picker and no HIFO, LIFO or average-cost option, and the realized gain is not split into short- and long-term. The position shows an average cost column, which is a display figure for the open shares, not an election of the average basis method. To see what another method would give, list the open lots from the transaction history and work the sale by hand as in the example above. Your broker's records and Form 1099-B remain the official basis. A fund's distributions tab lists past payouts, which helps you rebuild reinvested lots.

Frequently asked questions

What cost basis method does the IRS use if I do nothing?

First in, first out. Treasury Regulation §1.1012-1(c)(1) charges an unidentified sale against the earliest lot purchased. Many fund accounts default to average cost instead, because the 1099-B rules let a broker make average basis its default for eligible fund shares.

Can I use specific identification after the year ends?

No. The identification must be made no later than the trade's settlement date, and confirmed in writing by the broker. A standing order on file counts.

Is HIFO allowed by the IRS?

Yes, as a form of specific identification. HIFO is a standing instruction to sell the highest-cost shares first; the IRS treats a standing order as an adequate identification.

Can I use average cost for individual stocks?

Only for stock held in a qualifying dividend reinvestment plan. Ordinary stock held outside a DRIP must use FIFO or specific identification.

Can I change my mutual fund from average cost to specific ID?

Yes, prospectively. Within the earlier of one year or your first sale after the election you can revoke it and restore the original lot costs; after that, each share keeps its averaged basis and future sales identify among those shares.

Summary

For tax year 2026, a partial sale of a position with several lots uses the earliest lot unless you identify another by settlement with written broker confirmation, and a standing order satisfies that rule, which is what HIFO, LIFO and tax-sensitive settings are. Average cost is a separate method open only to mutual fund and qualifying DRIP shares, computed per account, with the oldest shares treated as sold for holding-period purposes, and it can be undone only within a short window. Brokers report basis for covered securities bought after 2010 (stock), 2011 (funds and DRIPs), 2013 (most bonds and options) and 2015 (complex debt). In the worked example one sale ranged from a $5,000 gain to a $2,500 loss, but a method that lowers this year's tax mainly moves the gain into the future, and which trade-off fits is the reader's decision with a tax professional.

Check your understanding

4 questions on this lesson. Each answer comes with the reason, and nothing is scored.

  1. You own three lots of a stock and sell 100 shares without telling your broker which ones. Which shares are sold for tax purposes?

    1. The highest-cost shares
    2. The earliest lot you bought
    3. An average of all three lots
    Show the answer

    B. The earliest lot you bought Treasury Regulation §1.1012-1(c)(1) charges an unidentified sale against the earliest lot. Average cost is not available for ordinary stock outside a dividend reinvestment plan.

  2. Your broker offers a HIFO setting. What is it, in IRS terms?

    1. A separate basis method that needs IRS approval
    2. A standing order for specific identification, which the regulations treat as an adequate identification
    3. A form of average cost
    Show the answer

    B. A standing order for specific identification, which the regulations treat as an adequate identification Section 1.1012-1(c)(8) treats a standing order or instruction for specific identification as an identification made at the time of sale.

  3. You use average cost for a mutual fund and sell 300 of 400 shares. Two hundred were bought more than a year ago and two hundred last month. How is the sale classified?

    1. All long-term, because average cost averages the dates too
    2. 200 shares long-term and 100 short-term, because the shares sold are treated as the oldest
    3. All short-term, because the newest shares set the date
    Show the answer

    B. 200 shares long-term and 100 short-term, because the shares sold are treated as the oldest Averaging applies to cost only. For the holding period, Publication 550 treats the shares sold as those acquired first.

  4. In the lesson’s example, HIFO turns the sale into a $2,500 loss while FIFO gives a $5,000 gain. Why is HIFO’s lower tax not simply a saving?

    1. Because the IRS reverses HIFO losses at year-end
    2. Because the low-cost lots are still held and will realize their gains when they are sold later
    3. Because losses can never offset ordinary income
    Show the answer

    B. Because the low-cost lots are still held and will realize their gains when they are sold later Using high-basis lots now leaves low-basis lots for later sales. The total gain over the life of the position is the same; what changes is its timing, its character and possibly whether it is ever realized.

Sources and further reading

  1. 26 CFR §1.1012-1(c) and (e), Basis of property: sale of stock, average basis method (eCFR via Cornell LII, read 2026-11-18)
  2. IRS — Publication 550 (2025), chapter 4: Identifying stock or bonds sold; Special Rules for Mutual Funds; Average Basis
  3. IRS — Instructions for Form 1099-B (2026), Box 1e: covered security, identification of securities, average basis method
  4. IRS — Publication 551 (Rev. December 2025), Basis of Assets: Stocks and Bonds
  5. IRS — Rev. Proc. 2025-32 (tax year 2026 rate tables and capital gain thresholds)