Skip to main content
Stock Tax Calculator
EN
Open calculator

Stock Cost-Basis Methods Compared: Moving Average, FIFO, LIFO, HIFO and LOFO

The five methods in thestock tax calculatorall answer the same question: when you sell shares, which purchase record should be used as thecost basis? This article explains the differences, pros, cons and suitability ofmoving weighted average,FIFO,LIFO,HIFOand LOFO, so you can get the materials straight before filing.

Key takeaways (TL;DR)

  • China's usual treatment: China's Individual Income Tax Law and filing practice generally recognize the weighted-average method first for calculating the original value of transferred property.
  • Common overseas treatment: overseas tax authorities such as the US IRS generally use FIFO (first in, first out) as the default rule, or allow specific share identification (HIFO, highest cost first out).
  • Practical effect: the five methods change the order in which cost is deducted for the period; in a rising bull market, HIFO usually produces lower realized gain for the period while FIFO produces higher gain; after all positions are closed, cumulative gain is identical.
Default and conservative

Start with FIFO or moving average

FIFO has clear record requirements and moving average is smoother; both are suitable for pre-filing estimates and checking materials.

Lower current gain

Usually look at HIFO

HIFO matches the highest-cost lots first, which often lowers realized gain, provided the lots and cost basis can be explained.

Realize gains deliberately

Might look at LOFO

LOFO matches the lowest-cost lots first and usually increases realized gain; it suits planning where gains need to be recognized deliberately.

Record requirements

HIFO/LOFO are the highest

These are not separate official tax-law method names; more precisely, they are strategies for choosing lots when the shares sold can be specifically identified.

Start by separating inventory costing from stock cost basis

Tax calculation methodsare most often confused when enterprise inventory accounting and personal investment assets are discussed together. The Ministry of Finance's Accounting Standard for Business Enterprises No. 1 — Inventories (《企业会计准则第1号——存货》) addresses inventory held for sale, production or consumption in ordinary activities; the cost of issued inventory may use first in, first out, weighted average or specific identification.

Stocks, funds and bonds as investment assets are more concerned withcost basis: how purchase price, commissions and other costs enter the sale-gain calculation. IRS Publication 551 explains that the basis of stocks and bonds generally includes the purchase price and costs of purchase; IRS Publication 550 discusses specific share identification, FIFO and average basis under cost basis for investment income.

For this reason, thestock tax calculatorat CRS.im treats these methods as pre-filing calculation conventions and scenario-comparison tools. It can show how yearly gains differ under each convention, but it cannot replace local tax-law judgment, broker confirmation or professional tax advice.

The five tax calculation methods compared

Below are the five methods currently supported by the stock tax calculator. The point is not to memorize definitions, but to understand how each method changes cost basis, realized gain and record-keeping requirements.

Average
Method 1

Moving weighted average

Spreads the holding cost of the same security into an average unit cost, producing a smoother result.

Moving weighted average updates the average cost after a purchase and uses the average unit cost to calculate realized gain on a sale. It suits an initial overall estimate, especially for users who do not want to identify lots trade by trade.

Advantages

  • Fluctuations are smoothed and the result is easy to understand.
  • Useful for a quick estimate of the year's net gain.
  • Matches many users' intuition of “average cost.”

Disadvantages

  • For ordinary shares, some tax jurisdictions may not accept it as a formal filing method at will.
  • When prices swing sharply, it blurs differences between actual purchase lots.
  • It may not suit cases that require lot-by-lot proof of the shares sold.

Suitability

Useful for a preliminary review in the stock tax calculator and for seeing the rough yearly gain; confirm whether it is accepted under the applicable rules before formal filing.

FIFO
Method 2

FIFO (first in, first out)

Sells the earliest purchased lot by default; the rule is clear and record requirements are relatively low.

FIFO matches cost basis on a first-bought, first-sold basis. Where the specific shares sold cannot be adequately identified, the IRS public FAQ also treats FIFO as one of the default directions for stock cost basis.

Advantages

  • The rule is intuitive and the cost of explaining it in an audit is relatively low.
  • With long holding periods, it is easier to match earlier purchase lots.
  • Useful as a benchmark against other methods.

Disadvantages

  • In a rising market, earlier lots usually have lower cost, so realized gain may be higher.
  • It does not necessarily reduce the current tax burden.
  • If the actual intention was to sell another lot, extra records are needed.

Suitability

Suits investors who value simplicity, explainability and a default convention, and serves as a conservative benchmark for pre-filing checks.

LIFO
Method 3

LIFO (last in, first out)

Matches the most recently purchased lots first, often producing the opposite result to FIFO.

LIFO matches cost basis on a last-bought, first-sold basis. It has specific boundaries in inventory accounting; for investment assets, it is better understood as a way of choosing lots when specific identification is possible.

Advantages

  • In a rising market, recently purchased lots may have higher cost, reducing current gain.
  • Closer to how some short-term traders actually think about sells.
  • Provides a clear contrast with FIFO.

Disadvantages

  • It is not necessarily accepted in every tax jurisdiction or filing scenario.
  • It may match short-term lots, and the tax result is not necessarily better.
  • You need to explain why the most recent lots were sold.

