Total cost of goods sold (COGS) is the cost assigned to the goods a business sold during a period. This calculator estimates it from beginning inventory, purchases, and ending inventory; enter all three amounts in dollars to get total COGS.
Formula
Total COGS = beginning inventory + purchases during the period − ending inventory.
- Beginning inventory (beg): the recorded cost of goods held for sale at the start of the period, in dollars.
- Purchases (pur): the cost of inventory acquired for resale or production during the period, in dollars. Use the amount included in inventory under the business’s accounting method.
- Ending inventory (end): the recorded cost of goods still on hand at the period’s end, in dollars.
- Total COGS (cogs): the cost assigned to goods sold during the period, in dollars.
The formula assumes purchases are stated consistently with the inventory figures. In a more detailed calculation, qualifying freight-in and purchase returns or allowances may adjust purchases; those amounts should be included or deducted before applying the formula, not added a second time.
Worked Example
Using the calculator’s default values:
- Beginning inventory: $10,000.
- Add purchases: $10,000 + $25,000 = $35,000.
- Subtract ending inventory: $35,000 − $8,000 = $27,000 total COGS.
The result is the cost assigned to goods sold during the period, not the amount of sales revenue or profit.
Assumptions
- All three inputs cover the same accounting period and use the same currency.
- Inventory is valued consistently at cost using the business’s chosen accounting method.
- Purchases are the net amount relevant to inventory. Any applicable freight-in, returns, or allowances have already been handled consistently.
- The calculation does not model labor, manufacturing overhead, write-downs, inventory errors, or accounting adjustments separately. Include relevant amounts in the appropriate inventory and purchase records before using the formula.
What Total COGS Means
COGS is an expense associated with the goods a business sold in a period. It appears on the income statement and is subtracted from net sales to calculate gross profit: gross profit = net sales − COGS. For example, if net sales are $40,000 and COGS is $27,000, gross profit is $13,000 before other operating expenses, interest, and other items.
“Total” here means the full cost assigned to all goods sold over the selected period. It does not mean the total cost of every item purchased, nor the value of inventory remaining. Ending inventory is subtracted because it represents goods not yet treated as sold in this calculation.
The formula is a basic inventory reconciliation. Businesses with manufacturing operations may include direct materials, direct labor, and manufacturing overhead in the cost of inventory. When those goods are sold, their allocated production costs flow into COGS. The simple formula still expresses the movement from available inventory to inventory left on hand, but the accounting behind each amount can be more involved.
What to Include in Purchases
Use purchase amounts that correspond to inventory acquired for sale or production during the period. Depending on the accounting records and applicable accounting framework, the inventory cost may also reflect costs necessary to bring goods to their present location and condition. Confirm how the business records freight, discounts, returns, and allowances, then avoid counting them both in purchases and as separate additions or deductions.
- Purchase returns and allowances: goods returned to a supplier or price adjustments generally reduce the net amount paid for inventory.
- Freight-in: shipping to acquire inventory may be included in inventory cost under the applicable accounting treatment.
- Items not held for sale: ordinary office supplies and other non-inventory purchases do not belong in inventory purchases.
- Labor and overhead: for manufactured goods, qualifying production costs may become part of inventory cost rather than being treated as a simple supplier purchase.
These classifications can depend on the facts and accounting method. This calculator does not determine which costs qualify; it only adds the figures entered.
Inventory Methods and Common Problems
The formula does not decide which individual units were sold or what each unit cost. Businesses use an inventory cost-flow method—such as FIFO, LIFO where permitted, or weighted average, subject to the relevant accounting rules—to assign costs to sold goods and remaining inventory. Those methods can produce different COGS and ending-inventory figures when purchase costs change. Use figures prepared under one consistent method; do not combine an ending inventory amount from one method with purchases or beginning inventory from another.
A physical count and accurate records matter. If ending inventory is overstated, calculated COGS is understated by the same amount; if ending inventory is understated, COGS is overstated. Missing receipts, duplicate invoices, damaged goods, theft, or a count taken at the wrong cutoff can therefore affect the result. Investigate substantial differences between the records and the physical count instead of treating the calculator’s answer as a correction.
Another frequent error is confusing COGS with cash paid to suppliers. Purchases may be recorded in one period while payment occurs in another, and inventory can remain unsold after it is purchased. COGS tracks the cost allocated to goods sold, not necessarily cash outflow for the period.
Using the Result Responsibly
For a useful calculation, make sure the beginning inventory equals the prior period’s properly recorded ending inventory, unless a documented adjustment explains a difference. Choose a clear start and end date, use amounts from the same books and valuation basis, and retain supporting purchase and count records.
A calculator result is an arithmetic check, not a complete accounting review. If the result is unexpectedly negative, unusually large, or inconsistent with sales and inventory records, verify the signs, period, currency, and source figures. The calculator allows zero for each input but does not enforce that ending inventory is less than or equal to beginning inventory plus purchases; unusual data may require investigation rather than a forced adjustment.
Frequently Asked Questions
How do you calculate total cost of goods sold?
Start with beginning inventory, add purchases during the period, and subtract ending inventory. The result is the cost assigned to goods sold.
Is COGS the same as purchases?
No. Purchases are one part of the calculation. Some purchased goods may remain in ending inventory, while beginning inventory may include goods acquired in an earlier period.
Does COGS include unsold inventory?
No. Goods still on hand are represented by ending inventory and are subtracted from the cost of goods available for sale. Their costs are generally assigned to COGS when the goods are sold, subject to the applicable accounting treatment.
What is the difference between COGS and gross profit?
COGS is the cost of goods sold. Gross profit is net sales minus COGS; it is not the same as net income because other expenses and items may still need to be accounted for.
Can total COGS be negative?
A negative result is generally a sign that the input figures, periods, or inventory adjustments need review. The basic formula does not identify or fix the underlying accounting issue.
Does this formula work for a manufacturer?
It can describe the inventory reconciliation, but a manufacturer’s inventory costs may include materials, labor, and overhead. Those costs need to be assigned to work in process, finished goods, and sold products using the business’s accounting method.
Related
Formula used
in beg | Beginning inventory | $ | 10000 | 0 | 1000000000 in pur | Purchases during period | $ | 25000 | 0 | 1000000000 in end | Ending inventory | $ | 8000 | 0 | 1000000000 out cogs | Total cost of goods sold | $ | beg + pur - end | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard loan formula for this calculation, fixed rate and monthly compounding unless stated, rounded as each result states. Not financial advice; no lender, rate or product is recommended. See formulas and assumptions, the disclaimer or report an error.
More in this section
- Y-12 Auto Loan Rates and Monthly Payment Calculator$405.53
- Y12 Auto Loan Rates and Monthly Payment Calculator$405.53
- Shorter Auto Loan Term: Payments, Interest and Trade-Offs$405.53
- Automobile Loan Calculator: Payments and Total Interest$405.53
- Long-Term Loan: Meaning, Terms, and Repayment$405.53
- Vehicle Loan Payment Calculator and How It Works$405.53