FinToolSuite

COGS Calculator

Updated April 17, 2026 · Financial Health · Educational use only ·

Cost of goods sold from inventory counts, plus gross margin and markup

Calculate COGS from inventory plus gross profit, gross margin, and markup percentage. Enter opening inventory and purchases during period for an instant result.

What this tool does

Enter opening inventory, purchases during the period, closing inventory, and revenue. The calculator returns COGS using the standard formula, gross profit, gross margin percentage, and markup percentage.


Enter Values

Formula Used
Cost of goods sold
Opening inventory
Purchases
Closing inventory

Spotted something off?

Calculations, display, or translation — let us know.

Disclaimer

Results are estimates for educational purposes only. They do not constitute financial advice. Consult a qualified professional before making financial decisions.

The COGS Formula That Accounting Courses Teach

Cost of Goods Sold equals opening inventory plus purchases during the period minus closing inventory. This is the fundamental inventory-based COGS formula used in financial statements worldwide. If a bookshop starts the year with 50,000 of inventory, buys 200,000 more during the year, and ends with 60,000 of inventory, then 190,000 of inventory was sold — that is COGS. The formula works at monthly, quarterly, or annual granularity as long as the inventory counts are accurate at period boundaries.

Why COGS Matters More Than Revenue

Revenue is vanity. Gross profit (revenue minus COGS) is the first real indicator of whether a product line is viable. A clothing store doing 1M revenue at 800k COGS has 200k gross profit — 20% gross margin. Strip out operating expenses (rent, salaries, marketing) and what is left covers tax and profit. Compare to a clothing store doing 1M revenue at 400k COGS — 600k gross profit, 60% gross margin. Same top-line, completely different underlying business. COGS is the single biggest driver of how much room you typically need to run the rest of the business.

Gross Margin Versus Markup

Gross margin is gross profit divided by revenue — the seller's perspective. A product costing 40 sold for 100 has 60% gross margin. Markup is gross profit divided by COGS — the buyer's perspective. Same product has 150% markup (60 profit on 40 cost). Retailers quote markup (2x, 3x, 4x markup on cost). Finance quotes gross margin (60% margin). The two say the same thing from different angles. The calculator returns both so you can talk to whichever audience needs which number.

Periodic Versus Perpetual Inventory

Periodic inventory uses physical counts at period boundaries — slower, less accurate, cheaper. Perpetual inventory updates COGS every transaction via point-of-sale integration — faster, more accurate, more expensive. Both produce the same COGS formula. Small businesses often use periodic with annual counts. Larger retailers use perpetual with continuous tracking. The calculator is format-agnostic — whichever method you use, the formula applies.

What Actually Counts as COGS

Direct materials — the physical product you sell. Direct labor for making or preparing it. Freight-in (shipping from supplier to your warehouse). Import duties and customs. Packaging materials directly tied to the product. What is NOT COGS: marketing and advertising, administrative salaries, rent on non-warehouse space, software, insurance, professional services. These are operating expenses, below the gross profit line. The distinction matters for accurate gross margin calculations and for tax deductibility in some jurisdictions.

Worked Example

Online coffee roaster. Opening inventory: 25,000 in green coffee beans, packaging, and roasted stock. Purchases during the quarter: 85,000 (green beans, packaging, freight-in). Closing inventory: 22,000. Revenue for the quarter: 180,000. COGS: 25,000 + 85,000 - 22,000 = 88,000. Gross profit: 180,000 - 88,000 = 92,000. Gross margin: 51.1%. Markup on cost: 104.5%. Read: the roaster doubles its cost when selling, netting 51% gross margin before operating expenses eat into it. If operating costs (rent, salaries, marketing, software) run 70,000 for the quarter, net profit is 22,000 — which is why watching COGS as a ratio against revenue matters more than the absolute dollar amount.

Example Scenario

Opening $25,000 + purchases $85,000 - closing $22,000 gives COGS of $88,000.00.

Inputs

Opening Inventory:$25,000
Purchases During Period:$85,000
Closing Inventory:$22,000
Revenue (optional, for margin):$180,000
Expected Result$88,000.00

This example uses typical values for illustration. Adjust the inputs above to match a specific situation and see how the result changes.

Sources & Methodology

Methodology

Standard inventory-based COGS formula: opening plus purchases minus closing. Gross profit is revenue minus COGS. Gross margin is gross profit divided by revenue. Markup is gross profit divided by COGS. Results are estimates for illustration purposes only.

Frequently Asked Questions

How often should I calculate COGS?
Monthly if you have reliable inventory counts. Quarterly minimum for financial visibility. Annually at year-end for tax purposes. More frequent is better because unexpected COGS drift (theft, damage, supplier price changes) is harder to spot with less-frequent measurements.
What if I do not have inventory (services, digital products)?
COGS still applies but comes from different sources. For services: billable labor cost plus direct project materials. For digital products: hosting costs, platform fees, payment processing on sold units. The formula is less useful for service-based businesses — use a direct cost per unit calculation instead.
Should I include shipping I pay from supplier to warehouse?
Yes — freight-in is part of COGS. Include it in purchases. Shipping from warehouse to customer (freight-out) is not COGS — it is a separate operating expense.
What about write-offs for damaged or expired inventory?
Damaged inventory reduces closing inventory, which increases COGS (inventory disappeared without generating revenue). Some accountants prefer to track write-offs as a separate line for clarity. Either approach yields the same tax and profit outcome.

Related Calculators

More Financial Health Calculators

Explore Other Financial Tools