COGS Calculator
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
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.
Opening $25,000 + purchases $85,000 - closing $22,000 gives COGS of $88,000.00.
Inputs
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.
References
Frequently Asked Questions
How often should I calculate COGS?
What if I do not have inventory (services, digital products)?
Should I include shipping I pay from supplier to warehouse?
What about write-offs for damaged or expired inventory?
Related Calculators
More Financial Health Calculators
Financial Health
Accounting Software Cost Calculator
Calculate total accounting software cost over years including setup. Enter subscription and setup hours for an instant result.
Financial Health
Accounts Payable Turnover Calculator
Calculate accounts payable turnover and days payable outstanding from supplier purchases and average AP. Free educational tool.
Financial Health
Accounts Receivable Turnover Calculator
Calculate accounts receivable turnover and days sales outstanding from credit sales and average AR. Enter net credit sales and see the result instantly.
Financial Health
Adjusted EBITDA Calculator
Calculate adjusted EBITDA with add-backs for owner compensation, one-offs, and non-recurring items. Enter reported ebitda and see the result instantly.
Financial Health
Affiliate Commission Calculator
Calculate affiliate commission earnings from clicks, conversion rate, order value, and commission percentage. Free educational tool.
Financial Health
Affiliate Marketing Income Calculator
Calculate affiliate marketing income from clicks, conversion rate, and commission per sale or per-order commission rate.
Explore Other Financial Tools
Mortgage
Mortgage Forbearance Cost Calculator
Calculate the long-term cost of a mortgage forbearance agreement during hardship. Enter mortgage balance and rate to see added interest and lifetime cost.
Planning
College Fund Start Age Calculator
Compare college fund savings contributed from birth vs later start to see the compound advantage of early start. Free and runs in your browser.
Lifestyle
Cat Cost Calculator
Calculate true annual cost of cat ownership including food, vet, insurance, and supplies. Enter food cost and litter cost for an instant result.