Audited 29 Jul 2026·Last updated 29 Jul 2026·6 citations·Tier 1·0 uses

COGS Calculator — Cost of Goods Sold

Free cost of goods sold calculator. Works the IRS Schedule C Part III inventory flow — beginning inventory plus purchases and labour, less ending inventory.

COGS Calculator

What do you want to work out?
Gross receipts less returns and allowances — Schedule C line 3. Used for gross profit and the COGS ratio; it does not affect the COGS figure itself.
$
Schedule C line 35 / Form 1125-A line 1. This must equal last period's closing inventory; if it does not, fix that before trusting anything below.
$
Schedule C line 36 — merchandise and raw materials bought during the period, LESS the cost of anything you withdrew for personal use. Include freight-in.
$
Schedule C line 37 / Form 1125-A line 3 — direct production labour only. Do not include your own draw as a sole proprietor, and do not include selling or administrative salaries.
$
Schedule C line 38 — production materials and supplies consumed in making what you sold, where they are not already inside Purchases.
$
Schedule C line 39 — containers, packaging, freight-in not already counted, factory overhead and any section 263A costs you are required to capitalise into inventory.
$
Schedule C line 41 / Form 1125-A line 7 — your closing count, valued on the method you actually use (cost, lower of cost or market, or retail). Used when solving for COGS.
$
The COGS figure your accounting system already produced. Used when solving backwards for the closing inventory it implies.
$
Cost of goods sold
$190,000.00
Schedule C line 42 / Form 1125-A line 8. This is the cost of what you SOLD, not what you spent: inventory you bought and still hold is an asset on the balance sheet, not an expense, until it leaves. Your figure also depends on the inventory valuation method you use — FIFO, LIFO and weighted average give different answers from identical transactions.
Goods available for sale
$235,000.00
Ending inventory
$45,000.00
Inventory change
$5,000.00
Gross profit
$210,000.00
COGS as % of revenue
47.50%

Background.

Cost of goods sold is the most commonly miscalculated line on a small business return, and almost always for the same reason: people add up what they spent on stock instead of what they sold. Those are different numbers. Inventory you bought and still hold sitting in a warehouse is an asset, not an expense. It only becomes cost of goods sold when it leaves — which is why COGS is computed from an inventory flow rather than from a bank statement.

The identity is fixed, and both the IRS and international accounting standards describe the same movement. Start with the inventory you were holding at the beginning of the period. Add everything you put into stock during the period: purchases, direct production labour, materials and supplies, and other costs such as containers, packaging and freight-in. That total is goods available for sale. Subtract what you were still holding at the end, and the remainder is what you sold. IRS Schedule C Part III lays it out as lines 35 through 42 exactly that way, and Form 1125-A does the same in eight lines for corporations and partnerships.

This calculator runs that identity in both directions. Forward — the ordinary case — you enter your closing count and get the expense figure. Backward, you enter the COGS your accounting system already produced and get the closing inventory it implies, which is the fastest shrinkage check there is: solve for ending inventory, compare it against your physical count, and the gap is theft, breakage, a miscount, or a costing error. Alongside the primary figure you get goods available for sale, the inventory change for the period, gross profit against your net sales, and COGS as a percentage of revenue.

Two things change the answer that no formula can settle for you. The first is your inventory valuation method. Identical purchases produce different COGS depending on whether you cost them out first-in-first-out, last-in-first-out, or on a weighted average — and in a period of rising prices LIFO pushes the newest, most expensive units into COGS and leaves the oldest, cheapest ones on the balance sheet, reducing reported profit. This is where US and international rules genuinely diverge: IRS Publication 538 lists specific identification, FIFO and LIFO as permitted cost-flow methods, while IAS 2 permits only first-in-first-out and weighted average cost for interchangeable items. A US filer and an IFRS reporter can arrive at legitimately different COGS from identical transactions. If you report under both, they will not agree, and neither is wrong.

