Skip to content
Unitly

COGS Calculator

COGS is the direct cost of what you sold this period. The classic inventory formula — beginning inventory plus purchases minus ending inventory — is what accountants use, and it's the foundation of every margin calculation.

Inputs

Inventory value at the start of the period.

New stock bought or produced, incl. inbound freight.

If set, shows COGS as % of revenue.

Results

COGS

$15,500

Gross profit
$16,500
COGS as % of revenue
48.0%
Gross margin
52.0%

Formula

COGS = Beginning Inventory + Purchases − Ending Inventory

FAQ

Which valuation should I use for inventory?

Use your cost basis (what you paid), not retail value, and stay consistent with one method (FIFO, average cost, etc.).

Does this match my tax COGS?

The formula matches the standard approach, but tax rules on what can be included vary by jurisdiction — confirm with an accountant for filings.