
Accounting Cost of Goods Sold Formula
Learn how to calculate cost of goods sold from inventory balances, purchases, purchase adjustments, and freight-in.
Cost of goods sold (COGS) estimates the inventory cost assigned to products sold during an accounting period. The calculation helps connect inventory activity to gross profit reporting, provided all inventory amounts use a consistent valuation basis.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
Cost of Goods Sold
Where:
Start with inventory on hand at the beginning of the period, add adjusted purchase costs, then subtract inventory still on hand at the end of the period.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| beginningInventory - Beginning inventory | Recorded cost of inventory on hand at the start of the accounting period. | currency |
| purchases - Inventory purchases | Cost of inventory purchased during the period before returns, allowances, and discounts. | currency |
| purchaseAdjustments - Purchase returns and discounts | Returns, allowances, and discounts that reduce the cost of inventory purchases. | currency |
| freightIn - Freight-in and import costs | Direct costs of bringing purchased inventory to its intended location, such as inbound shipping or duties. | currency |
| endingInventory - Ending inventory | Recorded cost of inventory remaining on hand at the end of the period. | currency |
Step-by-Step Calculation
Calculate net purchases
Reduce gross inventory purchases by purchase returns and discounts, then add freight-in and similar acquisition costs.
netPurchases = purchases - purchaseAdjustments + freightIn
Find goods available for sale
Combine beginning inventory with net purchases to find the total inventory cost available to sell during the period.
goodsAvailableForSale = beginningInventory + netPurchases
Subtract ending inventory
Inventory still on hand has not been assigned to current-period sales, so it is removed from goods available for sale.
costOfGoodsSold = goodsAvailableForSale - endingInventory
Use the combined formula
This equivalent formula calculates COGS directly while preserving the same inventory-cost flow.
costOfGoodsSold = beginningInventory + purchases - purchaseAdjustments + freightIn - endingInventory
Monthly retail COGS calculation
Subtract purchase adjustments
$80,000 - $3,000
$77,000
Add freight-in
$77,000 + $2,500
$79,500
Calculate goods available for sale
$25,000 + $79,500
$104,500
Calculate cost of goods sold
$104,500 - $30,000
$74,500
Final Result
Estimated cost of goods sold: $74,500.00
Assumptions
- ✓All input amounts apply to the same accounting period and are expressed in the same currency.
- ✓Beginning and ending inventory are measured using a consistent inventory valuation method.
- ✓Purchase returns, allowances, and discounts reduce the inventory purchase cost.
- ✓Freight-in and entered import costs are treated as inventory acquisition costs.
- ✓The calculation uses a periodic inventory approach.
Limitations
- !The calculator does not determine inventory unit costs or select an inventory valuation method.
- !Physical count errors, shrinkage, damaged goods, write-downs, and unrecorded transactions can change the reported result.
- !Treatment of freight, duties, rebates, and other costs can vary with accounting policies and circumstances.
- !COGS does not by itself show profitability because revenue and other business expenses are not included.
Common Mistakes to Avoid
Entering sales revenue instead of the cost of inventory purchases.
Adding purchase returns or discounts instead of subtracting them.
Omitting inbound freight or including outbound customer shipping as freight-in.
Using ending inventory from a different date or valuation basis than beginning inventory.
Treating rent, marketing, administrative payroll, or income taxes as inventory costs without confirming the appropriate classification.
Related Formulas
Frequently Asked Questions
What is the basic COGS formula?
The periodic formula is beginning inventory plus net purchases minus ending inventory. Net purchases equal purchases minus purchase returns and discounts plus freight-in.
Why is ending inventory subtracted from COGS?
Ending inventory represents inventory that remains unsold. Its cost stays in inventory rather than being assigned to the period's sales.
Is freight-in included in cost of goods sold?
Freight-in commonly increases inventory cost first. It becomes part of COGS when the related inventory is sold.
What are net purchases?
Net purchases are gross inventory purchases after subtracting purchase returns, allowances, and discounts and adding direct acquisition costs such as freight-in.
Can COGS be negative?
A negative result may indicate inconsistent inputs, such as ending inventory exceeding goods available for sale, or a transaction or inventory-count issue that needs review.
Does COGS include operating expenses?
This calculation excludes general operating expenses such as marketing, office rent, and administrative costs. Expense classification may depend on the business and accounting policy.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.