Cost Of Goods Sold: Formula, Meaning & Example

Cost of goods sold, commonly abbreviated as COGS, is the cost assigned to the goods or products a business sold during an accounting period. It connects inventory costs with sales and is normally deducted from revenue to calculate gross profit.
For a retailer, cost of goods sold may include the acquisition cost of merchandise sold. For a manufacturer, it can include qualifying production costs attached to the finished products sold. The exact composition depends on the business model and its accounting policies.
The important distinction is that COGS represents the cost of goods actually sold during the period, not simply everything the business purchased or spent on operations.
What Is Cost of Goods Sold?
Cost of goods sold measures the inventory cost that moves from the balance sheet into expense when the related goods are sold.
Consider a retailer that begins the month with $30,000 of inventory, purchases another $100,000 of merchandise, and finishes the month with $25,000 still in stock.
The company had $130,000 of goods available for sale, but $25,000 remains as ending inventory. The other $105,000 represents the cost assigned to goods sold during the period.
That cost appears on the income statement and directly affects gross profit.
Cost of Goods Sold Formula
For a merchandising business using a periodic inventory framework, the basic formula is:
Cost of Goods Sold = Beginning Inventory + Purchases − Ending Inventory
More broadly, purchases may need to be adjusted for items such as freight-in, purchase returns, allowances, or other costs depending on the accounting system and policy used.
The conceptual relationship remains:
COGS = Cost of Goods Available for Sale − Cost Remaining in Ending Inventory
This formula prevents the business from treating unsold inventory as though it had already been sold.
Cost of Goods Sold Example
Suppose a retailer reports:
| Item | Amount |
|---|---|
| Beginning inventory | $45,000 |
| Purchases during the year | $220,000 |
| Ending inventory | $55,000 |
Apply the formula:
COGS = $45,000 + $220,000 − $55,000
COGS = $210,000
The company’s cost of goods sold is $210,000.
The arithmetic can also be checked through goods available for sale:
Goods Available for Sale = $45,000 + $220,000 = $265,000
Then:
COGS = $265,000 − $55,000 = $210,000
Both methods produce the same result.
How COGS Affects Gross Profit
Cost of goods sold sits directly between revenue and gross profit.
The basic relationship is:
Gross Profit = Revenue − Cost of Goods Sold
Suppose the business generated $350,000 of revenue and had COGS of $210,000:
Gross Profit = $350,000 − $210,000 = $140,000
The company’s gross profit is therefore $140,000.
Its gross margin percentage would be:
Gross Margin = $140,000 ÷ $350,000 × 100 = 40%
The gross margin expresses the same basic relationship as a percentage of revenue rather than a dollar amount.
A rise in COGS, with revenue unchanged, reduces both gross profit and gross margin.
What Is Included in Cost of Goods Sold?
The answer depends on how the business creates or acquires what it sells.
For a retailer, COGS commonly reflects the inventory cost of merchandise sold.
For a manufacturer, product costs may include materials, production labor, and qualifying manufacturing overhead associated with finished goods.
The key principle is that COGS relates to producing or acquiring the goods sold. General administrative and selling expenses normally belong elsewhere in the income statement.
That distinction separates COGS from operating expenses, such as many office, administrative, marketing, and other costs that are not assigned to inventory.
COGS for a Manufacturer
Manufacturers often have a more complex cost flow because materials move through production before becoming finished goods.
At a simplified finished-goods level:
COGS = Beginning Finished Goods Inventory + Cost of Goods Manufactured − Ending Finished Goods Inventory
Assume a manufacturer starts with $80,000 of finished goods, transfers $500,000 of completed production into finished goods during the year, and ends with $95,000 of finished goods.
Then:
COGS = $80,000 + $500,000 − $95,000 = $485,000
The $95,000 remaining in finished-goods inventory is not part of current-period COGS because those goods have not yet been sold.
Purchases Are Not Automatically COGS
A common mistake is treating every inventory purchase as an immediate expense.
Suppose a retailer buys $100,000 of merchandise but sells only inventory carrying a cost of $65,000 during the period.
The full $100,000 purchase does not automatically become COGS. The unsold portion remains inventory until the related goods are sold, subject to the company’s applicable inventory accounting method.
This is why ending inventory is a critical part of the COGS calculation.
Cost of Goods Sold vs. Inventory
Inventory represents product costs that remain associated with goods the company still holds.
Cost of goods sold represents product costs assigned to goods that have been sold.
The relationship can be summarized as a cost flow:
Beginning inventory → additions to inventory → goods sold or ending inventory
Because of this relationship, errors in inventory measurement can flow directly into COGS.
If ending inventory is overstated, COGS will generally be understated under the standard periodic formula.
If ending inventory is understated, COGS will generally be overstated.
That effect can then change reported gross profit.
COGS and Inventory Turnover
COGS is also used in the inventory turnover calculation because it provides a cost-based measure that can be compared with average inventory.
The commonly used relationship is:
Inventory Turnover = Cost of Goods Sold ÷ Average Inventory
Suppose annual COGS is $600,000 and average inventory is $100,000:
Inventory Turnover = $600,000 ÷ $100,000 = 6 times
This does not change the meaning of COGS itself. It simply shows how the COGS figure becomes an input to a separate inventory-efficiency metric.
Cost of Goods Sold vs. Variable Costs
COGS and variable costs are not interchangeable.
Variable costs are classified according to cost behavior—they change with activity.
COGS is classified according to whether product costs are associated with goods sold.
A product’s COGS may contain costs whose behavior is not purely variable. Conversely, a business can incur variable selling expenses that are not part of COGS.
This distinction becomes especially important when calculating the contribution margin ratio.
Contribution margin uses variable costs:
Contribution Margin = Sales − Variable Costs
Gross profit instead uses COGS:
Gross Profit = Sales − COGS
The two calculations can therefore produce different results.
Cost of Goods Sold vs. Operating Expenses
Both COGS and operating expenses reduce profit, but they represent different economic categories.
COGS is tied to goods sold.
Operating expenses generally relate to running the broader business rather than acquiring or producing the inventory sold.
Assume a business reports:
- Revenue: $500,000
- COGS: $300,000
- Operating expenses: $120,000
Gross profit is:
Gross Profit = $500,000 − $300,000 = $200,000
If the simplified example has no other operating items:
Operating Income = $200,000 − $120,000 = $80,000
Combining COGS and operating expenses into one undifferentiated number would make it harder to understand where profitability is being gained or lost.
How Cost Variances Affect COGS Analysis
A business may expect a product to cost $20 per unit but discover that actual production or purchase costs were $22.
That difference can contribute to an unfavorable cost variance.
Suppose 10,000 units sold carried an expected cost of $20 per unit:
Expected Cost = 10,000 × $20 = $200,000
If comparable actual cost is $220,000:
Cost Difference = $220,000 − $200,000 = $20,000
Cost variance analysis helps management investigate why actual costs diverged from expectations. COGS itself remains the accounting measure of product cost assigned to the goods sold.
COGS and Cash Flow Are Different
Recognizing COGS does not necessarily mean the business paid the same amount of cash during that period.
A company can buy inventory in one month, pay the supplier later, and sell the inventory in another month.
The cash flow statement focuses on actual cash movements, while COGS focuses on the cost assigned to products sold.
Suppose inventory costing $40,000 is purchased on credit in December and sold in January. The timing of the purchase, supplier payment, inventory recognition, and COGS recognition may occur across different dates.
That is why profit and cash movement should not be assumed to occur simultaneously.
COGS Under Cash Accounting
Cash accounting addresses when transactions are recognized under a cash-based accounting approach.
COGS answers a different question: what product cost is associated with the goods sold?
Businesses should therefore avoid treating “cash paid for inventory” and “cost of goods sold” as automatically identical concepts. The appropriate treatment depends on the accounting framework and circumstances involved.
Debit and Credit Entries for COGS
The mechanics behind COGS also connect with debit and credit bookkeeping.
Under a perpetual inventory system, a sale of inventory commonly creates two accounting effects:
- the revenue side of the transaction; and
- the transfer of the sold inventory’s cost from inventory to cost of goods sold.
At a simplified level, the cost entry generally increases COGS and reduces inventory.
The exact journal entries depend on the accounting system, transaction, taxes, discounts, and other details, but the economic purpose is to move the sold product’s recorded cost out of inventory.
How Inventory Errors Affect COGS
Because ending inventory is subtracted in the formula, inventory errors can materially distort COGS.
Consider:
- Beginning inventory: $50,000
- Purchases: $200,000
- Correct ending inventory: $60,000
Correct COGS is:
COGS = $50,000 + $200,000 − $60,000 = $190,000
Now assume ending inventory is incorrectly recorded as $70,000:
Incorrect COGS = $50,000 + $200,000 − $70,000 = $180,000
COGS is understated by $10,000.
Assuming revenue is unchanged, gross profit would consequently be overstated by $10,000.
This is why accurate inventory records matter to both the balance sheet and income statement.
How to Analyze Changes in COGS
An increase in COGS is not automatically negative.
If sales volume increases substantially, COGS would normally rise as more products are sold.
The useful question is whether COGS changed appropriately relative to revenue, volume, pricing, product mix, and unit costs.
For example, suppose:
| Period | Revenue | COGS | COGS as % of Revenue |
|---|---|---|---|
| Year 1 | $1,000,000 | $600,000 | 60% |
| Year 2 | $1,200,000 | $780,000 | 65% |
Revenue increased 20%, but COGS rose from 60% to 65% of revenue.
Gross margin therefore fell from 40% to 35%.
Management would need to investigate possible causes such as supplier price increases, production inefficiency, discounting, product mix, freight costs, waste, or inventory-related issues.
Common Cost of Goods Sold Mistakes
One mistake is using purchases alone as COGS while ignoring beginning and ending inventory.
Another is including unrelated administrative or selling expenses in product cost without a valid accounting basis.
Businesses can also make poor comparisons by treating COGS and variable costs as identical.
Inventory count errors are another major problem because ending inventory directly affects the formula.
Finally, a decrease in COGS should not be evaluated alone. Lower COGS may reflect better purchasing or production efficiency, but it could also result from lower sales volume or changes in product mix.
Frequently Asked Questions
What is cost of goods sold in simple terms?
Cost of goods sold is the recorded cost of the products a business actually sold during a period.
It excludes inventory that remains unsold at the end of the period.
What is the basic COGS formula?
A common formula is:
COGS = Beginning Inventory + Purchases − Ending Inventory
For manufacturers, the calculation may involve cost of goods manufactured and finished-goods inventory.
Is cost of goods sold an expense?
Yes. COGS is generally presented as an expense associated with the revenue generated from selling goods.
It is normally deducted from revenue when calculating gross profit.
Is COGS the same as purchases?
No.
Purchases add goods to the amount available for sale. Goods that remain unsold generally stay in inventory rather than becoming current-period COGS.
Does COGS include salaries?
It depends on the nature of the labor and the business’s cost-accounting treatment.
Certain production labor can form part of product cost, while administrative or selling salaries generally belong outside COGS.
Does COGS include fixed costs?
Some product costs assigned to inventory can contain cost components that do not behave strictly as variable costs.
That is one reason COGS should not automatically be substituted for variable costs in contribution-margin analysis.
Why does ending inventory reduce COGS?
Ending inventory represents goods that have not yet been sold.
Because their cost remains in inventory, it is subtracted from goods available for sale when determining the cost attributable to goods sold.
Does higher COGS always mean worse performance?
No.
COGS often increases when sales volume increases. What matters is how COGS changes relative to revenue, unit volume, selling prices, product mix, and underlying cost levels.
How does COGS affect profit?
Higher COGS reduces gross profit when revenue remains unchanged.
Lower COGS increases gross profit under the same assumption.
What is the difference between COGS and gross profit?
COGS is the product cost assigned to goods sold.
Gross profit is the amount remaining after COGS is deducted from sales:
Gross Profit = Revenue − COGS
The two figures are directly connected but measure different things.



