FIFO cost basis is the IRS’s default rule for figuring out which shares you sold when you own multiple lots of the same investment. Under the First-In, First-Out method, the oldest shares in your account are treated as the ones sold first, and your taxable gain or loss is calculated from what those earliest shares cost you. It applies automatically unless you tell your broker otherwise before the trade settles, and because older lots often carry the lowest purchase prices, FIFO frequently produces the largest taxable gain of any available method.
How FIFO Picks Which Shares You Sold
Cost basis is what you paid for an asset, including fees and commissions. When you sell your whole position, basis is simply the total you invested. FIFO only comes into play when you sell part of a position you built up at different prices over time.
Consider a simple example. You bought 100 shares in March at $30 and another 100 in September at $50. In December you sell 75 shares at $55. Under FIFO, those 75 shares come out of the March lot because it’s the oldest. Your basis is $30 per share, and your gain is $25 per share, or $1,875. If you had been able to sell the September shares instead, the gain would have been $5 per share, or $375. Same trade, very different tax result.
The sequence works like a queue. You keep drawing from the oldest lot until it is exhausted, then move to the next. Sell 120 shares in the example above and the first 100 use the $30 basis while the remaining 20 use the $50 basis.
Which Investments Default to FIFO
Federal regulations apply FIFO to stock whenever you sell shares purchased at different times and don’t adequately identify which lot you’re selling.1eCFR. 26 CFR 1.1012-1 – Basis of Property The same regulation covers mutual fund shares. The IRS treats FIFO as the fallback anytime the taxpayer hasn’t elected something else.2Internal Revenue Service. Stocks (Options, Splits, Traders) 3
Digital Assets
Cryptocurrency and other digital assets are treated as property, so capital gains rules apply to every sale or exchange.3Internal Revenue Service. Frequently Asked Questions on Virtual Currency Transactions Updated regulations now explicitly establish FIFO as the default identification method for digital assets in both hosted wallets (like an exchange account) and unhosted wallets (like a hardware wallet).1eCFR. 26 CFR 1.1012-1 – Basis of Property
For transactions on or after January 1, 2025, crypto brokers must report gross proceeds on the new Form 1099-DA. Starting with transactions on or after January 1, 2026, brokers must also report cost basis.4Internal Revenue Service. Digital Assets If you trade through an exchange and don’t tell the broker which units to sell, it will sell your oldest units first. For coins in an unhosted wallet, you carry the burden of tracking your FIFO layers or making a valid specific identification.5Internal Revenue Service. Frequently Asked Questions on Digital Asset Transactions
If you accumulated coins across multiple wallets and exchanges before these tracking rules existed, Revenue Procedure 2024-28 offers a safe harbor letting eligible taxpayers make a reasonable allocation of existing basis across wallets holding the same digital asset.5Internal Revenue Service. Frequently Asked Questions on Digital Asset Transactions Worth looking at before you file if your old records are thin.
How to Override FIFO
FIFO is a default, not a mandate. Two alternatives exist, and both require you to act at or before the time of sale.
Specific Identification
With specific identification, you tell your broker exactly which shares or units to sell. The IRS requires that you be able to identify the specific shares at the time of sale.6Internal Revenue Service. Stocks (Options, Splits, Traders) 1 In practice that means picking the lot through your brokerage platform before the trade executes. Most online brokers have lot-selection tools built in.
Specific identification gives you the most control over the tax outcome. You can sell higher-cost lots to shrink a gain, or pick lots held over a year to lock in long-term rates. The tradeoff is active management on every sale. Forget to specify and FIFO takes over automatically.
For digital assets, hosted wallets require you to identify units by the date and time of the sale. For unhosted wallets, your own records need to document which units you transferred or sold.5Internal Revenue Service. Frequently Asked Questions on Digital Asset Transactions
Average Cost for Mutual Funds
Mutual fund shareholders have a third option: average cost basis. You divide your total investment by the total number of shares to get a single per-share cost. The regulation permits this specifically for mutual fund shares and certain dividend reinvestment plan stock.1eCFR. 26 CFR 1.1012-1 – Basis of Property Many fund companies default to average cost rather than FIFO, so check your account settings to see which method your broker is applying.
What FIFO Does to Your Tax Bill
FIFO’s biggest impact comes through holding periods. Because it always assigns the oldest shares first, those shares are more likely to have been held longer than a year and qualify for long-term capital gains rates. That can help. FIFO also tends to pick shares with the lowest basis, though, which means a larger gain to tax in the first place.
Short-Term Versus Long-Term Rates
Assets held for one year or less produce short-term gains, taxed at your ordinary income rate. Assets held for more than a year produce long-term gains at preferential rates.7Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses For 2026, the long-term rates are:
- 0% on taxable income up to $49,450 for single filers or $98,900 for married couples filing jointly
- 15% on taxable income from $49,451 to $545,500 for single filers or $98,901 to $613,700 for married couples filing jointly
- 20% on taxable income above $545,500 for single filers or $613,700 for married couples filing jointly
Short-term gains can be taxed at rates as high as 37% for 2026. When FIFO pulls your oldest, cheapest shares, it usually produces long-term treatment but a bigger gain. Whether that beats selling newer shares at a smaller short-term gain depends on your bracket and the spread between lot prices.
The Net Investment Income Tax
Higher earners face an additional 3.8% tax on net investment income, including capital gains. This surtax applies when modified adjusted gross income exceeds $200,000 for single filers, $250,000 for married couples filing jointly, or $125,000 for married individuals filing separately.8Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax These thresholds aren’t adjusted for inflation. A large FIFO-driven gain can push you over the line even when your salary alone wouldn’t.
Situations That Reshape the FIFO Queue
Not every share in your account came in through a plain buy order. Gifts, inheritances, and corporate actions all change how FIFO basis gets calculated.
Gifted Shares
When someone gives you stock, you generally inherit the donor’s cost basis and holding period.9Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If your uncle bought shares at $20 and gave them to you when they were worth $60, your basis is $20. Under FIFO, those gifted shares slot into your queue based on the original purchase date, not the date you received them.
There is a catch when the gift is underwater. If fair market value on the date of the gift is lower than the donor’s basis, and you later sell at a loss, you must use that lower fair market value as your basis for calculating the loss. This blocks donors from handing unrealized losses to recipients in lower tax brackets.
Inherited Shares
Inherited property gets a stepped-up basis equal to fair market value on the date of death.10Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent If your grandmother bought stock long ago at $5 and it was worth $80 when she died, your basis is $80. Under FIFO, the inherited lot enters your queue at the date of death. If you later buy more of the same stock, those purchases queue behind the inherited shares.
Stock Splits
A stock split changes the number of shares but not the total basis. Own 100 shares at $200 each and see a 4-for-1 split and you now own 400 shares at $50 each, still $20,000 invested. For FIFO purposes, the split shares keep the original lot’s acquisition date, so the chronological order doesn’t shift. The same logic covers stock dividends, where per-share basis adjusts downward for the extra shares.
FIFO and the Wash Sale Trap
The wash sale rule blocks you from claiming a tax loss if you buy substantially identical stock within 30 days before or after selling at a loss.11Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities This rule interacts with FIFO in ways that catch people off guard.
Say you’ve been buying shares monthly through an automatic investment plan. You sell some at a loss in October, but your November automatic purchase buys more of the same stock within the 30-day window. FIFO picked the oldest shares to sell, and the wash sale rule disallows the loss because you repurchased inside the window. The disallowed loss gets added to the basis of the replacement shares, and the original holding period carries over.11Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities You don’t lose the deduction forever, but you can’t take it this year.
If you’re trying to harvest losses on purpose, either pause automatic purchases around the sale or use specific identification to control which lots trigger the loss. Leaving FIFO to run on autopilot next to a recurring buy plan is how planned losses quietly disappear.
Reporting the Sale
Your brokerage sends Form 1099-B after each tax year, listing every sale with proceeds, cost basis (if reported), and dates. For digital assets sold through a broker starting in 2026, you’ll receive Form 1099-DA instead.4Internal Revenue Service. Digital Assets The IRS gets a copy of both, so mismatches between broker figures and your return trigger automated notices.
Review these forms carefully. Brokers sometimes report basis incorrectly, especially for assets transferred between accounts, received as gifts, or acquired through corporate actions. If the basis on your 1099-B is wrong, you correct it on Form 8949 rather than asking the broker to reissue.
Each sale gets its own line on Form 8949, showing description, date acquired, date sold, proceeds, and cost basis.12Internal Revenue Service. Instructions for Form 8949 – Sales and Other Dispositions of Capital Assets Short-term and long-term transactions go in separate sections. You also check a box indicating whether the broker reported basis to the IRS. If you adjust the basis your broker reported (for a wash sale, a gifted asset, or a basis error), enter the appropriate adjustment code and amount. When your reported basis differs from what the IRS received from your broker without an explanation, the automated matching system generates a CP2000 notice proposing additional tax.13Internal Revenue Service. Topic No. 652, Notice of Underreported Income – CP2000
Totals from Form 8949 flow onto Schedule D of your Form 1040, where short-term and long-term gains and losses net against each other.14Internal Revenue Service. Schedule D (Form 1040) – Capital Gains and Losses
Records to Keep and for How Long
Keep brokerage statements, 1099-B and 1099-DA forms, and any records documenting basis until the statute of limitations expires for the tax year in which you sell the asset.15Internal Revenue Service. How Long Should I Keep Records? For most people that’s at least three years after filing the return that reports the sale. If you underreport income by more than 25% of your gross income, the IRS has six years to assess additional tax, so keep records six years in that scenario.
The detail most people miss is that the clock starts when you sell, not when you buy. Buy stock in 2015 and sell in 2026 and you need the 2015 purchase records until at least 2029. If you never file a return or file a fraudulent one, there is no limitations period, and records should be kept indefinitely.15Internal Revenue Service. How Long Should I Keep Records? If the IRS questions your basis years later, reconstruction from memory is not a defense.