SellerCalcs

COGS Calculator

Cost of goods sold from opening stock, purchases and closing stock — plus turns and days of inventory.

Quick answer: COGS = beginning inventory + purchases − ending inventory. Opening $18,000, purchases $42,000 and closing $15,000 means you sold $45,000 of stock, turning inventory 2.7× over the period.

$

Value of stock on hand at the start of the period.

$

Inventory bought in, including freight to your warehouse.

$

Value of stock still unsold at the end.

$

Add revenue to get gross profit and gross margin.

COGS
$45,000.00
Average inventory
$16,500.00
Inventory turns
2.73×
How many times stock cycles per period
Days of inventory
133.8 days
Beginning inventory$18,000.00
+ Purchases$42,000.00
− Ending inventory$15,000.00
Cost of goods sold$45,000.00
Revenue$96,000.00
Gross profit$51,000.00
Gross margin53.13%

Inventory turns and days of inventory use average inventory ((beginning + ending) ÷ 2) — the standard shortcut when you do not track monthly balances.

COGS = beginning inventory + purchases − ending inventory. It is the cost of the stock you actually sold, which is why the period matters: the same purchases produce a different COGS if the ending count changes.

Core facts
PriceFree, no sign-up
InputBeginning inventory, purchases, ending inventory, revenue
OutputCOGS, gross profit, inventory turns, days of inventory
RunsEntirely in your browser

What is COGS Calculator?

Cost of goods sold is the value of the inventory you actually sold in a period. It is not your purchase total: what you bought is either sold or still on the shelf, so COGS = beginning inventory + purchases − ending inventory. That single formula makes gross profit possible — revenue minus COGS — and it is the first line of any credible ecommerce P&L. This calculator also derives inventory turns and days of inventory from the average stock level, which is how you spot cash trapped in slow-moving products. Sellers who track only revenue usually discover the problem when they run out of cash to reorder.

Common Uses for COGS Calculator

  • Prepare monthly or quarterly gross profit figures
  • Find how much cash is sitting in slow-moving inventory
  • Compare inventory efficiency before and after a range change
  • Support a loan or investor conversation with real cost figures
  • Check whether a discount campaign actually improved turnover

Why COGS beats purchase totals

A month with $42,000 of purchases can have $45,000 of COGS or $25,000, depending on where inventory landed. Reporting purchases as cost makes a stocking-up month look unprofitable and a run-down month look artificially strong — the reason inventory-heavy businesses look volatile until they adopt the formula.

Days of inventory: the cash clock

Days of inventory = 365 ÷ turns. At 2.7 turns that is 135 days: your average unit waits more than four months to sell, and your cash waits with it. Cutting the top three slowest SKUs often frees more cash than any marketing campaign will generate.

Where COGS meets margin

Gross margin = (revenue − COGS) ÷ revenue. Enter revenue above and the calculator computes it, giving you the margin your price list has to defend. If that margin is under 40% for a physical product, check freight-in and duty are included before you reprice.

Frequently Asked Questions

What exactly is included in COGS?
The cost of the goods you sold: supplier price plus inbound freight, duty and handling attributable to those units. Outbound shipping, marketplace fees and marketing sit below the gross profit line and are not part of COGS.
How do I value ending inventory?
At the same cost basis as purchases — usually weighted average cost or FIFO. Mixing bases (valuing stock at retail while purchases are at cost) is the most common reason a homemade COGS figure disagrees with the accountant's.
What is a good inventory turnover?
4–6 turns per year is healthy for most ecommerce categories, meaning roughly 60–90 days of stock. Under 3 turns ties up cash; over 12 usually means you are risking stockouts and losing sales to unavailability.
Should I use average inventory or ending inventory for turns?
Average inventory, (beginning + ending) ÷ 2, smooths seasonality and is what this calculator uses. Using the ending figure alone overstates turns whenever you finish a period with unusually low stock.
Does COGS include shipping paid on purchases?
Yes — freight-in is part of the cost of getting inventory ready to sell, so it belongs in COGS. Freight-out (delivering to customers) does not.

More Pricing & Profit Calculators

More Selling Tools