COGS Calculator

Cost of goods sold, gross margin, inventory turnover and unit costs.

About this tool

For a period, enter beginning inventory, purchases or production costs, ending inventory, revenue and the number of days. You'll see COGS, gross profit, gross margin, markup, inventory turnover and days of inventory. Below, build a product's unit cost from materials, labour, packaging and shipping and compare it with the selling price.

What COGS includes and why it matters

Cost of goods sold (COGS) is the direct cost of the products a business sold during a period. The standard formula is beginning inventory + purchases (or production costs) โˆ’ ending inventory. For example, starting with 40,000 of stock, buying 120,000 more and ending with 35,000 gives COGS of 125,000. Against 210,000 of revenue, that's 85,000 of gross profit and a 40.5% gross margin (a 68% markup on cost). COGS includes materials, direct labour, factory overheads, packaging and inbound freight: the costs that rise and fall with what you make or buy to sell. It doesn't include marketing, office rent, admin salaries or outbound delivery, which are operating expenses below gross profit. Gross margin shows how much each sale contributes towards overheads and profit, so it's the first number to check when setting prices. Inventory turnover (COGS รท average inventory) shows how quickly stock sells. 3.3 times a year means about 110 days of stock on hand, and money tied up in slow-moving stock is cash you can't use elsewhere. The per-unit builder helps price a single product: with 11.50 of unit costs and a 29 price, the margin is 60%. Honest limits: inventory valuation methods (FIFO, weighted average) change COGS when costs move, and the tax and accounting treatment depends on your jurisdiction, so check with an accountant. Works in any currency. The margin calculator, the product pricing calculator and the inventory turnover calculator are related, and Margin vs markup: why 50% markup is 33% margin, and how to price from either explains the difference.

Frequently asked questions

How do you calculate COGS?

COGS = beginning inventory + purchases โˆ’ ending inventory.

What is included in cost of goods sold?

Direct costs of products sold, such as materials, direct labour, production overheads, packaging and inbound shipping. Marketing and admin costs aren't included.

What is the difference between gross margin and markup?

Margin is gross profit รท revenue, and markup is gross profit รท cost. A 40.5% margin here is a 68% markup.

Is anything stored?

No. Calculations run in your browser and nothing is stored or sent.