Suitability

Suits active traders for scenario comparison; before using it formally, confirm local rules, broker records and whether lot evidence supports it.

HIFO
Method 4

HIFO (highest cost first out)

Matches the highest-cost lots first and is often used to lower realized gain for the period.

HIFO is not a standalone official method named by the IRS. More precisely, it is a strategy of choosing the lot with the highest cost basis first when the shares sold can be specifically identified.

Advantages

  • It usually lowers realized gain and may even produce a loss.
  • Useful for comparing tax outcomes in rising or volatile markets.
  • Helps show the effect of high-cost lots on the result.

Disadvantages

  • High record requirements: you must prove the purchase lot, sale lot and cost basis.
  • It may sacrifice the rate advantage of long-held lots.
  • Compliance risk rises without broker confirmation or clear records.

Suitability

Suits users with complete trade records who want to compare a lower-current-gain approach; it is pre-filing analysis, not a substitute for professional tax judgment.

LOFO
Method 5

LOFO (lowest cost first out)

Matches the lowest-cost lots first and usually increases realized gain for the period.

LOFO is the opposite of HIFO: when the shares sold can be specifically identified, it chooses the lot with the lowest cost basis first. It is generally not intended to reduce current gain.

Advantages

  • Useful for deliberately recognizing gains, using loss offsets or planning comparisons.
  • Shows the upper bound of gain under the least favorable cost matching.
  • Helps explain the tax effect of old, low-cost lots.

Disadvantages

  • It usually increases realized gain for the period.
  • Not suitable for users whose only goal is to minimize current tax.
  • It also requires clear lot and cost-basis records.

Suitability

Suits stress testing, gain-realization planning or method comparison; ordinary users should not treat it as a default low-tax approach.

Tax calculation methods comparison table

If you only need a pre-filing review, compare FIFO, moving average and HIFO first. FIFO is a clear benchmark, moving average shows the overall trend, and HIFO shows sensitivity to lowering current gain.

MethodTendency of tax resultRecord requirementsSuitable usersRisk note
Moving weighted averageGains are smoothedMediumQuick estimates, yearly reviewApplicability to formal filing for ordinary shares must be confirmed separately
FIFOMay be higher in a rising marketLow to mediumDefault convention, long-term holdersDoes not necessarily lower current gain
LIFOMay be lower in a rising marketMedium to highShort-term trading comparisonsCheck jurisdictional acceptance and short-term lot effects
HIFOUsually lowerHighComparing lower-current-gain scenariosMust be able to explain specific lot identification
LOFOUsually higherHighDeliberate gain realization, stress testingMay significantly increase current gain

How to review a Futu annual statement before filing

Keep the original Futu annual statement first, then run thestock tax calculatorunder different methods to produce yearly results. Focus on how each method affects sell gains, losses, fees, currencies and ending holdings, rather than staring at a single final number.

If you only want a quick view of yearly gains, moving average and FIFO are usually easier to explain. If you are comparing tax sensitivity, HIFO, LIFO and LOFO can show how lot selection affectscost basis.

Chinese tax residents with foreign income should also watch the filing window, foreign tax payment evidence and credit materials. Method choice is only part of preparing the workpaper; formal filing still follows the competent tax authority's requirements and professional advice.

Frequently asked questions

Answers to the most common questions about the five cost methods: cost conventions, filing choices, cross-year cost and the calculator's limits.

Do the five cost methods change the total tax?

The methods change which cost lots are matched on a sale, and therefore how realized gains are distributed across years. Once all positions are eventually sold, cumulative gain is the same, but the gain recognized in each year and the applicable rules may differ.

Which cost method should I choose for a Chinese filing?

China's Individual Income Tax Law does not provide a broker-style “choose one of five” menu for stock cost basis. In practice, organize the original value and reasonable expenses of property transfer income and follow the competent tax authority's requirements. Moving average and FIFO are easier to explain; HIFO, LIFO and LOFO are better suited to scenario comparison.

Can I change cost methods every year?

Changing methods should not be used as a tool to reduce tax. Once a method is used in a filing workpaper, the treatment should stay consistent and the transition should be explainable. If a change is needed, first confirm the applicable rules, record-keeping requirements and the competent tax authority's view.

What if cost is missing across years?

First use the ending holdings in the prior year's Futu annual statement to fill opening cost. Any part that cannot be matched automatically must be completed manually by symbol, quantity and purchase record, with the original evidence retained.

Will the calculator choose the filing method for me?

No. The calculator only calculates under the convention you select and shows the differences. It does not decide which method a tax authority will accept, and it does not replace a formal filing.

Compare methods first, then prepare filing materials

Upload a Futu statement, compare moving average, FIFO, LIFO, HIFO and LOFO results in the stock tax calculator, then review them against formal filing requirements.

Open the stock tax calculator

Sources

This page references docs/jisuan.md and draws on official public materials from the IRS, the Ministry of Finance and the State Taxation Administration to explain tax calculation methods and the boundaries of the stock tax calculator. The content is not personalized tax advice.

This page is a translation of the Simplified Chinese original. If there is any discrepancy, the Simplified Chinese version prevails.