Cost of Goods Sold (COGS) Calculator

Compute COGS for any accounting period — month, quarter, or year. Add your revenue to get gross profit and gross margin in the same view.

Quick answer

COGS = beginning inventory + purchases − ending inventory. Gross profit = revenue − COGS. Gross margin = gross profit ÷ revenue.

Your numbers

Edit any field — results update as you type.

$
$
$
$
Free: Seller Fee Cheat Sheet

Every fee on Etsy, Shopify, Amazon Handmade and at markets, on one page. We'll email it to you too.

Cost of Goods Sold
$36,000.00
62.1% gross margin · $59,000.00 gross profit on $95,000.00 revenue.
COGS
$36,000.00
Gross profit
$59,000.00
Gross margin
62.1%
Sanity check: if ending inventory looks suspiciously high or low, you probably have a count or valuation issue. Walk the shelves before you trust the number on the P&L.
Share or embed this calculator
Free for any site — includes a small credit link back to us.
The Real Profit Pricing Workbook cover
That's your price. Now know your real profit on every sale.
  • Your time, fees and shipping counted in
  • A price for every channel you sell on
  • Fillable PDF + bonus Excel calculator
Launch priceFirst edition in English
$19$27
See what's inside

Instant download · 30-day money-back guarantee

What's in COGS — and what isn't

In: direct materials, direct labor, freight-in, manufacturing overhead allocated to units sold, packaging that ships with the product.

Out: marketing, sales salaries, rent on your office or store, distribution, software subscriptions, professional fees. Those live below gross profit as operating expenses.

Frequently asked

Cost of Goods Sold = the direct cost of the products you sold during a period. Formula: beginning inventory + purchases − ending inventory. It excludes overhead like rent and salaries (those are operating expenses).

Direct materials, direct labor, and freight-in on the units sold. Not included: marketing, rent, admin salaries, distribution, or office software — those are operating expenses below gross profit.

Same idea. Service businesses usually call it 'cost of revenue' or 'cost of services' instead of COGS, but the math and accounting treatment are identical.

Most common reasons: shrinkage (theft, damage, miscount), freight-in being higher than budgeted, or supplier price increases that haven't been re-priced into your retail price yet.

Related calculators

Last reviewed: 2026-09-18