The second is which indirect costs you are required to capitalise into inventory rather than deduct immediately. The uniform capitalisation rules of section 263A pull certain indirect production and purchasing costs into inventory cost, with an exemption for smaller businesses whose average annual gross receipts fall below a threshold that is inflation-adjusted and changes from year to year. This page does not guess that threshold or apply the rules for you. If section 263A is in scope for your business, the amount you capitalise belongs in the "Other costs" field, and the figure itself needs to come from your accountant or from the current-year IRS instructions — not from a calculator.

One more scope note before you start. This page assumes you carry inventory. A pure services business has no inventory flow at all; under Regulation S-X the equivalent line is "cost of services", which is a direct-cost total rather than a movement between two counts. If you have no opening and closing stock to count, this identity does not describe your business, and you should be adding up direct costs instead. Enter your figures below, then read the explainer for exactly which costs belong on which line.

What is cogs calculator?

Cost of goods sold is the cost of the inventory a business actually sold during a period. It is computed from the movement of inventory rather than from cash spent, using the identity: beginning inventory + purchases + cost of labour + materials and supplies + other costs − ending inventory = cost of goods sold. The middle five terms sum to goods available for sale. IRS Publication 334 sets this out as Schedule C Part III lines 35 through 42 for sole proprietors, and Form 1125-A carries the identical eight-line structure for corporations and partnerships; line 40 is goods available for sale and line 42 is cost of goods sold. The same principle governs financial reporting. IAS 2 Inventories states that "when inventories are sold, the carrying amount of those inventories is recognised as an expense in the period in which the related revenue is recognised", and defines cost as comprising "all costs of purchase, costs of conversion (direct labour and production overhead) and other costs incurred in bringing the inventories to their present location and condition". On a US public filing, Regulation S-X Rule 5-03 requires registrants to "state separately the amount of (a) cost of tangible goods sold" within costs and expenses applicable to sales and revenues. Cost of goods sold is subtracted from net sales to give gross profit, and it is an absorption-costing figure: it includes fixed production overhead allocated to units, which is what distinguishes it from contribution margin.

How to use this calculator.

  1. Choose a direction. Solve for cost of goods sold if you have counted your closing inventory. Solve for ending inventory if your accounting system has already produced a COGS figure and you want to see what closing stock it implies — then compare that against your physical count.
  2. Enter net sales for the period. This is gross receipts less returns and allowances. It does not affect the COGS figure itself; it drives gross profit and the COGS-to-revenue ratio.
  3. Enter inventory at beginning of year (Schedule C line 35). This must equal the previous period's closing inventory. If the two do not match, stop and reconcile them — every figure downstream inherits the discrepancy, and a mismatched opening balance is the single most common cause of a COGS number that will not tie out.
  4. Enter purchases (line 36) net of anything withdrawn for personal use, then cost of labour (line 37) for direct production staff only. Your own draw as a sole proprietor is not cost of labour, and neither are selling or administrative salaries — those belong in operating expenses further down the return.
  5. Enter materials and supplies (line 38) and other costs (line 39). Other costs is where containers, packaging, factory overhead and freight-in live, and it is also where any section 263A costs you are required to capitalise into inventory belong. Get that amount from your accountant; this page does not compute it.
  6. Enter closing inventory (line 41) valued on the method you actually use, or the COGS figure from your books if you are solving backwards. Note which valuation method you used and keep using it — switching between FIFO, LIFO and weighted average changes COGS and generally requires IRS consent.
  7. Read the ratio, not just the dollars. COGS as a percentage of revenue is what makes this period comparable to the last one and to your competitors. A rising ratio means input costs are outrunning your prices; the dollar figure alone will not show you that when volume is also moving.

The formula.

COGS = ( BI + P + L + M + O ) − EI

The calculator first sums Schedule C lines 35 through 39 into goods available for sale (line 40): beginning inventory plus purchases plus cost of labour plus materials and supplies plus other costs. In the forward direction it then subtracts closing inventory to give cost of goods sold (line 42). In the backward direction it subtracts your known cost of goods sold from the same total to give the closing inventory that figure implies. The two directions are the same equation rearranged, which is why running one and feeding the result into the other returns your starting figure exactly.

