COGS Calculator

Cost of goods sold, gross profit, and margin from inventory.

-

Cost of goods sold

Estimates for planning only, not financial advice.

Cost of goods sold is what it cost you to make what you sold: opening inventory plus purchases minus what is still on the shelf. With $30,000 of beginning inventory, $120,000 of purchases, and $25,000 of ending inventory, COGS is $125,000. Against $200,000 of revenue that leaves $75,000 of gross profit, a 37.5% gross margin. This calculator runs that chain and shows where each dollar of revenue goes.

How to Use This Calculator

Enter annual revenue, then the inventory chain: beginning inventory (last period\'s ending number), purchases or total production cost for the period (materials, direct labor, direct overhead), and ending inventory from your count. The calculator derives COGS, gross profit, gross margin, and markup on cost. Use consistent periods: annual revenue with annual inventory figures, never mixed.

1

Enter revenue and the three inventory numbers from your books or physical counts.

2

Put direct labor and factory overhead into purchases/production cost, not into operating expenses.

3

Read gross margin and compare to your industry. A falling margin with steady prices means costs are creeping: investigate by product line.

The COGS Formulas

COGS = beginning inventory + purchases - ending inventory Gross profit = revenue - COGS Gross margin = gross profit / revenue Markup on cost = gross profit / COGS

Margin and markup describe the same profit from opposite sides and they are not interchangeable: 37.5% margin on $200,000 of revenue equals 60% markup on $125,000 of cost. Retailers often think in markup, manufacturers in margin; know which one your counterpart means before negotiating. The inventory equation itself is just conservation of goods: everything you had or bought either sold or remains, and COGS is the sold part.

Worked Example

A specialty food retailer starts the year with $30,000 of inventory, purchases $120,000 of goods, and ends with $25,000 on the shelves. COGS = $30,000 + $120,000 - $25,000 = $125,000. Revenue for the year is $200,000. Gross profit = $200,000 - $125,000 = $75,000. Gross margin = $75,000 / $200,000 = 37.5%. Markup on cost = $75,000 / $125,000 = 60%. If spoilage of $5,000 was written off inside purchases, true product margin is actually higher and waste is the problem: split shrinkage out of COGS to see it clearly.

Gross Margin Benchmarks

IndustryTypical gross margin
Grocery / commodity retail20 to 30%
Restaurants (food cost)60 to 70%
Manufacturing30 to 50%
Software / SaaS75 to 90%
Professional services40 to 60%

When margin slips, diagnose before acting: pull it by product line, because aggregates hide the truth. A single low-margin product can drag the company average down while everything else is healthy, and the fix is repricing or discontinuing that product, not an across-the-board cost panic. For the pricing side, our margin vs markup calculator converts between the two conventions, our contribution margin calculator adds variable-cost thinking, and our unit price calculator keeps per-unit costs honest.

Estimates for planning only, not financial advice.

Frequently Asked Questions

What is COGS?

Cost of goods sold is the direct cost of producing what you sold: materials, direct labor, and manufacturing overhead tied to production. Beginning inventory plus purchases minus ending inventory gives COGS for retailers and distributors. With $30,000 of opening inventory, $120,000 of purchases, and $25,000 left at year-end, COGS is $125,000. It is the first and biggest subtraction from revenue.

What is the COGS formula?

COGS = beginning inventory + purchases - ending inventory. The logic: what you had plus what you bought, minus what is still on the shelf, equals what went out the door. For manufacturers, add direct labor and factory overhead to the purchases side. Service businesses usually have minimal COGS, which is why their gross margins run so high.

What is included in cost of goods sold?

Direct materials, direct labor (wages of people making the product), and direct overhead like factory rent and equipment depreciation. Excluded: sales and marketing, admin salaries, office rent, interest, and taxes, which sit below gross profit as operating expenses. The test is directness: would this cost vanish if you produced nothing? If yes, it is probably COGS.

How does COGS affect gross profit?

Dollar for dollar: gross profit = revenue - COGS, so every dollar of COGS is a dollar of gross profit lost. With $200,000 of revenue and $125,000 of COGS, gross profit is $75,000 and gross margin is 37.5%. Gross margin is the report card on your product economics: pricing power and production efficiency, before overhead enters the picture.

What is a good gross margin?

It depends entirely on the industry. Grocery retail runs 20% to 30%, restaurants 60% to 70% on food (before labor), software 75% to 90%, and professional services 40% to 60%. Compare against direct competitors and your own history, not against cross-industry averages. A margin below your industry norm means you are underpriced, overpaying suppliers, or wasting materials.

How can I reduce COGS?

Negotiate supplier contracts and consolidate vendors for volume discounts, reduce waste and rework in production, redesign products for cheaper materials that customers still accept, and manage inventory to cut spoilage and obsolescence. Each point of gross margin on $1 million of revenue is $10,000 of profit with no extra sales needed, which makes COGS work the highest-impact profit project most businesses ignore.

What is the difference between COGS and operating expenses?

COGS varies directly with production: make nothing, spend (almost) nothing. Operating expenses like rent, admin salaries, and marketing continue whether you produce or not. This distinction drives break-even analysis and pricing: your price must clear COGS on every unit, while operating expenses are covered by total volume. Misclassifying between them distorts both gross margin and operating margin.

Do freelancers and service businesses have COGS?

Usually minimal. A consultant's COGS might be subcontractor costs and project-specific materials; everything else is operating expense. That is why service gross margins look spectacular and net margins look ordinary: the real costs sit below the gross profit line as payroll. Do not force a COGS line where none exists just to mimic product businesses.

How does inventory method (FIFO/LIFO) affect COGS?

In rising-price environments, FIFO (first in, first out) assigns older, cheaper costs to COGS, showing higher profits and higher taxes; LIFO does the reverse. The choice changes reported COGS without changing cash reality. US GAAP allows LIFO, IFRS does not. For management decisions, use replacement cost thinking regardless of the accounting method: what will the next unit actually cost to make.

Why did my gross margin drop if prices did not change?

The usual suspects: input cost inflation you absorbed instead of passing on, a shift in sales mix toward lower-margin products, increased waste or rework, supplier price hikes on contract renewal, or inventory shrinkage and spoilage. Pull margin by product line monthly: aggregate margin hides the losers, and one bad product can drag the whole number down while everything else performs.