cost of goods sold calculation

COGS Calculator (Periodic Inventory Method)

Enter your values below to calculate Cost of Goods Sold (COGS), plus optional gross profit and margin.

What Is Cost of Goods Sold (COGS)?

Cost of Goods Sold (COGS) is the direct cost of producing or purchasing the products your business sells during a period. It usually includes inventory costs, direct materials, and direct labor (for manufacturers). For retailers and eCommerce stores, COGS is typically driven by inventory purchases, freight-in, and inventory adjustments.

Understanding your COGS is essential because it directly affects gross profit, pricing decisions, taxes, and overall business performance. If COGS is too high relative to sales, margins shrink quickly.

COGS Formula

COGS = Beginning Inventory + Net Purchases - Ending Inventory

Where:

  • Net Purchases = Purchases + Freight-In - Purchase Returns - Purchase Discounts
  • Beginning Inventory = inventory value at the start of the period
  • Ending Inventory = inventory value at the end of the period

Step-by-Step Cost of Goods Sold Calculation Example

Suppose your store has the following monthly data:

Item Amount
Beginning Inventory $15,000
Purchases $42,000
Freight-In $1,200
Purchase Returns $800
Purchase Discounts $400
Ending Inventory $10,000
  1. Net Purchases = 42,000 + 1,200 - 800 - 400 = $42,000
  2. COGS = 15,000 + 42,000 - 10,000 = $47,000

If total sales were $70,000, then Gross Profit would be $70,000 - $47,000 = $23,000, and gross margin would be about 32.86%.

Why COGS Matters

  • Profitability: COGS is subtracted from revenue to determine gross profit.
  • Pricing: You need accurate COGS to set prices that maintain healthy margins.
  • Taxes: COGS reduces taxable income for many businesses.
  • Inventory control: Tracking COGS helps detect shrinkage, waste, and purchasing issues.
  • Forecasting: Better COGS data means better budgeting and cash-flow planning.

Periodic vs. Perpetual Inventory Systems

Periodic System

In a periodic system, COGS is calculated at period end using beginning inventory, purchases, and ending inventory. The calculator above follows this approach.

Perpetual System

In a perpetual system, COGS is recorded continuously with each sale. Inventory software usually updates balances in real time. Even in perpetual systems, period-end adjustments may still occur.

COGS for Manufacturers (Quick Note)

Manufacturing businesses often calculate COGS differently by first determining the cost of goods manufactured (COGM). Inputs may include:

  • Raw materials used
  • Direct labor
  • Manufacturing overhead
  • Work-in-process inventory changes

Then manufacturer COGS is generally:
Finished Goods Beginning Inventory + COGM - Finished Goods Ending Inventory

Common COGS Mistakes to Avoid

  • Forgetting freight-in and landed costs.
  • Including operating expenses (rent, marketing, admin salaries) in COGS by mistake.
  • Ignoring returns, allowances, and purchase discounts.
  • Using incorrect ending inventory due to count errors.
  • Mixing accounting methods without consistency.

Practical Tips

1) Reconcile Inventory Regularly

Cycle counts and month-end reconciliations keep your COGS numbers trustworthy.

2) Standardize Cost Categories

Define what belongs in COGS versus operating expenses to avoid reporting confusion.

3) Review Gross Margin by Product Line

Analyzing margin by SKU or category helps you fix unprofitable products quickly.

Final Takeaway

A solid cost of goods sold calculation is the foundation of accurate financial reporting and smart business decisions. Use the calculator above monthly (or weekly, if needed) to keep your margins visible and your pricing strategy grounded in real costs.

🔗 Related Calculators