Gross profit is net sales minus cost of goods sold, and COGS as a percentage of revenue is cost of goods sold divided by net sales times 100. That percentage and gross margin always sum to exactly 100%, so you can read either one off the other. Inventory change is closing minus opening inventory: positive means stock was built during the period, negative means it was drawn down.

Rounding stage: nothing is rounded part-way through. Every addition, subtraction and division is carried at full decimal precision and rounded exactly once, at the point the result is returned, to ten decimal places; the currency and percentage formatting on screen is applied afterwards by the page. A COGS of $100 against $300 of revenue therefore reports 33.3333333333%, not a prematurely truncated 33.33% that would stop gross margin and the COGS ratio summing to 100.

Using the worked example: beginning inventory $40,000 plus purchases $150,000 plus labour $30,000 plus materials $10,000 plus other costs $5,000 gives goods available for sale of $235,000. Closing inventory of $45,000 leaves cost of goods sold of $190,000. Against net sales of $400,000 that is a gross profit of $210,000 and a COGS ratio of 47.5%. Inventory change is $45,000 − $40,000 = +$5,000, meaning $5,000 of the period's purchasing went into stock rather than into cost.

Two states are rejected rather than returned, because both would produce a plausible-looking number that is arithmetically impossible. Closing inventory greater than goods available for sale would make cost of goods sold negative; a known COGS greater than goods available for sale would imply negative closing inventory. In each case the calculator names the field and shows you both figures so you can see which one is wrong.

A worked example.

Example

A small furniture maker files Schedule C. On 1 January it is holding $40,000 of timber, hardware and finished pieces. Over the year it buys $150,000 of materials and stock, pays $30,000 to the two people who actually build the furniture, spends $10,000 on consumable materials and supplies, and $5,000 on packaging, crating and freight-in. Net sales for the year are $400,000. The physical count on 31 December values closing inventory at $45,000. Goods available for sale is $40,000 + $150,000 + $30,000 + $10,000 + $5,000 = $235,000 — Schedule C line 40. Subtracting the $45,000 still on the floor gives cost of goods sold of $190,000, line 42. Gross profit is $400,000 − $190,000 = $210,000, and COGS is 47.5% of revenue. Inventory change is $45,000 − $40,000 = +$5,000: the business ended the year holding $5,000 more stock than it started with, so $5,000 of what it spent went onto the balance sheet rather than into the expense line. Notice what that does to the intuition. The business laid out $195,000 in cash across purchases, labour, materials and other costs, but only $190,000 of it is deductible as cost of goods sold this year. The missing $5,000 is not lost — it is sitting in closing inventory and will flow through cost of goods sold whenever those pieces are sold. Reading the bank statement instead of the inventory flow would have overstated the deduction by exactly that amount. Now run it backwards, which is the check worth doing every year. Suppose the accounting system reports COGS of $190,000 but nobody has done a physical count. Solving for ending inventory gives $235,000 − $190,000 = $45,000. If the warehouse then counts $41,500 of stock, the $3,500 gap is real: shrinkage, breakage, a mispriced item, or a count that missed a pallet. The identity cannot tell you which, but it tells you the size of the question, and it is a question worth asking before the return is filed. One caveat that changes how this number should be read. All of the above assumes a single, consistent inventory valuation method. If the same $150,000 of purchases were costed out LIFO rather than FIFO in a year when timber prices rose, the newest and dearest units would land in cost of goods sold and the oldest and cheapest would stay in closing inventory — pushing COGS above $190,000 and gross profit below $210,000 from exactly the same transactions. LIFO is available to this US filer under IRS Publication 538. It would not be available to the same business reporting under IAS 2.

materials And Supplies10,000
other Costs5,000
revenue400,000
known Cogs190,000
purchases150,000
ending Inventory45,000
beginning Inventory40,000
cost Of Labor30,000
solve Forcogs

Frequently asked questions.

