Cost of Goods Sold Calculator
Use the standard periodic formula to find what the goods you sold actually cost you. Enter your opening and closing stock and what you bought in between; add net sales to see gross profit and gross margin as well.
Value of stock at the start of the period, at cost.
Value of stock left at the end, at cost.
Freight in, import duty, direct labour: costs of getting goods ready to sell.
Shows gross profit and gross margin.
Finding what your sales really cost
Cost of goods sold, or COGS, is the cost of the stock that actually left your shelves during a period. It is not the same as what you bought, because some purchases are still sitting in the store room and some of what you sold came from last period’s stock. The periodic formula sorts this out using two stock counts.
The formula
Start with the stock you had at the beginning. Add everything you bought, plus direct costs such as inbound freight, import duty you cannot reclaim, and direct production labour. Subtract purchase returns and discounts you received. That total is the goods available for sale. Take away the stock still on hand at the end, and the rest is COGS.
Example
A hardware store opens the year with 40,000 of stock. It buys 150,000 of goods and pays 10,000 in freight to bring them in, then returns 5,000 of faulty items to a supplier. Goods available come to 195,000. A count at year end finds 35,000 left, so COGS is 160,000. With net sales of 260,000, gross profit is 100,000, a gross margin of about 38.5%.
Turnover and days of stock
The calculator also divides COGS by the average of opening and closing stock. Here that is 160,000 ÷ 37,500, about 4.3 times a year, or roughly 86 days of stock. A falling turnover can signal slow-moving lines tying up cash. The days figure assumes a full year; for a quarter, compare it only with other quarters.
Getting the inputs right
Value all stock at cost, never at selling price, and use the same method each period, whether that is FIFO or weighted average. Keep sales tax you can reclaim out of purchases. Operating costs like shop rent and office salaries do not belong here; list them in an operating expense calculation instead. If closing stock comes out higher than the goods available, one of the figures is from a different period or valued differently.
How to use Cost of Goods Sold Calculator
- Enter opening stock, purchases and closing stock for the period, all at cost.
- Add direct costs such as freight in, and purchase returns or discounts, if any.
- Read the cost of goods sold, and add net sales for gross profit and margin.
Privacy: how it works
Calculations run in your browser. The amounts you enter are not sent anywhere.
Frequently asked questions
What is the formula for cost of goods sold?
COGS = opening stock + purchases + direct costs − purchase returns and discounts − closing stock. With 40,000 opening, 150,000 bought and 35,000 left, COGS is 155,000.
What counts as a direct cost?
Costs of getting goods into a sellable state: inbound freight, import duty that cannot be reclaimed, and direct labour in production. Rent, salaries of office staff and marketing are operating expenses, not COGS.
Why does it say closing stock is too high?
Closing stock cannot be worth more than everything that was available to sell. Check that every figure is at cost and covers the same period.