Cost of goods sold for a period. The COGS Calculator takes opening inventory, purchases during the period, closing inventory, revenue (for the margin) and returns cost of goods sold plus gross margin, gross profit. Results update as you type, and the formula is shown under the result so you can repeat it in your own spreadsheet.
Margins tell you where the money goes between revenue and profit. Track each margin over time and against similar businesses; a falling margin while revenue grows is the signal to investigate. Use the worked example below to check the maths against your own figures.
How the COGS Calculator works
The cost of what was actually sold in the period, not what was bought. Stock that is still on the shelf at period end is excluded, which is why closing inventory is subtracted.
Worked example
With the example values (opening inventory of $120,000, purchases during the period of $500,000, closing inventory of $150,000, revenue (for the margin) of $900,000), the cost of goods sold is $470,000.00; gross margin 47.78%, gross profit $430,000.00. Change any figure above and the result updates immediately; use Copy results to paste the summary into a note or email.
Related Calculators
Frequently Asked Questions
How is cost of goods sold calculated?
COGS = opening inventory + purchases − closing inventory.
Which figures do I need?
Opening inventory, purchases during the period, closing inventory, revenue (for the margin). Take them from the same period and the same set of accounts or reports so the ratio is consistent, and check the example values as a guide to the units expected.
What is a good margin?
It depends on the industry: grocery and distribution run on low single-digit net margins, software and services on 20% or more. Compare with similar businesses and watch your own trend.






