FIFO & Weighted Average Inventory Cost Calculator Online

Cost of goods issued and closing stock by FIFO, periodic weighted average, moving average or specific lot, exact decimals and a per-transaction ledger.

Free tool: 20 requests per minute.

Result

Press “Run” to see the result.

Send the receipts and issues of one period as transactions (JSON, CSV or XLSX): date, type (receipt / issue, also nhap / xuat), item (SKU), quantity, and unit_cost or amount for receipts, plus opening stock per item. Choose method: fifo (nhập trước xuất trước: issues consume the oldest layers), weighted_average (bình quân gia quyền cuối kỳ: one unit cost for the period from opening + all receipts), moving_average (bình quân sau mỗi lần nhập) or specific (thực tế đích danh, by lot).

All arithmetic uses integers (quantities to 6 decimals, amounts in minor units with decimals 0 for VND or 2 for USD), so there is no floating-point drift: each issue value is rounded once and the remainder stays in stock, and issuing the last unit takes the whole remaining value. The answer has a ledger per item in the style of the S10-DN stock card (quantity, unit cost, amount, running balance, the FIFO layers used), totals of receipts, issues and closing stock, the remaining FIFO layers and, for the periodic average, the rounding difference. Issues beyond the stock are refused unless allow_negative=true.

Use this in your code

curl -X POST "https://apibox.io.vn/v1/inventory-costing" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"fifo","opening":[{"item":"A","quantity":100,"amount":1000000}],"transactions":[{"date":"2026-01-05","type":"receipt","item":"A","quantity":200,"unit_cost":12000,"ref":"PN01"},{"date":"2026-01-10","type":"issue","item":"A","quantity":150,"ref":"PX01"}]}'

API documentation → Get a free API key

FAQ

Why not floats?

Repeated averages in floating point drift by fractions of a đồng. The API keeps quantities and money as integers and rounds each issue once, so receipts − issues always equals the closing value.

Is LIFO supported?

No. LIFO is not allowed under Vietnamese accounting standards (VAS 02, TT 99/2025); FIFO, weighted average and specific identification are.

How are same-day transactions ordered?

In the order you send them. For the periodic average the order does not matter: every issue of the period uses the same unit cost.