Understanding your COGS results
The figures below follow the standard inventory-accounting identity used to prepare an income statement's gross profit section.
| Metric | What it tells you |
|---|---|
| COGS | The direct cost of the inventory that was actually sold during the period. |
| Gross profit | Revenue remaining after subtracting the direct cost of goods sold — before operating expenses, interest, and taxes. |
| Gross margin | Gross profit as a percentage of revenue, a widely used measure of pricing and production efficiency. |
- This calculator uses a single aggregate purchases figure; it does not distinguish inventory costing methods (FIFO, LIFO, weighted-average), which can produce different COGS figures for the same physical inventory under U.S. GAAP.
- Gross margin here reflects only COGS; it does not subtract operating expenses (marketing, administration, R&D), which are captured further down the income statement in measures such as operating margin or net margin.
What is cost of goods sold (COGS)?
Cost of goods sold is the direct cost — materials, and for manufacturers, direct labor and manufacturing overhead — attributable to the inventory a business actually sold during an accounting period. The IRS explains in Publication 334 (Tax Guide for Small Business) that COGS is deducted from gross receipts to figure gross profit, and that businesses maintaining inventory must generally use this method to match inventory costs to the period in which the related goods were sold.
COGS is calculated using the inventory identity: beginning inventory (what was on hand at the start of the period) plus purchases or production costs incurred during the period, minus ending inventory (what remains unsold at period end). This isolates the cost of goods that left inventory through sales, rather than the cost of everything purchased or produced.
COGS excludes selling, general, and administrative expenses (such as marketing, office rent, or administrative salaries) — it is limited to costs directly tied to acquiring or producing the goods sold, consistent with how FASB Accounting Standards Codification Topic 330 (Inventory) frames inventory costing for financial reporting.
How to use this COGS calculator
- Enter beginning inventory — the value of inventory on hand at the start of the period, usually carried over from the prior period's ending inventory.
- Enter purchases (or, for a manufacturer, production costs) incurred during the period.
- Enter ending inventory — the value of inventory remaining unsold at the end of the period.
- Enter total revenue for the same period so gross profit and gross margin can be calculated alongside COGS.
- Read the cost of goods sold, gross profit (revenue minus COGS), and gross margin (gross profit as a percentage of revenue).
The formula behind COGS
COGS equals beginning inventory plus purchases during the period, minus ending inventory. For example, with $30,000 in beginning inventory, $80,000 in purchases, and $25,000 in ending inventory, COGS is $30,000 + $80,000 − $25,000 = $85,000.
Gross profit is revenue minus COGS, and gross margin expresses gross profit as a percentage of revenue. With $150,000 in revenue and $85,000 in COGS, gross profit is $65,000 and gross margin is $65,000 ÷ $150,000 = 43.3%.
Common mistakes
- Including selling, general, and administrative expenses in COGS — COGS should capture only the direct cost of the goods sold, not overhead unrelated to production or acquisition.
- Using an ending inventory figure that has not been physically verified (e.g., via a stock count), which can materially distort COGS and reported gross profit.
- Forgetting that a change in inventory costing method (FIFO vs. LIFO vs. weighted-average) changes the COGS figure even when the physical goods sold are identical.
- Treating gross margin as equivalent to net profit margin — gross margin excludes operating expenses, interest, and taxes, all of which still need to be subtracted to reach the bottom line.
Frequently asked questions
How do you calculate cost of goods sold?
Cost of goods sold equals beginning inventory plus purchases (or production costs) made during the period, minus ending inventory. This identity isolates the cost of the inventory that was actually sold, as distinct from everything purchased or held in stock.
What is the difference between COGS and gross profit?
COGS is the direct cost of the goods that were sold; gross profit is what remains after subtracting COGS from revenue. Gross margin then expresses that gross profit as a percentage of revenue, making it comparable across periods or businesses of different sizes.
Does COGS include labor costs?
It can. For a manufacturer, COGS commonly includes direct labor and manufacturing overhead tied to production, in addition to materials. For a retailer that purchases finished goods for resale, COGS is generally limited to the purchase cost of that inventory. The IRS provides guidance on what qualifies as includible costs in Publication 334.
Why does my ending inventory value affect COGS so much?
Because COGS is calculated as beginning inventory plus purchases minus ending inventory, a higher ending inventory value (meaning more goods remained unsold) directly reduces the calculated COGS, and a lower ending inventory value increases it. Accurate inventory counts and valuation are therefore essential to a reliable COGS figure.
Is COGS the same under every inventory costing method?
No. FIFO (first-in, first-out), LIFO (last-in, first-out), and weighted-average costing can each produce a different COGS figure for the same physical inventory, particularly when unit costs have changed over the period, as described in FASB ASC Topic 330. This calculator computes COGS from aggregate dollar totals and does not model the choice of costing method.
References
- Internal Revenue Service. Publication 334, Tax Guide for Small Business — cost of goods sold. irs.gov.
- Financial Accounting Standards Board. Accounting Standards Codification Topic 330, Inventory. fasb.org.
- Horngren CT, Datar SM, Rajan MV. Cost Accounting: A Managerial Emphasis. 16th ed. Pearson, 2018.