Applicable Period: Tax Year 2025 (Filing 2026)Last Updated: October 20, 2026Accounting Methodology7 min read

FIFO vs. Weighted Average Cost Basis: Accounting Methods & Calculations

When an investor accumulates shares of a company across multiple tranches (Dollar-Cost Averaging) and later sells a fraction of the holding, determining which specific shares were disposed of is critical. Tax jurisdictions primarily recognize two matching methodologies: FIFO (First-In, First-Out) and Weighted Average. Here is how they operate.

BrokerTax Global Research

International Capital Markets Tax Team

Executive Summary & Key Takeaways
  • FIFO (First-In, First-Out) matches sell orders against the earliest acquired tax lots first.
  • Weighted Average Cost Basis blends all purchase prices into a single moving average cost per share.
  • FIFO is the legally mandated or default standard in most European jurisdictions (including Poland, Czechia, Slovakia, and Germany).
  • The chosen accounting method cannot be switched arbitrarily within the same tax year for the same security.
  • BrokerTax implements deterministic, zero-float FIFO algorithms with exact transaction timestamps.

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

Under the FIFO convention, an asset purchased earliest is assumed to be sold earliest. In an inflationary or appreciating bull market, FIFO typically pairs the lowest cost base first, yielding higher short-term realized gains while allowing newer, higher-priced shares to remain in the portfolio.

FIFO is especially advantageous in countries with holding period exemptions, because older lots cross the tax-exempt threshold sooner.

2. Step-by-Step Practical Calculation Example

Consider an investor executing the following trades throughout the year:

• Tranche 1 (Jan 10): Buy 20 shares @ $100 ($2,000)

• Tranche 2 (Apr 15): Buy 20 shares @ $150 ($3,000)

• Sale (Nov 20): Sell 25 shares @ $200 ($5,000)

Under FIFO: The 25 sold shares are composed of all 20 shares from Tranche 1 (Cost = $2,000) plus 5 shares from Tranche 2 (Cost = 5 × $150 = $750). Total Cost Basis = $2,750.

Realized Capital Gain = $5,000 − $2,750 = $2,250. Remaining in portfolio: 15 shares from Tranche 2 at $150 cost basis.

3. Weighted Average Cost Basis

Under the moving weighted average method, the cost per share is recalculated after every purchase:

Average Cost = (Total Capital Invested) ÷ (Total Shares Held). When shares are sold, the current average cost is applied to all disposed units. While simpler in spreadsheet math, it can complicate multi-year time-test tracking under capital gains tax rules.

BrokerTax defaults to strict, deterministic FIFO matching with microsecond precision, ensuring audit-proof tax reports ready for revenue authorities.

Comparison MetricFirst-In, First-Out (FIFO)Weighted Average Cost (AVCO)
Cost Basis AllocationOldest purchases matched chronologicallyBlended aggregate average cost across holdings
Bull Market Tax DragHigher short-term realized gains (lowest cost lots sold first)Smoothed, lower initial taxable gains
Loss Harvesting in Bear MarketRealizes larger initial capital lossesModerated loss realization across blended pool
Time-Test & Exemption TrackingPreserves individual lot holding dates for tax reliefComplicates discrete multi-year holding duration
Statutory European DefaultMandatory in Czechia, Poland, Slovakia & GermanyPermitted / mandatory in UK (Section 104 Pool)
Universal Multi-Broker Tax Engine100% Anonymous & Zero-Retention

Stop wrestling with broker spreadsheets and multi-currency exchange rates

Drop your statement CSVs or PDFs into BrokerTax. Get audit-ready capital gains summaries, FIFO lots, and foreign dividend withholdings in seconds.

Strict FIFO lot matching & fractional shares
Central bank historical rate conversions
Interactive Brokers, Degiro, XTB, Trading 212
Calculate Capital Gains Free⚡ Instant calculation in 15s • No registration needed

Frequently Asked Questions

?Which method does BrokerTax use by default?

BrokerTax defaults to strict FIFO matching with microsecond timestamp ordering, in compliance with international tax standards and European tax revenue service directives.

?How are fractional shares handled under FIFO?

Fractional shares are treated identically to whole units, tracked with mathematical precision using decimal.js up to 20 decimal places.

Related Guides

FIFO vs Weighted Average Cost Basis Guide | BrokerTax