COGS Calculator
Cost of goods sold from inventory counts, plus gross margin and markup
Calculate cost of goods sold from inventory movements, plus gross profit, gross margin, and markup percentage in one view.
What this tool does
Cost of goods sold equals opening inventory plus purchases during the period minus closing inventory — the standard COGS formula. This calculator takes your opening inventory, purchases, and closing inventory figures and computes your COGS directly from those three values. If you also enter revenue, the tool calculates gross profit by subtracting COGS from that figure, then derives gross margin percentage and markup percentage. The results show what portion of your revenue remains after accounting for the direct costs of inventory, and how much profit is generated relative to those costs. This is useful for tracking production or retail operations across accounting periods, comparing profitability metrics over time, or understanding cost structure. The calculation assumes standard inventory accounting methods and doesn't account for write-offs, shrinkage adjustments, or non-inventory operating expenses. Results are for illustrative purposes based on the figures you provide.
Enter Values
People also use
E-commerce & Marketplace
Ecommerce Profit Calculator
Calculate ecommerce net profit after COGS, platform fees, ad spend, shipping, and returns with full margin breakdown. Free — no signup.
Marketing & Growth
ROAS (Return on Ad Spend) Calculator
Calculate ROAS, ROI, net profit, break-even ROAS, and net margin from your ad spend, revenue, and cost of goods sold data.
Startup & VC
Startup Burn Rate Calculator
Startup burn rate and runway calculator from cash balance, monthly burn, and monthly revenue, with gross burn and net burn separated.
Formula Used
Spotted something off?
Calculations or display — 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
The calculator applies the standard inventory accounting formula to compute cost of goods sold by adding opening inventory and purchases during the period, then subtracting closing inventory. Gross profit is derived by deducting COGS from revenue. When revenue is provided, the calculator computes gross margin as the ratio of gross profit to revenue, expressed as a percentage, and markup as the ratio of gross profit to COGS, also as a percentage. The model assumes inventory values are accurate and that all purchases represent goods available for sale during the period. It does not account for inventory write-downs, shrinkage, obsolescence, or valuation adjustments such as lower-of-cost-or-market rules. Results are illustrative estimates based on the inputs supplied.
References
Frequently Asked Questions
How often should I calculate COGS?
What if I do not have inventory (services, digital products)?
Include shipping I pay from supplier to warehouse?
What about write-offs for damaged or expired inventory?
Related Calculators
More Business & Startup Calculators
Business & Startup
Accounts Payable Turnover Calculator
Calculate accounts payable turnover and days payable outstanding from supplier purchases and average AP. Free educational tool.
Business & Startup
Accounts Receivable Turnover Calculator
Calculate accounts receivable turnover and days sales outstanding from credit sales and average AR — how fast your invoices actually convert.
Business & Startup
Adjusted EBITDA Calculator
Calculate adjusted EBITDA with add-backs for owner compensation, one-off costs, and non-recurring items — the version a buyer or lender will actually use.
Business & Startup
Airbnb Host Profit Calculator
Calculate Airbnb host profit by entering your nightly rate, occupancy, fees, cleaning costs, mortgage, and expenses to see monthly and annual net profit.
Business & Startup
Asset Turnover Calculator
Calculate asset turnover ratio from revenue and total assets — a measure of how efficiently a business generates sales from its asset base.
Business & Startup
Break-Even Calculator
Calculate break-even point. Enter fixed costs, selling price, and variable cost to see units needed to cover costs. Free and educational.
Explore Other Financial Tools
Psychology & Behavioral
Cost of Delaying Investment One Year
Calculate the future value lost by waiting one year to invest a lump sum. Enter investment amount to see what that single year of delay costs in final value.
Marketing & Growth
Price Skimming Calculator
Calculate a price skimming strategy by entering your premium rate, market price, early-adopter volume, and cost to estimate launch-phase profit.
Budget
Subscription Cost Inflation
Track subscription price inflation over time and project future costs based on annual price escalation rates and compound growth calculations.