Cost Of Goods Sold Calculator
Build cost of goods sold from the inventory roll-forward, split it into its components, and see the cash the income statement never shows you.
Cost Of Goods Sold Calculator
Results recalculate instantly on every keystroke. Nothing you type is transmitted.
What this result does not account for
- Assumes a single inventory pool rather than multiple locations or classes.
- The component split is a percentage allocation, not a costed bill of materials.
- Does not model FIFO, LIFO or weighted average valuation differences.
In short: Opening inventory of $400,000 plus $952,000 of purchases less $440,000 of closing inventory gives cost of goods sold of $912,000 — 38.00% of revenue and a 62.00% gross margin. The $40,000 inventory build is cash spent that never touches the income statement.
Formula
Cost of goods sold is a residual that falls out of the stock count, not a figure measured directly. That is why the count matters so much.
Worked Example
- Start with opening stock. $400,000 of inventory carried in from the prior period, already paid for and sitting on the shelf.
- Add everything bought or made. $952,000 of purchases and production costs gives $1,352,000 of goods available for sale.
- Deduct what is left. $440,000 still on the shelf at period end leaves $912,000 as the cost of what actually sold.
- Check it against revenue. $912,000 on $2,400,000 is 38.00% of revenue, giving a 62.00% gross margin.
- Find the hidden cash. Inventory rose $40,000, so purchases exceeded COGS by that amount. The income statement never shows it.
Cost of goods sold is a residual, and that has a consequence most people never think through: it is not measured, it is inferred from the stock count. Every pound of inventory miscounted moves reported profit by a pound in the opposite direction, and because the count happens once at period end there is usually nothing to check it against. This is why stock-heavy businesses get audited on their count above almost anything else, and why a business that has quietly accumulated obsolete inventory reports better margins than it is earning — the obsolete goods are sitting in closing stock, holding cost out of the income statement, until someone finally writes them off and a single period absorbs years of accumulated error.
Strengths & Limits Of This Model
Where this engine is strong
- Builds COGS from the roll-forward so the derivation is visible, not assumed.
- Isolates the inventory movement as a cash item the income statement hides.
- Flags the arithmetically impossible case where closing stock exceeds goods available.
Where it stops
- Cannot handle work in progress as a separate stage.
- Does not model standard costing variances.
Practical Use Cases
Preparing accounts from a stock count
The roll-forward is the standard derivation. Opening plus purchases less closing, and the residual is your cost of sales.
Explaining why profit and cash disagree
A $40,000 inventory build is cash spent that never hit the P&L. Trace it through the Cash Flow Calculator.
Targeting cost reduction
Split the cost into materials, labour and overhead first. The right lever is whichever component is largest, not whichever is easiest.
Checking stock efficiency
Average inventory against cost gives days on hand. Push it further with the Inventory Turnover Calculator.
Methodology & Editorial Standards
Cost of goods sold is derived from the inventory roll-forward rather than accumulated directly: opening inventory plus purchases and production costs, less closing inventory, leaves the cost of what was actually sold. The engine emphasises that this makes cost of sales a RESIDUAL, which has the practical consequence that any error in the physical stock count moves reported gross profit by an equal and opposite amount, with no independent measurement available to catch it. The component split into direct materials, direct labour and absorbed manufacturing overhead is included because cost reduction targeted at the wrong component achieves nothing, and because direct labour sitting inside cost of goods rather than in operating expenses is a routine source of confusion when payroll totals are reconciled. The engine also isolates the inventory movement as a cash item: when purchases exceed cost of goods sold the difference is cash that left the business without appearing on the income statement, which is one of the most common reasons a profitable business runs short of money. Average inventory and days on hand are computed from the same roll-forward so the working capital consequence is visible alongside the margin. The engine implements the standard published formula for this calculation. Inputs are validated for domain and sign before evaluation, and any undefined case returns an em-dash rather than a spurious value.
Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.
This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.
Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.
Cost Of Goods Sold Calculator — 20 Expert FAQs
20 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.
How is cost of goods sold calculated?
Beginning inventory plus purchases less ending inventory. Here $400,000 + $952,000 − $440,000 gives $912,000.
Why is COGS a residual?
Because it is inferred from the stock count rather than measured. Every error in the count moves profit by the same amount.
What is included in COGS?
Direct materials, direct labour and manufacturing overhead — everything consumed delivering the product. Selling and admin costs sit below the line.
Is direct labour in COGS or payroll?
In COGS. That is why total payroll rarely reconciles to the operating expense line, and it confuses people constantly.
Why do purchases and COGS differ?
Because inventory changed. Purchases of $952,000 against $912,000 of COGS means $40,000 went into stock.
Does inventory build show on the income statement?
No. It is cash spent that never appears as an expense, which is why profitable businesses run out of money.
What gross margin should I expect?
Entirely sector-dependent. Software runs above 75%, distribution often below 25%. Compare only within your sector.
How does obsolete stock affect COGS?
It sits in closing inventory holding cost out of the P&L, flattering margin until it is written off in one painful period.
What is goods available for sale?
Opening inventory plus purchases — $1,352,000 here. It is the pool from which COGS and closing stock are split.
Should freight be in COGS?
Inbound freight yes, it is part of acquiring the goods. Outbound delivery to customers is usually a selling cost.
How does absorbed overhead behave?
The same fixed factory cost over fewer units raises unit cost without anything getting more expensive. Volume drives it.
What is one point of COGS worth?
$9,120 here, straight to gross profit, with no extra selling effort and no extra working capital.
Is a point of cost better than a point of revenue?
Usually yes. Cost reduction arrives whole; revenue arrives net of the cost of delivering it.
How do FIFO and LIFO change this?
They change which costs land in closing stock, so both COGS and profit shift when prices are moving. The roll-forward structure is unchanged.
Should I use average or closing inventory for days on hand?
Average, where you have both ends. Closing alone distorts badly for any seasonal business.
What if closing stock exceeds goods available?
That is impossible and the engine flags it. Something is wrong with the count, the purchases figure, or a write-on has been posted.
Is this cost of goods sold calculator free to use?
Yes. It is free, requires no account, and has no usage limits. ApexConverter is funded by contextual advertising, never by selling user data.
Is my data sent to a server?
No. The engine runs as Vanilla JavaScript inside your browser under our Zero-Server Client-Side Execution model. Your figures are computed locally and are never transmitted, logged, or stored.
How accurate is this calculator?
It applies the standard closed-form formula in IEEE-754 double precision, rounding only at the display layer. The engine is reconciled against an independent reference implementation before release.
Does it work on mobile?
Yes. The interface is mobile-first with numeric keypad hints and is tested down to a 320-pixel viewport with no horizontal scrolling.