What is COGS (Cost of Goods Sold)?
Cost of Goods Sold (COGS) is the total direct cost of the products you actually sold during a period — materials, direct labor, and production-related overhead tied to those units.
On the income statement, COGS sits right under revenue and directly drives gross profit and gross margin, making it a core lever for pricing, unit economics, and value creation.
Lower, well-controlled COGS (for the same revenue) means stronger gross profit, more cash for growth, and a healthier return on invested capital.
Formula
At a high level, COGS is computed as the cost of goods available for sale minus what’s left in ending inventory:
General COGS formula (with direct costs):
Retail / merchandising (basic method):
Manufacturing method (finished goods focus):
Here, COGM bundles all direct materials, direct labor, and factory overhead for goods completed in the period.
How to Use the COGS (Cost of Goods Sold) Calculator
This calculator lets you compute cost of goods sold using three common approaches—basic, detailed, and manufacturing—based on the inputs you already track in your accounting system.
Choose the appropriate method tab
- Select Basic, Detailed, or Manufacturing at the top, depending on whether you’re a reseller/retailer or a manufacturer and how granular your records are.
Enter the required inventory and cost data
- In the chosen tab, fill in the beginning and ending inventory (or beginning/ending finished goods), purchases, COGM, and any optional fields such as freight-in, returns, and discounts exactly as they appear in your accounts.
Let the calculator compute COGS using the correct formula
- As you type, the Results panel updates using these formulas:
Review the Results and method label
- Check the COGS value and the Method Used line in the Results box to confirm which approach was applied and whether the output matches your expectations.
Test scenarios, revenue impact, and reset
- Optionally enter Revenue to compare COGS against sales, switch between methods to see how different assumptions change COGS, and use Reset when you want to clear the fields and start a new scenario.
Frequently Asked Questions
Which COGS method should I use: Basic, Detailed, or Manufacturing?
Use Basic if you only track beginning inventory, purchases, and ending inventory. Use Detailed if you also track freight-in, purchase returns/allowances, and purchase discounts. Use Manufacturing when you produce goods and have a Cost of Goods Manufactured (COGM) schedule and finished goods inventories.
How does the calculator treat freight-in, returns, and discounts in the Detailed method?
Freight-in is added to the cost of purchases because it increases the cost of getting inventory ready for sale. Purchase returns/allowances and purchase discounts are subtracted because they reduce your net inventory cost. The calculator applies these automatically once you enter the amounts.
How will changing ending inventory affect my COGS and profit in this calculator?
A higher ending inventory lowers COGS and increases gross profit, because more cost is left on the balance sheet instead of expensed. A lower ending inventory raises COGS and reduces gross profit. You can quickly test scenarios by adjusting the ending inventory fields in each method.
Sources & Methodology