COGS Calculator United States
This COGS calculator finds cost of goods sold from beginning inventory, purchases and ending inventory, plus gross profit, margin and inventory turnover.

What it does
The COGS Calculator works out your cost of goods sold from beginning inventory, purchases, and ending inventory, and can show gross profit and margin when you add revenue.
Data sources & parameters
This calculator uses standard financial formulas and runs entirely in your browser. It needs no external rate data — your result is computed only from the values you enter above.
We always strive to use the latest data for every variable so our results and reports are as accurate as possible. Even so, errors are possible — you should not rely on this tool or its report alone, and we accept no liability for any decision made based on it.
The formula
COGS = beginning inventory + purchases + additional direct costs - ending inventory
How it works
It adds purchases and any direct costs to your beginning inventory to find the goods available for sale, then subtracts ending inventory to find COGS.
Where it is used
- Preparing an income statement
- Tracking gross profit and margin
- Estimating inventory turnover
Worked example
Starting with $20,000.00 of inventory, buying $50,000.00, and ending with $15,000.00, your cost of goods sold is … from … of goods available for sale.
What the COGS calculator does
The COGS calculator finds your cost of goods sold, the direct cost of the inventory your business sold during a period. It starts from beginning inventory, adds purchases and any direct costs, and subtracts the inventory still on hand at the end. The result is the stock cost that goes on the income statement as an expense against the period’s sales.
For a business that sells physical products, COGS is the line between revenue and gross profit, so it affects how you read profitability, set prices and file taxes. The tool applies the standard periodic inventory formula and, if you enter revenue, also calculates gross profit, gross margin and inventory turnover.
The COGS formula
- Cost of goods available for sale = beginning inventory + purchases + additional direct costs.
- COGS = cost of goods available for sale – ending inventory.
Everything available to sell was either sold or is still in inventory at the end of the period, so subtracting ending inventory from goods available leaves the cost of what was sold. An error in the ending inventory count therefore flows straight into COGS and profit.
Beginning inventory, purchases, and ending inventory
Beginning inventory is the value of unsold products at the start of the period. In a continuing business it normally equals the previous period’s ending inventory.
Purchases are the cost of inventory bought during the period. For a manufacturer this line often covers materials and production instead of finished goods bought for resale, but the formula is the same.
Ending inventory is the value of stock still held at the close of the period, usually confirmed by a physical count or a perpetual inventory system. A higher ending inventory gives a lower COGS, and a lower one gives a higher COGS.
Additional direct costs
Some direct costs beyond the purchase price belong in COGS, most commonly inbound freight and, for a business that makes its own goods, direct production labor. Add these as additional direct costs. Indirect costs such as office rent, advertising and administrative salaries are operating expenses and should be left out.
Gross profit, margin, and turnover
- Gross profit = revenue – COGS, what remains to cover operating expenses and profit.
- Gross margin = gross profit divided by revenue, as a percentage, which lets you compare periods or products of different sizes.
- Inventory turnover = COGS divided by average inventory (the mean of beginning and ending inventory), the number of times you sold and replaced your stock during the period.
A healthy gross margin varies widely by industry, so compare it with your own history and your sector’s norms.
Inventory costing methods
The formula is the same whatever method you use to value units, but the dollar amounts you enter depend on it. First-in first-out assumes the oldest inventory is sold first; last-in first-out assumes the newest is sold first; weighted average cost spreads the cost of all units evenly. When prices are rising, first-in first-out tends to report lower COGS and higher profit, and last-in first-out the opposite. Use one method consistently, because switching changes reported profit and can complicate your financial statements and tax return.
Periodic versus perpetual inventory
A periodic system measures inventory at set intervals, typically with a physical count at period end, and derives COGS from this formula. A perpetual system updates inventory with each sale and purchase, so COGS is known at any time. Even with a perpetual system, the periodic formula is a useful check: a gap between the calculated COGS and the running total can reveal shrinkage, miscounts or recording errors.
What you need to enter
- Your beginning inventory for the period.
- Total purchases of inventory during the period.
- Your ending inventory, ideally from an actual count.
- Any additional direct costs such as freight-in or direct labor.
- Revenue for the period, if you want gross profit and margin.
Use the same valuation method every period, and carry each period’s ending inventory forward as the next period’s beginning inventory; small mismatches build up and distort the profit trend. Recalculate each period. For formal financial statements or a tax filing, reconcile the result with your accounting records and confirm the treatment of specific costs with an accountant.
This is general information only and not financial advice.
About This COGS Calculator
Use this COGS calculator to get an instant estimate based on the figures you enter. Adjust the inputs above to match your situation, or browse all our calculators to plan your next step.
