SellerMath
2026 · bookkeeping for sellers

COGS Calculator — Cost of Goods Sold

Calculate cost of goods sold for a period using the standard inventory formula, or build the true landed unit cost of a product (the hidden costs most sellers forget). Then see gross profit and margin instantly.

COGS for a period

$
$
$
$
Beginning + purchases
− Ending inventory
Cost of goods sold
Gross profit
Gross margin

True landed unit cost

$
$
$
$
$
$
Landed cost / unit
Selling price
Gross profit / unit
Margin
Markup on cost

If you only counted the $6.00 wholesale price, you would be understating your real cost by per unit.

The COGS formula

COGS = Beginning Inventory + Purchases − Ending Inventory

This matches the method used by accountants and tax preparers. For an e-commerce product, the real per-unit cost should also include inbound freight, packaging, duties, labeling, inspection and a defect allowance — not just the wholesale price. Knowing accurate COGS is what lets you set a price that is actually profitable rather than merely moving money.

Frequently asked questions

What is included in cost of goods sold?

COGS includes the direct costs of the goods you sold: purchase or manufacturing cost plus inbound shipping, packaging, labeling, customs duties and inspection that are needed to get the product ready to sell. It excludes indirect costs like ads, software subscriptions and accounting.

How do I calculate COGS for an online store?

Take the inventory value at the start of the period, add everything you purchased, then subtract the value of unsold inventory at the end. Example: $10,000 + $25,000 − $8,000 = $27,000 COGS.

Why does my landed unit cost differ from the wholesale price?

Because freight, packaging, duties, QC and expected defects all add real cost per unit. In the example above, a $6.00 product actually costs about $9.10 to land — pricing it off $6.00 would quietly destroy your margin.

Is COGS the same as expenses?

No. COGS counts only costs directly tied to the products sold. Operating expenses such as marketing, rent and software are recorded separately. Gross profit = revenue − COGS.

Related free tools

Optimize pricing across all platforms

Our AI Pricing Copilot finds the best price on every marketplace from one cost — free.

Try Pricing Copilot →