What is the cost of goods sold formula?
Cost of goods sold = beginning inventory + purchases + cost of labour + materials and supplies + other costs − ending inventory. The five middle terms add up to goods available for sale, so the short form is goods available for sale minus ending inventory. IRS Publication 334 sets this out as Schedule C Part III: line 35 inventory at beginning of year, line 36 purchases less cost of items withdrawn for personal use, line 37 cost of labour, line 38 materials and supplies, line 39 other costs, line 40 the sum of lines 35 through 39, line 41 inventory at end of year, and line 42 cost of goods sold. Form 1125-A carries the same eight-line structure for corporations and partnerships. A pure reseller with no production simply enters zero for labour and materials, and the identity collapses to the familiar beginning inventory + purchases − ending inventory.
Why isn't COGS just what I spent on inventory this year?
Because cost of goods sold is the cost of what left, not the cost of what arrived. Stock you bought and still hold is an asset on your balance sheet; it becomes an expense only when it is sold. In the worked example the business laid out $195,000 across purchases, labour, materials and other costs but deducted $190,000, because $5,000 of that spending ended the year sitting in closing inventory. That $5,000 is not lost — it will pass through cost of goods sold in the period those items are sold. Reading the bank statement instead of the inventory flow overstates the deduction in a year when you are building stock and understates it in a year when you are running stock down.
How does FIFO, LIFO or weighted average change my COGS?
Substantially, from identical transactions. The cost-flow assumption decides which units' costs are treated as sold. In a period of rising input prices, FIFO releases the oldest and cheapest costs into COGS and leaves the newest and dearest in closing inventory, so reported gross profit is higher; LIFO does the reverse, pushing the most recent and most expensive costs into COGS and reducing reported profit. Weighted average sits between them. IRS Publication 538 identifies specific identification, FIFO and LIFO as the methods for identifying inventory cost, and separately allows inventory to be valued at cost, at the lower of cost or market, or on the retail method. You must apply your chosen method consistently, and changing it generally requires IRS consent.
Do US tax rules and IFRS give the same COGS?
Not necessarily, and this is a real divergence rather than a rounding difference. IRS Publication 538 permits LIFO for US tax purposes. IAS 2 does not: the standard permits "the first-in, first-out or weighted average cost formula for items that are ordinarily interchangeable", and LIFO is not among the permitted cost formulas. A business that reports under both regimes can therefore produce legitimately different cost of goods sold figures from the same underlying transactions, and neither figure is wrong. If you file US tax returns and also report under IFRS, expect the two COGS numbers to differ and be able to explain the reconciliation. This page computes the identity; it does not apply a cost-flow assumption for you — that is baked into the inventory values you enter.
What are section 263A costs and do they belong in this calculator?
The uniform capitalisation rules of section 263A require certain indirect production and purchasing costs to be capitalised into inventory rather than deducted as they are incurred, which moves them from operating expenses into cost of goods sold. Form 1125-A gives them their own line. There is a small-business exemption tied to average annual gross receipts, but the threshold is inflation-adjusted and changes from year to year, so this page deliberately does not state a figure or decide whether the rules apply to you. If section 263A is in scope for your business, put the capitalised amount in the "Other costs" field and take the amount itself from your accountant or the current-year IRS instructions.
What is the difference between COGS and cost of services?
COGS describes an inventory flow between two physical counts. A business with no inventory has no such flow, so the identity on this page does not describe it. Regulation S-X Rule 5-03 recognises this by requiring registrants to state separately "(a) cost of tangible goods sold" and "(d) cost of services" as different line items. For a services business the equivalent figure is a direct-cost total — billable staff time, subcontractors, per-engagement expenses — added up rather than derived from opening and closing balances. If you have no stock to count, add up your direct costs instead of using this calculator.
Is gross profit here the same as contribution margin?
No, and mixing them up is one of the most expensive confusions in small business finance. Gross profit is net sales minus cost of goods sold, and cost of goods sold is an absorption-costing figure: it carries fixed production overhead allocated into the units you made. Contribution margin subtracts only costs that vary with volume, excludes all fixed overhead, and additionally picks up variable selling costs such as sales commission and payment processing that sit below the gross profit line. Gross profit is what appears on your return and on an audited income statement; contribution margin is what tells you whether selling one more unit helps. Use the contribution margin calculator for the second question.
Why does my beginning inventory have to match last year's closing figure?
Because the identity chains across periods. This period's opening balance is definitionally last period's closing balance, and the whole inventory flow depends on that link holding. If they differ, some inventory has either been counted twice or vanished from the record entirely, and every figure downstream — cost of goods sold, gross profit, the COGS ratio, and your taxable income — inherits the error. A mismatched opening balance is the most common single cause of a COGS figure that will not tie out. Reconcile it before you use any number on this page, and if the prior year has already been filed on the wrong figure, that is a conversation for your accountant rather than a fix at this end.
What does it mean if my solved ending inventory is higher than my physical count?
It means less stock is on the floor than your books say should be, and the gap has a cause worth finding. Solving backwards from a known COGS tells you what closing inventory the accounting implies; comparing that against a real count quantifies the discrepancy. Common explanations are shrinkage (theft, internal or external), breakage and spoilage written off but never recorded, items miscounted or missed in the count, receipts booked to the wrong period, and costing errors where units were valued at the wrong price. The identity cannot distinguish between them, but it sizes the question — and finding a $3,500 gap before filing is considerably better than discovering it in an audit.
Should freight and shipping go in COGS?
Freight-in does; freight-out generally does not. The cost of getting inventory to you is part of bringing it to its present location and condition — IAS 2 puts "costs of purchase" and "other costs incurred in bringing the inventories to their present location and condition" inside inventory cost, and Schedule C's other costs line (39) is where containers, packaging and freight-in belong for tax purposes. The cost of shipping goods out to a customer is a selling expense, not a cost of acquiring inventory, and belongs in operating expenses. The practical test is direction: inbound to your stock is inventory cost, outbound to the buyer is a cost of selling.

