Cost Basis Methods

FIFO, LIFO, specific identification — and why specific ID is usually best.

Share

When you sell some but not all shares of a holding, your broker applies a cost basis method to determine which shares were "sold." This determines your gain or loss.

Methods

  • FIFO (First In, First Out): Default at most brokers. Oldest shares sold first — typically the lowest basis, largest gain.
  • LIFO (Last In, First Out): Newest shares first — typically minimizes gain or maximizes loss.
  • Average cost: Average basis across all lots. Common in mutual funds.
  • Specific Identification: You pick the exact lots. Maximum control.

Why specific ID matters

Specific identification lets you choose to sell the highest-basis lots first (minimize gains) or harvest losses surgically. It's especially valuable in volatile holdings with multiple buy dates.

Set your default at the broker to Specific ID (sometimes called "TLH" or "Tax-loss optimized" mode). At sale time, you can override individual lots.

What cost basis means

Cost basis is what you paid for a security, used to compute capital gain or loss when you sell. Sale price minus cost basis equals gain. For a single buy and sell, simple. For positions built across multiple purchases, brokers track each "lot" — and the method used to identify which lot you sold can dramatically change your tax bill.

The four methods

MethodLogicEffect
FIFO (First In, First Out)Oldest shares sold firstDefault at most brokers; usually triggers larger gains
LIFO (Last In, First Out)Newest shares firstSometimes minimizes gain; mutual funds rarely allow
Average costMean basis across all lotsCommon for mutual funds; oversimplifies
Specific IdentificationYou pick the exact lotsMaximum control; usually best

Why specific identification wins

Suppose you own 300 shares of XYZ across three purchases:

  • 100 shares at $50 (long-term)
  • 100 shares at $75 (long-term)
  • 100 shares at $95 (short-term)

Current price: $90. Selling 100 shares with FIFO sells the $50 lot — $4,000 gain at LTCG rates. Specific ID lets you sell the $95 lot at a $500 loss instead. The same trade produces a $4,000 gain or a $500 loss depending on lot selection.

How to actually set up specific ID

  1. Login to your broker.
  2. Find cost basis preferences (usually under Account Settings or Tax Documents).
  3. Change default from FIFO to "Specific Identification" or "Tax Lot Optimizer."
  4. At the time of sale, the broker presents available lots and you select which to sell.

Some brokers (Vanguard, Fidelity) have "Tax-Sensitive" or "TaxLot Optimizer" presets that automatically pick the most tax-favorable lots.

Cost basis for assets you didn't buy

  • Inherited: Stepped-up basis to fair market value at date of death.
  • Gifted: Recipient inherits donor's cost basis (no step-up).
  • From employer (RSUs, ESPP): Basis = grant value + amount already taxed as income.
  • From spin-offs/mergers: Allocated based on relative market values; complex.
  • Crypto: Same rules apply; you're responsible for tracking.

Common cost basis mistakes

  • Letting brokers default to FIFO. Almost always sub-optimal for tax-aware investors.
  • Forgetting wash sale adjustments. Disallowed losses add to cost basis of new shares — broker should track but verify.
  • Losing records on transferred accounts. When moving from one broker to another, cost basis sometimes gets lost. Keep your own records.
  • Using average cost on stocks. Only mutual funds; stocks should use lot-level tracking.
  • Not adjusting for return of capital. Some distributions (especially REITs, MLPs) reduce cost basis instead of being taxable.

Frequently asked questions

Can I change methods mid-year?

Yes for stocks/ETFs (specifying at time of trade). Mutual funds usually require commitment to a method.

What if my broker doesn't track basis?

For purchases after 2011, brokers are required to track. For older purchases, your records control.

Cost basis for inherited assets?

Stepped-up to fair market value at date of death. Get the closing price on that date from your broker or financial data sources.

Putting this into practice this week

Concepts only matter if they change behavior. Pick the single most relevant action from the above and put it on your calendar — even 15 minutes of action beats hours of further reading without doing anything. The compound benefit of small consistent moves dwarfs the optimization gain from any single decision. Most people fail at finance not because they don't know what to do, but because they don't act on what they already know.

