How the Cost of Goods Sold Calculator calculates COGS
How to use the calculator
- Enter the inventory value at the start of the period in
Starting inventory. - Enter purchases made during that period in
Purchases during periodand the inventory value at its end inEnding inventory. - Choose a display symbol in
Currency symbol. This changes the symbol shown beside amounts and does not convert them. - Select
Calculate COGSto show goods available for sale, COGS, the formula, and the assumptions table. - Select
Copy resultorDownload result (.txt)to take the calculation outside the page. SelectResetto clear the inputs and result.
COGS formula from starting and ending inventory
The calculator adds Starting inventory and Purchases during period to get goods available for sale. It subtracts Ending inventory from that subtotal:
Starting inventory: $20,000
Purchases during period: $50,000
Goods available for sale: $70,000
Ending inventory: $15,000
COGS: $55,000
The displayed formula is COGS = Starting inventory + Purchases - Ending inventory. The result lists the goods-available subtotal and the two inventory values, so each part of the subtraction is visible.
What the COGS calculator accepts
Each inventory field must contain a finite number of 0 or more. The inputs use a 0.01 step, and the result displays monetary values with two decimal places and locale-aware thousands separators.
Ending inventory cannot be greater than Starting inventory plus Purchases during period. If it is, the calculator shows an error and keeps the result hidden. Purchases during period is one value you enter; the calculator does not split it into separate accounting components.
When to use a cost of goods sold calculator
Use Starting inventory and Ending inventory measured at the beginning and end of the same accounting period. Include the purchases recorded during that period. The calculation does not choose an inventory costing method or separately model write-downs, returns, shrinkage, or other adjustments.
- Check Starting inventory, Purchases during period, and Ending inventory before using the COGS figure in another calculation.
- Keep the goods-available subtotal beside COGS when checking the arithmetic.
- Copy or download the plain-text result after confirming that all three values use the same inventory basis.
Choose a related business calculator
Use Business Calculators when you need a different business measure. Choose the Inventory Turnover Calculator when you have COGS and average inventory and need turnover or days of inventory on hand. Choose the Gross Margin Calculator when you have revenue and direct cost and need gross profit or gross margin. The Business Profit Calculator combines COGS with several profitability calculations.
Frequently asked questions
How do I calculate cost of goods sold from inventory?
Add Starting inventory to Purchases during period, then subtract Ending inventory. The calculator shows the goods-available subtotal before COGS.
What is the COGS formula with beginning inventory?
The formula is COGS = Starting inventory + Purchases - Ending inventory. Starting inventory is the value at the period's beginning, and Ending inventory is the value remaining at its end.
Can ending inventory exceed goods available for sale?
Ending inventory must be no greater than Starting inventory plus Purchases during period. Otherwise, the calculator reports invalid input and hides the result.
Can I copy a cost of goods sold calculation?
After a valid calculation, Copy result copies the plain-text output, and Download result (.txt) saves the same result as a text file.
Does the COGS calculator use live inventory data?
It calculates from the three values you enter. It does not connect those fields to inventory records or market rates.