How this cost of goods sold calculator works
A COGS calculator finds the cost of the inventory you sold in a period. The headline is cost of goods sold. Details show goods available for sale, net purchases, and ending inventory. Open Purchase adjustments to add freight-in, returns, and discounts. This is an accounting estimate, not a general-ledger close.
Choose a currency, then enter beginning inventory, purchases, and ending inventory. Empty fields count as 0, so a result of USD 0.00 appears even if you have not typed anything — the empty-state copy is never shown. Freight-in, purchase returns, and purchase discounts are used only while Purchase adjustments is open.
How to use the COGS calculator
- Choose a currency. Empty beginning inventory, purchases, and ending inventory each count as 0.
- Enter the three inventory figures for the period. Typed 0 is the same as leaving a field empty.
- Read cost of goods sold, goods available for sale, and net purchases.
- Open Purchase adjustments only to add freight-in, returns, or discounts. Closing it treats those extras as 0 and hides those rows even if values stay typed.
Purchase adjustments, and closing it
This section is GPA-style. Freight-in, purchase returns/allowances, and purchase discounts are used only while Purchase adjustments is open. Closed, each is 0 even if amounts stay typed. Open, empty extras count as 0. Freight-in, returns, and discounts rows appear only while the section is open.
COGS formula
COGS is beginning inventory + purchases + freight-in − returns − discounts − ending inventory. While Purchase adjustments is closed, freight, returns, and discounts are 0, so COGS is beginning + purchases − ending. Net purchases are purchases + freight − returns − discounts. Goods available are beginning + net purchases.
Worked examples
Example: beginning USD 10,000, purchases USD 25,000, ending USD 8,000
Leave Purchase adjustments closed so freight, returns, and discounts are 0. Net purchases are USD 25,000.00. Goods available are 10,000 + 25,000 = USD 35,000.00. COGS is 35,000 − 8,000 = USD 27,000.00.
Example: the same inventories plus USD 500 freight-in
Open Purchase adjustments and enter USD 500 freight-in. Net purchases become USD 25,500.00. Goods available are USD 35,500.00. COGS is USD 27,500.00. Closing the section returns COGS to USD 27,000.00 even if 500 stays typed.
Example: nothing typed
With every field empty, beginning, purchases, and ending are 0. COGS is USD 0.00 and that result is shown immediately. The empty-state sentence is not used.
Things to keep in mind
FIFO, LIFO, and weighted-average costing change the inventory values you should type; this page does not pick a method. Amounts are an ISO currency code, then the number (USD 27,000.00). Switching currency only changes formatting.
COGS calculator FAQ
Why do I see a result before I type anything?
Empty beginning inventory, purchases, and ending inventory each count as 0, so COGS of USD 0.00 is a valid result right away.
Do I have to fill all three inventory fields?
No. Any empty field is 0. Typed 0 is the same as empty.
Are freight-in, returns, and discounts used when Purchase adjustments is closed?
No. While the section is closed they are 0 and those rows hide, even if values stay typed.
What happens if I close Purchase adjustments?
Freight, returns, and discounts drop to 0. COGS still uses beginning inventory, purchases, and ending inventory.
Can COGS be negative?
Yes, if ending inventory is larger than beginning plus net purchases. The widget does not clamp COGS at 0.
Does this COGS calculator store my numbers?
Completed results can be saved in this browser’s local history so you can reopen them later. They stay on your device and are not sent to our servers or to analytics.