Skip to content
TheCalcUniverse

Cost of Goods Sold (COGS) Calculator — Free Online Calculator & Guide

Calculate your Cost of Goods Sold using the inventory accounting formula. Includes gross profit margin and COGS as a percentage of revenue.

✓ Tested formula & cited sources Formula verified 2026-01-15 Runs in your browser — inputs never sent anywhere

See it worked out

Example — Beginning Inventory Value 50000, Purchases / Production Costs 120000, Ending Inventory Value 45000, Revenue for Period 250000:

Cost of Goods Sold (COGS)

$125,000.00

COGS only counts direct product costs — inventory, materials, direct labor — not overhead like rent or marketing. It's the number that feeds gross margin and is deductible on your tax return; keeping accurate inventory records matters here since errors compound into every downstream profit calculation.

Goods Available for Sale

$170,000.00

Gross Profit

$125,000.00

Gross Margin %

50.00%

COGS as % of Revenue

50.00%

The formula

COGS = Beginning Inventory + Purchases − Ending Inventory

Beginning Inventory
Beginning Inventory
Purchases
Net Purchases / Production
Ending Inventory
Ending Inventory

Worked example — Beginning Inventory Value 50000, Purchases / Production Costs 120000, Ending Inventory Value 45000, Revenue for Period 250000

Cost of Goods Sold (COGS) = $125,000.00

Full explanation ↓

How COGS Calculator Works

COGS = Beginning Inventory + Purchases − Ending Inventory

Cost of Goods Sold is calculated using the basic inventory accounting formula, representing the direct cost of the products sold during a period. It is one of the most important numbers on any income statement.

Beginning Inventory
Beginning InventoryThe cost value of all inventory on hand at the start of the accounting period. This matches the ending inventory of the prior period.
Purchases
Net Purchases / ProductionAll costs of new inventory purchased or manufactured during the period, adjusted for returns and discounts.
Ending Inventory
Ending InventoryThe cost value of remaining unsold inventory at the end of the period. Must be physically counted or estimated using a costing method.
COGS formula — beginning inventory plus purchases minus ending inventory

How to Use

  1. Enter the value of your beginning inventory (from the start of the period).
  2. Enter the total cost of inventory purchased or produced during the period.
  3. Enter the value of unsold inventory remaining at the end of the period.
  4. Optionally enter total revenue to see gross profit and margin calculations.
  5. Review COGS as a percentage of revenue — if it is too high, explore supplier alternatives or price increases.

Common Uses

  • Calculating true product cost for inventory accounting and tax reporting at the end of each accounting period
  • Determining gross profit and gross margin by subtracting COGS from revenue to evaluate business profitability
  • Tracking inventory efficiency by monitoring COGS as a percentage of revenue month over month to spot cost trends
  • Comparing COGS across different product lines to identify which products are most profitable to sell

Understanding the Result

COGS is a critical income statement line item. It represents the direct cost of the products a business sells. Lower COGS with the same revenue means higher gross profit and margin. COGS only includes costs directly tied to production: raw materials, direct labor, and manufacturing overhead. It does NOT include selling expenses, marketing, or administrative overhead — those are operating expenses. Tracking COGS accurately is essential for understanding true product profitability and pricing strategy. Real-world example: a clothing brand reports beginning inventory of $50,000, makes $120,000 in purchases, and has $45,000 in ending inventory. Their COGS is $125,000. If revenue is $250,000, gross profit is $125,000 (50% margin). If the owner overestimates ending inventory at $55,000, COGS drops to $115,000 and margin inflates to 54% — creating a false picture of profitability that will reverse when the inventory error is discovered. This is why physical inventory counts and accurate costing methods matter so much. For a manufacturer, COGS also includes factory labor and overhead. A furniture maker spending $200 on wood, $50 on hardware, $80 in direct labor, and $30 in factory overhead per table has a COGS of $360 per table.

Frequently Asked Questions

What is included in COGS?
COGS includes all costs directly related to production: raw materials, direct labor, manufacturing overhead, inbound freight, and import duties. It excludes operating expenses like rent, non-production salaries, marketing, and administrative costs.
What is the difference between COGS and operating expenses?
COGS is the direct cost of goods sold. Operating expenses (rent, salaries, marketing) are costs of running the business. COGS is deducted from revenue first to calculate gross profit, then operating expenses are deducted to get operating income.
What inventory costing methods can I use?
Common methods include FIFO (First In, First Out), LIFO (Last In, First Out — not allowed under IFRS), and Weighted Average Cost. Each method can produce different COGS values, especially during periods of inflation. FIFO generally produces lower COGS in inflationary environments, which increases reported profit.
How does COGS affect my taxes?
COGS directly reduces taxable income. The IRS requires businesses that carry inventory to use an accrual method of accounting and accurately track COGS. Overstating ending inventory (and thus understating COGS) inflates taxable profit; understating ending inventory increases COGS and reduces taxable profit.
How does the costing method (FIFO vs. LIFO) affect COGS?
In periods of rising prices, FIFO assumes older (cheaper) inventory is sold first, resulting in lower COGS and higher reported profit. LIFO assumes newer (more expensive) inventory is sold first, resulting in higher COGS and lower taxable income. Weighted average smooths price fluctuations. FIFO is the most common method and is required under IFRS accounting standards.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "Cost of Goods Sold (COGS) Calculator — Free Online Calculator & Guide." TheCalcUniverse, 2026, https://thecalcuniverse.com/ecommerce/cogs-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like