How to use the COGS Calculator
- Enter the cost of the inventory you had at the start of the period and at the end of it.
- Enter purchases for the period, the freight-in on them and any direct labor, materials or other product costs.
- Optionally enter your sales revenue to get gross profit and gross margin.
- Enter the days in the period to see how many days an item sits in stock on average.
The formula and a worked example
COGS equals beginning inventory plus purchases plus freight-in and other product costs, minus ending inventory. The first part is the cost of goods available for sale, and what you did not sell is taken off at the end. Gross profit is revenue minus COGS, and gross margin is gross profit divided by revenue. Inventory turnover is COGS divided by average inventory, where average inventory is the start and the end added together and halved, and dividing the days in the period by turnover gives the average days an item sits in stock.
Worked example: a year starts with 12,000 of inventory. Purchases are 30,000, freight-in 1,500 and other product costs 500, so goods available for sale are 44,000. The year ends with 9,000 of inventory, so COGS is 35,000. With 60,000 of revenue, gross profit is 25,000 and gross margin is about 41.67 percent. Average inventory is 10,500, turnover is 3.33 times and the average item sits in stock about 109.5 days.
Where the formula comes from
The IRS describes the same structure in Publication 334 for Schedule C: inventory at the beginning of the year, purchases, cost of labor, materials and supplies, and other costs, added together and reduced by inventory at the end of the year. Freight-in on merchandise you buy for sale counts as part of cost of goods sold there.
Shipping to your customers, marketplace fees and advertising are selling expenses, so they are left out of COGS and belong below gross profit. Tax treatment, such as how to value inventory or how overhead is allocated, depends on your situation and country, so confirm it with a tax professional.
Frequently asked questions
What is included in COGS?
The cost of the products you sold: purchases, freight-in, and direct labor, materials and other product costs, adjusted for inventory. Selling costs such as outbound shipping, fees and ads are not.
Why is ending inventory subtracted?
Stock still on your shelves has not been sold yet, so its cost belongs to a later period. Subtracting it leaves the cost of what actually sold.
What is the difference between gross margin and net margin?
Gross margin only subtracts COGS from revenue. Net margin also subtracts selling costs, overheads and tax, so it is always lower.
Why does the tool say ending inventory is too high?
Ending inventory cannot be more than the goods available for sale. Check the beginning inventory, purchases and ending inventory values.
Sources
Last reviewed