How this connects to the rest of your financial plan

Personal finance is a system, not a list of independent decisions. The choices you make in one area cascade into others: a tax-loss harvest affects your asset allocation, a 401(k) contribution affects your near-term cash flow, a Roth conversion in 2024 affects RMDs in 2050. Sophisticated financial planning is mostly about understanding these second- and third-order effects. The basics that everyone should master first: emergency fund in cash, capture the full 401(k) match, eliminate high-interest debt, max tax-advantaged accounts before taxable, write down a single-page financial plan and review it annually.

Key takeaways

  • Understand the mechanics before you optimize the edges. A solid 70% strategy beats a fragile 95% optimization.
  • Automate behavior so you don't depend on willpower. Set-it-and-forget-it is the highest-leverage financial habit.
  • Match the strategy to your actual situation, not the situation you wish you had or that influencers describe.
  • Review annually; ignore daily noise. The market's short-term moves rarely require a response.
  • Consistency over decades beats brilliance over months. Time in the market does the work; trying to time it usually destroys it.

The bottom line

The biggest financial wins come from doing the simple things consistently for decades — not from finding the cleverest single trick. Build the foundation first; the optimizations layer on top once the foundation is solid. The investors who end up wealthy aren't the ones who picked the best stocks. They're the ones who saved consistently, kept costs low, took appropriate risk for their horizon, and didn't sell during crashes. Everything else is detail.

Continue your learning at Krovea

Krovea exists to connect every concept on this page to the next one you should read. Use the site-wide search for any term you're unsure about. Run the relevant numbers on a Krovea calculator with your actual situation — projections beat speculation every time. Look up unfamiliar jargon in the A–Z dictionary. Most readers find their first session on Krovea answers one question and surfaces three more — that's how compounding knowledge works. Subscribe to the weekly briefing if you want the highest-impact one topic delivered without the noise of constant financial media.

A final note on financial decision-making

Every concept covered here exists because someone made a costly mistake first and the rule emerged from the consequences. The 401(k) match exists because Americans weren't saving enough. The Roth IRA exists because mid-century retirees got taxed twice on their nest eggs. The wash-sale rule exists because traders abused loss harvesting. Treat each piece of advice not as arbitrary rules to memorize but as the encoded lessons of prior generations of investors. The framework that survives recessions, regulatory changes, and market manias has been stress-tested in ways no individual could replicate. Following the boring conventional wisdom isn't unimaginative — it's the result of selecting for what actually works at scale across millions of investors and dozens of market cycles.

One last thing — when in doubt, do less

The average investor underperforms their own funds by 1–2% per year because of trading mistakes — entering after rallies, exiting after crashes, switching strategies after they stop working. Inaction has a cost, but action has a much bigger one. When you're not sure what to do, the right answer is usually nothing. Pick the next paycheck's contribution, automate it, and look away until tax season.

Tax season

Get tax software that maximizes your refund

Free federal filing for simple returns. Find software that handles investments, rentals, and business income.

Free service. We may earn a referral fee from partners — never from you.

Frequently asked questions

What is cost basis methods?
FIFO, LIFO, specific identification — and why specific ID is usually best.
How does cost basis methods affect long-term investors?
Understanding cost basis methods helps shape better long-term decisions around portfolio construction, risk management, and timing. See the article above for the specific implications.
Who should care about cost basis methods?
Anyone managing their own investments or planning for retirement benefits from understanding cost basis methods. This article covers what matters most.
Where can I learn more?
Browse the related articles in the sidebar, or check our financial dictionary for definitions of any term you encountered.

Questions & community

Be the first to ask a question about this page.

Ask a question

Your question will be reviewed before publishing. We don't share your email.

Found this useful?

Pass it on — someone you know is asking the same question.

Facebook Twitter LinkedIn Email
Educational content only. Not investment, tax, or legal advice. Verify current rules and consult a qualified professional for your situation.