Free calculator · cost of goods sold

COGS calculator for online stores.

Enter the inventory you started with, what you bought and what is still on hand. Get cost of goods sold for the month or the year, and your COGS percentage and gross margin when you add net sales.

Works in your browser · pre-filled with a demo store's September

Your numbers

Value of stock on hand at the start of the period.
Stock bought to sell during the period. The demo figure already includes inbound freight and duty.
Only if not already in purchases: freight in and import duty on stock bought.
Other costs of getting stock ready to sell, such as customs broker fees.
Every unit you own at the end, including stock at a fulfillment center or 3PL.
Sales after refunds and discounts, to see COGS % and gross margin.

Cost of goods sold

YOUR PERIOD · USD

Beginning inventory52,300.00
Purchases, freight, duty & other costs24,890.40
Goods available for sale77,190.40
Ending inventory(54,000.00)
Cost of goods sold23,190.40
Net sales64,490.00
COGS as % of net sales36.0%
Net sales less COGS41,299.60
Gross margin before fees64.0%

DEMO OUTDOOR CO. FIGURES UNTIL YOU CHANGE THEM · NOT A CLIENT

Cost of goods sold: 23,190.40, 36.0% of net sales.

How it's worked out

How the calculator works it out.

Cost of goods sold = beginning inventory + purchases + inbound freight & duty + other product costs − ending inventory

Start with what was on the shelf when the period opened. Add everything you bought to sell, with the cost of getting it to you. That total is what you could have sold. Take away what is still on hand at the end, and what is left is the cost of what actually went out the door.

With the demo store's September: 52,300.00 + 24,890.40 = 77,190.40 available, less 54,000.00 still on hand, gives 23,190.40 cost of goods sold.

COGS % = cost of goods sold ÷ net sales
Gross margin = (net sales − cost of goods sold) ÷ net sales

23,190.40 ÷ 64,490.00 = 36.0% of net sales, which leaves a gross margin of 64.0% before selling costs such as marketplace fees, advertising and shipping to customers. Those come off next on the profit and loss.

Ending inventory is the number most often wrong for online sellers: it means every unit you own, including stock held at a fulfillment center or a 3PL. Count it, or take it from your inventory records, at the same point in time as the period end.

Go further

COGS in your books, every month.

Our monthly e-commerce bookkeeping keeps inventory and cost of goods sold current, so your gross margin is a real number every month, not only at year end.

Answer

COGS formula: how to calculate cost of goods sold online

The formula worked through, why it goes wrong for sellers, and what it costs to get wrong.

Read the answer →

See where your books stand — free.

Get a written review of every channel: what's reconciled, what's missing, and the exact price to fix it. No card, no commitment.

Get my free books review