References& sources.

  1. [1]Internal Revenue Service, Publication 334 "Tax Guide for Small Business" — Cost of Goods Sold / Schedule C Part III, lines 35–42 (retrieved 2026-07-29). Primary source for the line structure and the inventory-flow identity implemented here: line 35 inventory at beginning of year, 36 purchases less items withdrawn for personal use, 37 cost of labor, 38 materials and supplies, 39 other costs, 40 the sum of 35–39, 41 inventory at end of year, 42 cost of goods sold. Open access.
  2. [2]Internal Revenue Service, Publication 538 "Accounting Periods and Methods" — Inventories (retrieved 2026-07-29). Source for the permitted inventory valuation bases (cost; lower of cost or market; retail) and cost-identification methods (specific identification, FIFO, LIFO), and for the statement that inventory value is "a major factor in figuring your taxable income". Open access.
  3. [3]IFRS Foundation, IAS 2 "Inventories" (retrieved 2026-07-29). Independent second authority. Source for "when inventories are sold, the carrying amount of those inventories is recognised as an expense in the period in which the related revenue is recognised", for cost comprising "all costs of purchase, costs of conversion (direct labour and production overhead) and other costs incurred in bringing the inventories to their present location and condition", and for the permitted cost formulas being FIFO and weighted average only — the basis of this page's disclosed US/IFRS conflict. Standard text itself is paywalled; the cited summary page is open.
  4. [4]17 CFR § 210.5-03 (Regulation S-X, Rule 5-03) "Income statements", line item 2 (retrieved 2026-07-29 via Cornell Legal Information Institute). Third independent authority: requires registrants to "State separately the amount of (a) cost of tangible goods sold, … (d) cost of services", which is this page's basis for distinguishing cost of goods sold from cost of services. Open access.
  5. [5]Internal Revenue Service, Form 1125-A "Cost of Goods Sold" (Rev. November 2024). The corporate and partnership form carrying the same eight-line structure as Schedule C Part III, including the separate line for additional section 263A costs. Official form PDF; open access.
  6. [6]OpenStax, Principles of Accounting, Volume 2: Managerial Accounting, §6.5 "Compare and Contrast Variable and Absorption Costing" (retrieved 2026-07-29). Source for the absorption-versus-variable costing distinction underpinning this page's "gross profit is not contribution margin" caveat. Open access.

Embed

Quanta Pro

Paid features are coming later.

  • All 762 calculators remain free
  • No billing is enabled
Coming soon