About this tool
Cost of Goods Sold (COGS) Calculator is a free, in-browser tool that computes the direct cost of the products you sold during a period from your inventory movements. Enter beginning inventory, purchases and ending inventory and the result appears instantly, calculated locally with nothing uploaded.
The formula is COGS = beginning inventory + purchases − ending inventory. This captures the cost of stock that left your shelves: you started with some inventory, added more, and whatever is not still on hand was sold. If you also enter revenue, the tool derives gross profit = revenue − COGS and gross margin = gross profit ÷ revenue × 100.
Use it at the close of a month, quarter or year to feed your income statement, or to check a supplier or accounting figure. Gross margin is the headline retail health metric — track it over time to see whether costs or pricing are eating your profit.
Frequently asked questions
How is COGS calculated?
COGS = beginning inventory + purchases during the period − ending inventory. It measures the cost of the goods that left inventory and were sold, not the cost of everything you bought.
What is the difference between gross profit and gross margin?
Gross profit is a dollar amount: revenue minus COGS. Gross margin is that profit as a percentage of revenue (gross profit ÷ revenue × 100), which lets you compare periods or products of different sizes.
What belongs in purchases?
The direct cost of inventory acquired during the period — merchandise, raw materials and freight-in. Operating costs like rent, marketing and salaries are not part of COGS; they sit below gross profit on the income statement.
Is revenue required to get COGS?
No. COGS needs only the three inventory figures. Revenue is optional and, when entered, adds the gross profit and gross margin tiles. Everything is computed in your browser.
More tools