Try everything free for 14 daysno credit card needed
Scanning a barcode with a phone
Scan with your phone

Count, move, and find stock with the camera already in your pocket. Works offline, syncs later.

Try the live demo →
Organized stock on shelves
Switching from Sortly?

Bring folders, photos, and history over in an afternoon — with pricing that stays predictable at renewal.

See pricing →
Folder-style inventory list
Free spreadsheet templates

Excel, Google Sheets, and printable count sheets — ready to download, no signup needed.

Get the templates →
Free tool

Cost of goods sold calculator

Calculate COGS for any period using the standard accounting formula — beginning inventory plus purchases minus ending inventory. Add revenue to also see gross profit and gross margin instantly. Free, no signup.

Start freeRead the COGS guide

Try everything free for 14 days · no credit card

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.

How the COGS formula works

COGS = Beginning Inventory + Purchases − Ending Inventory. Take the dollar value of stock you had at the start of the period, add everything you bought during the period (including freight-in), then subtract what is left at the end. The difference is the cost of the inventory you actually sold.

Beginning inventory is the dollar value of all stock on hand on the first day of the period — pull it from your last balance sheet or accounting software. Purchases are all inventory bought during the period, including freight-in and direct production costs, net of returns and supplier discounts.

Ending inventory is the dollar value of stock left on the last day of the period, best obtained from a physical count or a perpetual inventory system. Enter revenue as well and the calculator extends the formula: Gross Profit = Revenue − COGS, and Gross Margin = Gross Profit ÷ Revenue — the numbers most tools leave you to work out by hand.

A worked example

A small retailer starts Q1 with $10,000 of inventory, buys $25,000 during the quarter, and ends with $8,000 on hand. COGS = $10,000 + $25,000 − $8,000 = $27,000 — those are the same numbers the calculator loads by default.

With $50,000 in revenue for the quarter, gross profit is $50,000 − $27,000 = $23,000, a gross margin of 46.0%. That $23,000 is what is left to cover operating expenses, taxes, and profit — which is why gross margin, not revenue, is the number to watch as you price and negotiate with suppliers.

What counts as COGS (and what doesn’t)

COGS is strictly the direct cost of the inventory you sold: raw materials and components, direct labor on the product (assembly, packing), freight-in and import duties, manufacturing supplies consumed in production, inventory storage attributable to stock, and inventory shrinkage or write-offs.

It does NOT include marketing and advertising, sales salaries and commissions, office rent and utilities, R&D, shipping to the customer, or general admin and software — those are operating expenses that live below the gross-profit line. On an income statement, COGS is subtracted from revenue to get gross profit; operating expenses are subtracted after that to get operating profit. For the valuation methods behind ending inventory, see the cost of goods sold guide and the FIFO vs LIFO comparison.

Frequently asked questions

What is included in cost of goods sold?
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.
How do I calculate COGS for my small business?
Use the formula: COGS = Beginning Inventory + Purchases − Ending Inventory. Take the dollar value of stock you had at the start of the period, add what you bought during the period (including freight-in), then subtract what is left at the end. The difference is your cost of goods sold.
What's the difference between COGS and operating expenses?
COGS is the cost of inventory you actually sold — it varies with sales volume. Operating expenses (marketing, rent, salaries, software) are the overhead costs of running the business and are largely fixed. On an income statement, COGS is subtracted from revenue to get gross profit, then operating expenses are subtracted to get operating profit.
Do service businesses have COGS?
Service businesses often use the term "Cost of Services" or "Cost of Revenue" instead of COGS, since they have no physical inventory. The concept is the same: direct costs of delivering the service (contractor labor, billable hours, materials consumed). Pure consulting firms with no materials may have minimal cost of revenue.
Can COGS be higher than revenue?
Yes — and when it is, you have a gross loss. This means you are selling inventory for less than it costs you, before even covering overhead. Common causes are aggressive discounting, supplier price increases not passed through, or significant inventory shrinkage. A persistent gross loss is unsustainable; revisit pricing, supplier costs, or product mix.

Related tools

All tools →

Automate reorder alerts with StockZip

Set a reorder point per SKU and StockZip alerts you the moment stock drops below it — no spreadsheets, no manual checks. Free for 14 days, no credit card.

Start freeSee low-stock alerts
Free for 14 days
No credit card
Start free