calculating cogs

COGS Calculator

Use this calculator to estimate Cost of Goods Sold (COGS) for a period. Enter your values below, then click calculate.

Formula:
COGS = Beginning Inventory + Purchases + Freight-In - Purchase Returns - Purchase Discounts - Ending Inventory

What Is COGS and Why It Matters

Cost of Goods Sold (COGS) is one of the most important numbers in business finance. It represents the direct cost tied to the products you sold during a period. If you run an online store, restaurant, retail shop, or distribution company, COGS sits at the center of pricing, margins, and profitability.

When COGS goes up and your prices stay flat, profit shrinks. When COGS is measured accurately, you can set prices with confidence, plan inventory better, and make smarter purchasing decisions.

The Core COGS Formula

In a periodic inventory system, the classic formula is:

COGS = Beginning Inventory + Net Purchases - Ending Inventory

Where net purchases are usually calculated as:

Purchases + Freight-In - Purchase Returns - Purchase Discounts

This is exactly what the calculator above computes.

Simple Interpretation

  • Beginning Inventory: What you had at the start of the period.
  • Purchases: What you bought to replenish stock.
  • Freight-In: Cost to bring inventory to your location.
  • Returns/Discounts: Reductions to purchase cost.
  • Ending Inventory: What remains unsold at period end.

Step-by-Step Example

Assume this monthly data:

  • Beginning Inventory: $12,000
  • Purchases: $50,000
  • Freight-In: $1,800
  • Purchase Returns: $700
  • Purchase Discounts: $500
  • Ending Inventory: $10,000

Goods Available for Sale = 12,000 + 50,000 + 1,800 - 700 - 500 = $62,600

COGS = 62,600 - 10,000 = $52,600

If net sales were $90,000, then gross profit is $37,400 and gross margin is about 41.56%.

COGS vs. Operating Expenses

Businesses often confuse COGS with operating expenses. Keep them separate:

  • COGS: Direct costs of products sold (materials, inbound freight, direct production costs).
  • Operating Expenses: Costs to run the business (marketing, rent, admin salaries, software tools).

This distinction matters for clean reporting and better decision-making.

Common Mistakes When Calculating COGS

1) Ignoring inventory counts

Without a reliable ending inventory count, your COGS can be wildly off. Even a small counting error can distort margin and tax reporting.

2) Forgetting freight-in

Inbound shipping is part of inventory cost in many models. Leaving it out understates COGS and overstates gross profit.

3) Misclassifying costs

Putting direct costs into overhead (or overhead into COGS) makes your numbers hard to trust. Build clear rules and use them consistently.

4) Not adjusting for returns and discounts

Purchase returns and vendor discounts reduce inventory cost. If you skip these, COGS is overstated and margins look weaker than they are.

How to Improve COGS Over Time

  • Negotiate better supplier pricing and payment terms.
  • Reduce shrinkage, spoilage, and damage.
  • Forecast demand better to avoid overstock and stockouts.
  • Consolidate purchase orders to reduce freight cost per unit.
  • Standardize bill-of-materials and production workflows.

Even a small reduction in COGS percentage can significantly improve annual profit.

Final Thoughts

Calculating COGS accurately is not just an accounting exercise—it is a strategic advantage. Use the calculator regularly (monthly or weekly), compare trends over time, and tie your results to pricing and purchasing decisions. If your business grows, a tighter COGS process can be one of the fastest ways to protect margins and improve cash flow.

🔗 Related Calculators