Cost of Goods Sold (COGS) Calculator

Calculate COGS using beginning inventory, purchases, and ending inventory. Compare FIFO, LIFO, and weighted-average methods with gross profit analysis.

Inventory & Costs

$
$
$
For manufacturers
$
For manufacturers
$
$

Revenue

$
Cost of Goods Sold
$213,000.00
53.25% of revenue
Gross Profit
$187,000.00
46.75% gross margin
Goods Available for Sale
$258,000.00
Inventory Turnover
4.5ร—
81 days in inventory

COGS Calculation Flow

Beginning Inventory
$50,000.00
+ Purchases
$200,000.00
+ Freight-In
$8,000.00
= Goods Available
$258,000.00
โˆ’ Ending Inventory
-$45,000.00
= COGS
$213,000.00

Revenue Split: COGS vs. Gross Profit

COGS 53.3%
GP 46.8%

Income Statement (Partial)

Revenue$400,000.00
Beginning Inventory$50,000.00
+ Purchases & Costs$208,000.00
โˆ’ Ending Inventory-$45,000.00
Cost of Goods Sold-$213,000.00
Gross Profit$187,000.00

Revenue Scenario (Proportional COGS)

Revenue LevelRevenueCOGSGross ProfitGross Margin
70%$280,000.00$149,100.00$130,900.0046.75%
80%$320,000.00$170,400.00$149,600.0046.75%
90%$360,000.00$191,700.00$168,300.0046.75%
100% (current)$400,000.00$213,000.00$187,000.0046.75%
110%$440,000.00$234,300.00$205,700.0046.75%
120%$480,000.00$255,600.00$224,400.0046.75%
130%$520,000.00$276,900.00$243,100.0046.75%
150%$600,000.00$319,500.00$280,500.0046.75%
Planning notes, formulas, and examples

About the Cost of Goods Sold (COGS) Calculator

Cost of Goods Sold (COGS) represents the direct costs of producing or purchasing the goods your business sells during a period. It's one of the most important line items on the income statement because it directly determines gross profit and gross margin. Accurate COGS calculation is essential for pricing, tax reporting, and financial analysis.

The basic COGS formula is straightforward: Beginning Inventory + Purchases โˆ’ Ending Inventory = COGS. However, the choice of inventory valuation method (FIFO, LIFO, or Weighted Average) can produce significantly different COGS figures, especially during periods of rising or falling prices.

This calculator computes COGS using the standard formula, shows gross profit and gross margin, and lets you add manufacturing overhead and direct labor for businesses that produce goods. It also includes a period-over-period comparison to track COGS trends.

Use the result to compare scenarios, test assumptions, and revisit the model when pricing, volume, or financing inputs change.

When This Page Helps

COGS is required for every income statement, tax return, and profitability analysis. It determines your gross profit, which in turn constrains your operating profit. Tracking COGS as a percentage of revenue reveals efficiency trends: rising COGS% means margin erosion; falling COGS% means improving efficiency or pricing power. Instant recalculation lets you test different assumptions side by side, giving you the confidence to act on data rather than gut instinct.

How to Use the Inputs

  1. Enter the value of beginning inventory (from last period's ending inventory).
  2. Enter total purchases made during the period.
  3. Optionally add freight-in, direct labor, and manufacturing overhead.
  4. Enter the value of ending inventory (from physical count or perpetual system).
  5. Enter revenue to calculate gross profit and gross margin.
  6. Review COGS, gross profit, gross margin, and COGS as a percentage of revenue.
Formula used
COGS = Beginning Inventory + Purchases + Freight-In + Direct Labor + Manufacturing Overhead โˆ’ Ending Inventory Gross Profit = Revenue โˆ’ COGS Gross Margin (%) = (Gross Profit / Revenue) ร— 100 COGS Ratio (%) = (COGS / Revenue) ร— 100

Example Calculation

Result: $213,000 COGS, $187,000 gross profit, 46.8% gross margin

COGS = $50,000 + $200,000 + $8,000 โˆ’ $45,000 = $213,000. Gross profit = $400,000 โˆ’ $213,000 = $187,000. Gross margin = $187,000 / $400,000 = 46.8%. COGS ratio = $213,000 / $400,000 = 53.3%. For every dollar of revenue, 53 cents goes to cost of goods and 47 cents is gross profit.

Tips & Best Practices

  • Beginning inventory must equal last period's ending inventory โ€” any discrepancy signals errors or shrinkage.
  • Include ALL costs to bring inventory to a salable state: freight, customs duties, handling.
  • For manufacturers, COGS includes raw materials, direct labor, AND allocated manufacturing overhead.
  • A rising COGS percentage over time signals cost increases, pricing problems, or inventory management issues.
  • Separate marketing, selling, and administrative expenses from COGS โ€” only direct production/purchase costs belong in COGS.
  • Use FIFO (first-in, first-out) for tax advantages during inflation; LIFO (last-in, first-out) for lower taxable income in some jurisdictions.

COGS for Manufacturers vs. Retailers

Retailers calculate COGS simply: beginning inventory + purchases โˆ’ ending inventory. Manufacturers have a more complex calculation: they must account for raw materials, work-in-process (WIP), finished goods, direct labor, and factory overhead. The manufacturing COGS formula uses three inventory accounts and adds labor and overhead to the cost flow.

Inventory Valuation Methods

The three main methods โ€” FIFO, LIFO, and Weighted Average โ€” produce different COGS figures when unit costs change. In inflationary environments, FIFO produces lower COGS (and higher taxes), while LIFO produces higher COGS (and lower taxes). Most countries outside the US prohibit LIFO. IFRS requires FIFO or Weighted Average; US GAAP allows all three.

COGS and Gross Margin Analysis

Tracking COGS as a percentage of revenue over time reveals important trends. Improving gross margin means COGS is growing slower than revenue โ€” a sign of pricing power, efficiency gains, or favorable cost trends. Deteriorating gross margin signals the opposite. Compare your COGS ratio to industry benchmarks to gauge competitiveness.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • COGS includes only the direct costs of goods sold: materials, direct labor, manufacturing overhead. Operating expenses (SGA) include sales, marketing, administration, rent, and utilities not directly tied to production. COGS appears above gross profit on the income statement; operating expenses appear below it.