On this page
Cost Basis: FIFO, LIFO, and Specific Identification
When you have bought the same stock at different prices over time and then sell only part of your position, which shares did you actually sell? The answer is not obvious, and it changes your tax bill. Cost basis methods are the accounting rules that decide which lots leave first.
Key Takeaways
- Cost basis is what you paid for an asset; it is subtracted from the sale price to compute the taxable gain.
- When you bought shares at different prices, the method you choose decides which lots are sold and therefore the gain.
- FIFO sells oldest shares first, specific identification lets you pick exact lots, and average cost is common for funds.
- Specific identification gives the most control over your tax outcome but requires identifying the lots before the sale settles.
Key Takeaways
- Cost basis is what you paid for an asset; it is subtracted from the sale price to compute the taxable gain.
- When you bought shares at different prices, the method you choose decides which lots are sold and therefore the gain.
- FIFO sells oldest shares first, specific identification lets you pick exact lots, and average cost is common for funds.
- Specific identification gives the most control over your tax outcome but requires identifying the lots before the sale settles.
What It Is
Cost basis is the amount you paid to acquire an asset, including commissions and certain adjustments. It is the figure subtracted from your sale proceeds to determine your capital gain or loss. If you buy one share for 50 dollars and sell it for 80 dollars, your basis is 50 dollars and your gain is 30 dollars.
The complication arises when you own multiple "lots" of the same security, each purchased on a different date at a different price. Sell some but not all, and the tax code needs a rule to decide which specific shares you disposed of. That rule is your cost basis method, and brokers track it for you, but the default they apply may not be the one that minimizes your tax.
Why It Matters
The shares you are deemed to have sold determine both the size of your gain and its holding period. Selling high-basis shares produces a smaller gain. Selling shares held more than a year qualifies for long-term rates. Because brokers default to a method unless you instruct otherwise, investors who never look at the setting can hand the IRS more than they owe.
The choice matters most for investors who accumulate a position gradually, through regular purchases or dividend reinvestment, and later sell part of it. Choosing the right lots can mean the difference between a large short-term gain and a small long-term one.
How It Works
The main methods are:
FIFO (first-in, first-out) -> oldest lots sold first (common default)
LIFO (last-in, first-out) -> newest lots sold first
Specific identification -> you name the exact lots to sell
Average cost -> averages basis across lots (mutual funds, ETFs)
FIFO is the most common broker default. It tends to sell your oldest, often lowest-basis, shares first, which can produce larger gains but usually qualifies them as long-term.
Specific identification gives the most control. You tell the broker exactly which lots to sell, so you can target high-basis shares to shrink a gain or low-basis long-term shares when you want to realize a gain at favorable rates. The catch is that you must identify the lots at or before the sale and get written confirmation. Average cost pools all shares into a single average basis and is widely used for mutual funds.
Worked Example
Suppose you bought three lots of the same stock:
Lot A 100 shares @ 20 (3 years ago) basis 2,000
Lot B 100 shares @ 35 (2 years ago) basis 3,500
Lot C 100 shares @ 55 (4 months ago) basis 5,500
You now sell 100 shares at 60 dollars, for 6,000 dollars in proceeds.
Under FIFO, you sell Lot A. Gain is 6,000 minus 2,000, or 4,000 dollars, all long-term.
Under specific identification, you instead sell Lot C, the high-basis recent lot. Gain is 6,000 minus 5,500, or just 500 dollars, though it is short-term. If your goal this year was to minimize the realized gain, identifying Lot C cut the taxable gain from 4,000 to 500 dollars.
Common Mistakes
-
Letting the broker default decide. Most brokers apply FIFO unless you choose otherwise. For tax-sensitive sales, review and set the method before you trade rather than discovering the result on your 1099-B.
-
Trying to specify lots after the trade settles. Specific identification requires you to identify the lots at or before the sale and receive confirmation. You cannot retroactively reassign which shares were sold once the trade is done.
-
Forgetting that average cost can lock you in. Once you use average cost for a fund position, switching methods for already-held shares is restricted. Decide deliberately.
-
Ignoring the holding period of chosen lots. Picking a low-basis lot to realize a gain is fine, but if it is short-term you lose the preferential rate. Balance basis against holding period.
-
Not adjusting basis for reinvested dividends and returns of capital. Reinvested dividends add to basis, and returns of capital reduce it. Skipping these adjustments leads to overpaying or underpaying tax.
Frequently Asked Questions
Q: What are cost basis methods in simple terms? They are rules that decide which shares you sold when you own the same stock bought at different prices. Because each lot has a different cost, the method changes how big your taxable gain is.
Q: How do cost basis methods affect my taxes? Selling high-basis lots produces a smaller gain and less tax, while selling old low-basis lots produces a larger gain. The method also affects whether the gain is short-term or long-term, which changes the rate.
Q: What is a real-world example of choosing a method? If you own a 20 dollar lot and a 55 dollar lot and sell at 60 dollars, FIFO sells the 20 dollar lot for a 40 dollar per-share gain, while specific identification can sell the 55 dollar lot for just a 5 dollar per-share gain.
Q: Which cost basis method is best? There is no single best method. Specific identification gives the most control for taxable accounts, FIFO is simplest, and average cost is common for funds. The right choice depends on your goal for that particular sale.
Q: Can I change my cost basis method? You can choose a method per sale before it settles, and you can change your standing default at the broker. However, switching away from average cost on shares already covered by it is restricted, so set it deliberately.
Sources
- Internal Revenue Service. "Publication 550, Investment Income and Expenses." https://www.irs.gov/publications/p550
- Internal Revenue Service. "Topic No. 409, Capital Gains and Losses." https://www.irs.gov/taxtopics/tc409
- Internal Revenue Service. "About Form 8949, Sales and Other Dispositions of Capital Assets." https://www.irs.gov/forms-pubs/about-form-8949
- Investor.gov. "Cost Basis (Glossary)." https://www.investor.gov/introduction-investing/investing-basics/glossary/cost-basis
Disclaimer
This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.
Back to your knowledge path