COGS Calculator
Two ways to calculate Cost of Goods Sold — pick whichever matches the data you have. Optional revenue input gives you gross margin too.
Value of inventory at the start of the period.
Cost of inventory bought (or produced) during the period.
Value of inventory remaining at the end of the period.
Add revenue to also see gross profit and gross margin.
Result
Cost of Goods Sold
$43,000.00
Beginning + Purchases − Ending
Gross Profit
$57,000.00
Revenue − COGS
Gross Margin
57.00%
Gross Profit ÷ Revenue
💡 What to include in COGS
Only costs that scale with production. Rent for your sales office, marketing spend, founder salaries — those go in operating expenses, not COGS. Misclassifying inflates your gross margin and hides the real economics.
What COGS actually measures
Cost of Goods Sold is the cost of making or buying the things you sold during a period. Not the cost of marketing them, not the cost of the office where you sold them, not the salary of the person who handled customer support — just the direct cost of the goods themselves.
Get this wrong and every downstream number is wrong. Gross profit, gross margin, contribution margin, break-even — they all depend on a clean COGS.
Method 1: Inventory accounting (for tax & GAAP)
COGS = Beginning Inventory + Purchases − Ending Inventory
This is the version your accountant uses. It works because: you started with some inventory, you bought more, and what's left at the end didn't get sold. The difference is, by definition, what got sold. Clean, simple, and the format required for tax returns.
Method 2: Cost component sum (for operators)
COGS = Materials + Direct Labor + Manufacturing Overhead + Inbound Shipping
If you're modeling unit economics for a new product line — or you don't do formal inventory tracking — summing the cost components is more practical. Materials and packaging are usually the easy bits; the trick is allocating overhead fairly across products.
What does NOT belong in COGS
- Marketing & advertising. Goes in operating expenses (SG&A).
- Founder / executive salaries. Operating expenses, unless they directly produce the product.
- Office rent. Operating expenses. Factory or warehouse rent does count.
- R&D. Separate line, almost never in COGS.
- Customer support. Operating expenses for most product companies; for service companies it might be in cost of services.
Quick example
You run a t-shirt brand. At the start of the quarter you had $15,000 of shirts in inventory. During the quarter you printed $40,000 of new shirts. At the end, $12,000 remained unsold.
COGS = $15,000 + $40,000 − $12,000 = $43,000
If you generated $100,000 in revenue, your gross profit is $57,000 and your gross margin is 57%. Decent for apparel — the industry runs 40–60%.
Frequently asked questions
What's the difference between the two methods?▼
The inventory method (Beginning Inventory + Purchases − Ending Inventory) is what accountants use for tax returns and financial statements. The cost components method (sum of materials, labor, overhead, shipping) is what operators use to understand unit economics. Both give the same total — pick the one that matches the data you actually have.
What should I include in COGS?▼
Only costs that scale with production: raw materials, packaging, direct production labor, freight in, manufacturing overhead (factory utilities, equipment depreciation), and per-unit fees like Stripe or PayPal. Exclude: rent for non-production spaces, marketing, salaries of non-production staff, R&D.
Is shipping a COGS or an operating expense?▼
Inbound shipping (getting materials or goods to your warehouse) is COGS. Outbound shipping (sending the product to the customer) depends on context — some treat it as COGS, some as a separate fulfillment cost in operating expenses. Be consistent in how you classify it.
Why does COGS matter?▼
It's the foundation of gross margin, which is the first sign of whether your business model can work. A 20% gross margin can survive small operations but won't scale. A 70% gross margin can fund growth even if you're losing money overall. Investors care about gross margin precisely because COGS is the floor you can't escape.
Do service businesses have COGS?▼
Sort of. Service businesses typically use 'Cost of Services' or 'Cost of Revenue' instead. It includes the direct labor and materials that delivered the service. For pure consulting or SaaS, this often includes hosting costs, third-party API fees, and customer support staff.