Early Access: Get 3 Months Free — Limited SpotsJoin now
← ToolsFree Tool

Cost of Goods Sold Calculator

Calculate your COGS for any period using the standard accounting formula. Add revenue to also see your gross profit and gross margin instantly — no spreadsheet required.

Calculate your cost of goods sold

Enter your inventory values for the period. Add revenue to also see gross profit and margin.

Stock on hand at the start of the period

Inventory bought during the period (incl. freight-in)

Stock on hand at the end of the period

Optional

Total sales for the period — adds gross profit & margin

Inventory available

$35,000

Beginning + Purchases

Ending inventory

$8,000

Deducted

COGS

$27,000

Cost of goods sold

Revenue

$50,000

For the period

Gross profit

$23,000

Revenue − COGS

Gross margin

46.0%

Profit / Revenue

Interpretation: Your cost of goods sold is $27,000. On revenue of $50,000, that's a gross profit of $23,000 (46.0% margin) — what's left to cover operating expenses, taxes, and profit.

The formula

COGS = Beginning Inventory + PurchasesEnding Inventory

Beginning inventory

Dollar value of all stock on hand at the first day of the period. Pull this from your last balance sheet or your accounting software.

Purchases

All inventory bought during the period, including freight-in and any direct production costs. Use the net amount after returns and supplier discounts.

Ending inventory

Dollar value of stock left on the last day of the period. Best obtained from a physical count or a perpetual inventory system.

Example calculation

A small retailer's Q1 results — using the same numbers shown in the calculator above.

Beginning inventory (Jan 1)$10,000
+ Purchases during Q1$25,000
− Ending inventory (Mar 31)$8,000
COGS$10,000 + $25,000 − $8,000 = $27,000

With $50,000 in revenue, this retailer's gross profit is $50,000 − $27,000 = $23,000, for a gross margin of 46.0%.

Revenue$50,000
− COGS$27,000
Gross profit (46.0% margin)$23,000

What counts as COGS?

COGS is strictly the direct cost of inventory you sold. Anything else — even if it feels related — is an operating expense and lives below the gross profit line.

Included in COGS

  • • Direct materials & raw components
  • • Direct labor on the product (assembly, packing)
  • • Freight-in & import duties on inventory
  • • Manufacturing supplies consumed in production
  • • Inventory storage (warehouse rent attributable to stock)
  • • Inventory shrinkage & write-offs

NOT in COGS

  • • Marketing & advertising
  • • Sales team salaries & commissions
  • • Office rent & utilities
  • • R&D and product development
  • • Shipping to the customer (operating expense)
  • • General admin, accounting, software subscriptions

Want to learn more?

Read our complete guide on cost of goods sold, including how it shows up on financial statements, common inventory valuation methods (FIFO, LIFO, weighted-average), and tax implications.

Track inventory value automatically with StockZip

Stop pulling beginning and ending inventory off spreadsheets. StockZip values your stock in real time and gives you the numbers for COGS in one click.

  • Auto beginning and ending balances from movements
  • Multi-location inventory valuation
  • Average cost & FIFO methods supported
  • Export period reports for accounting & tax filing

Need help? We've got answers

Common questions about scanning, offline mode, pricing, and migration.

COGS includes the direct costs of producing or acquiring the inventory you sold during the period: raw materials, direct labor on the product, freight-in, manufacturing supplies, and inventory storage. It does NOT include marketing, sales salaries, office rent, R&D, shipping to the customer, or general admin — those are operating expenses.