Statspresso Statspresso
E-commerce

How to Calculate Cost of Goods Sold

Calculate Cost of Goods Sold (COGS). Determine gross profit.

Formula

Start + Purchases - End

Cost of Goods Sold

Cost of Goods Sold (COGS) represents the direct costs associated with producing or purchasing the goods sold by a business. For physical products, COGS includes raw materials, manufacturing labor, and factory overhead. For software (SaaS), COGS typically includes server hosting costs, third-party API fees, and customer support salaries. COGS does NOT include indirect expenses like marketing, sales, or R&D. It is the primary input for calculating Gross Profit and Gross Margin. Managing COGS is essential for maintaining competitive pricing; if your production costs are too high, you will be forced to either raise prices (risking volume) or accept lower margins (risking survival). For scaling startups, ‘COGS Optimization’—such as negotiating better cloud hosting rates or manufacturing bulk-discounts—is a major driver of increased capital efficiency and higher company valuations. Accurate COGS tracking is also vital for tax reporting, as it is deducted from gross revenue to determine taxable income.

Worked example

The defaults – $50,000 of beginning inventory, $30,000 of purchases, $45,000 of ending inventory – give a COGS of $35,000.

Reading the movement is as informative as the total. Inventory fell by $5,000 over the period while $30,000 was purchased, which means $35,000 of stock left the building: the business sold more than it replaced. Sustained over several periods that shows up as thinning shelves rather than growing profit, and the identity above is what makes it visible.

What COGS deliberately leaves out

COGS captures the direct cost of the goods actually sold, and nothing else. Marketing, salaries, rent, software and shipping to the customer are operating expenses; they sit below the gross profit line and never enter this calculation. That exclusion is the entire point – it isolates product economics from the cost of running the company.

Which is also why COGS on its own is hard to act on. An absolute dollar figure rises whenever sales rise, so it cannot tell you whether unit economics improved.

For that, express it against revenue with the gross margin calculator. A COGS of $35,000 on $70,000 of revenue is a 50% gross margin; the same $35,000 on $100,000 of revenue is 65%. The absolute number is identical and the businesses are not comparable.

Try asking Statspresso

“COGS as % of revenue.”

Ask now

Benchmarks

COGS benchmarks vary so dramatically by business model that the most important comparison is against your own historical trend, not industry averages. For SaaS, rising COGS as a percentage of revenue indicates scaling infrastructure costs or support headcount that is not yet leveraged. Target: COGS should grow slower than revenue.

Tier

Benchmark

What It Means

SaaS

10–30% of revenue

Pure software. Lower is better. Hosting, CS, and support are primary costs.

E-commerce

40–60% of revenue

Physical goods plus fulfilment. Below 50% is healthy for most categories.

Manufacturing

50–70% of revenue

Varies widely by industry and automation level.

Food/Beverage

25–40% of revenue

Higher COGS with tight margins. Volume is essential.

Frequently asked questions

Does COGS include marketing spend?

No; COGS only includes direct costs like raw materials and manufacturing labor.

How does COGS impact pricing?

Your price must be high enough to cover COGS plus your desired gross profit margin.

What is 'First-In, First-Out' (FIFO)?

An inventory accounting method where the oldest stock is assumed to be sold first.

Why is COGS higher in winter?

For some, heating and logistics costs spike, raising the cost of goods delivered.

Impact on company taxes?

COGS is deducted from revenue to calculate taxable income; accurate tracking is essential.