What Is Cost of Goods Sold (COGS)? Meaning and How to Calculate It

By Markets & Investing DeskUpdated Nov 10, 2026

Cost of Goods Sold (COGS)
Illustration · Fintrev

Definition

Cost of goods sold (COGS) is the direct cost of the products a company sold in a period, including materials, production labor and factory overhead. Revenue minus COGS equals gross profit.

Key takeaways

  • COGS counts only the costs of goods actually sold in the period. Costs attached to unsold inventory stay on the balance sheet.
  • The basic formula is beginning inventory + purchases - ending inventory.
  • COGS is an expense. Revenue minus COGS equals gross profit, and gross profit divided by revenue equals gross margin.
  • The inventory method a company uses (FIFO, LIFO, weighted average or specific identification) changes the COGS it reports, even when the physical goods are identical.
  • Pure service businesses have no inventory and usually report no COGS. They report cost of services or cost of revenue instead.

Cost of goods sold (COGS) is the direct cost of the products a company sold during a period: what it paid to buy those goods or to make them, including materials, production labor and factory overhead. It leaves out costs that are not tied to producing the goods, such as advertising, sales staff, head office rent and shipping to customers. On the income statement, COGS is subtracted from revenue to arrive at gross profit. Many companies label it “cost of sales.”

What COGS Includes and Excludes

COGS covers the costs needed to acquire or produce a sellable product. For a manufacturer, accountants group these costs into three buckets:

  • Direct materials: raw materials and components that become part of the product, such as steel and tires for a carmaker or flour for a bakery.
  • Direct labor: wages of workers who make or assemble the product.
  • Manufacturing overhead: production costs that cannot be traced to a single unit but are part of running the plant, such as factory utilities, equipment depreciation, factory supervisors and production supplies.

A retailer or wholesaler does not manufacture anything, so its COGS is mostly the purchase price of the merchandise plus the costs of getting it into sellable condition. Inbound freight (freight-in) is included because it is part of what the goods cost to acquire. Outbound shipping to customers is a selling expense and stays out of COGS.

An automaker shows the line clearly. The parts in each car and the wages of the assembly line workers are COGS. The cost of trucking finished cars to dealerships and the pay of the people who sell them are not. Cars built during the year but still unsold at year end are also kept out of COGS, regardless of whether their costs were direct or indirect. Those costs sit in inventory until the cars are sold.

A practical test for any cost is to ask whether it would exist if the company produced and sold nothing. Office rent, the finance team’s salaries and a brand advertising campaign would continue, so they are operating expenses. Materials and production labor would not be incurred, so they belong in COGS.

Are Salaries Included in COGS?

General salaries are not. Executives, administrative staff, accountants and salespeople are paid through operating expenses. Labor enters COGS only when it can be tied directly to producing the goods or to specific sales. Factory wages are the standard example. US tax guidance for small businesses also allows certain labor costs connected to specific revenue to be counted, such as payments to contractors whose pay is based on the work they perform for customers.

Is Marketing Part of Cost of Sales?

No. Marketing, advertising and promotion support future sales in general rather than producing a specific item, so they are reported in selling, general and administrative expenses (SG&A).

The COGS Formula

The standard formula works from inventory records:

COGS = Beginning Inventory + Purchases - Ending Inventory

Each part has a precise meaning:

  • Beginning inventory is the value of goods on hand at the start of the period. It equals the prior period’s ending inventory: merchandise that was bought or made earlier but not yet sold.
  • Purchases (for a retailer) or the cost of goods produced (for a manufacturer) is everything added to inventory during the period.
  • Ending inventory is the value of goods still unsold at the end of the period. It appears as a current asset on the balance sheet, and because the balance sheet is a snapshot at period end, the inventory figure shown there is the ending inventory.

Beginning inventory plus purchases is called goods available for sale. Every unit available was either sold (and becomes COGS) or remains on hand (and becomes ending inventory).

Adjusting Purchases for Freight, Discounts and Returns

The purchases figure in the formula is usually net purchases, not the invoice total:

Net Purchases = Purchases - Purchase Returns and Allowances - Purchase Discounts + Freight-In

Returns to suppliers and early payment discounts reduce what the goods actually cost. Freight-in increases it.

Worked Example: A Retailer

The following figures are hypothetical and only show the mechanics. A home goods store records this for its fiscal year:

Item Amount
Beginning inventory $40,000
Purchases at invoice price $120,000
Purchase discounts $2,000
Returns to suppliers $1,000
Freight-in $3,000
Ending inventory (counted and valued) $35,000

Step 1, net purchases: $120,000 - $2,000 - $1,000 + $3,000 = $120,000.

Step 2, goods available for sale: $40,000 + $120,000 = $160,000.

Step 3, COGS: $160,000 - $35,000 = $125,000.

If the store’s revenue for the year was $200,000, gross profit is $200,000 - $125,000 = $75,000, and gross margin is $75,000 / $200,000 = 37.5%.

The Manufacturer’s Version

A manufacturer holds three kinds of inventory: raw materials, work in process and finished goods. It first calculates the cost of goods manufactured (direct materials used + direct labor + manufacturing overhead, adjusted for the change in work in process), then applies the same logic to finished goods:

COGS = Beginning Finished Goods + Cost of Goods Manufactured - Ending Finished Goods

A Simple Per-Unit View

Without inventory accounting, the idea is easy to see. If a workshop sells a table for $200 and the wood, hardware and builder’s labor for that table cost $120, then $120 is the COGS for that sale and $80 is gross profit. The workshop’s rent and its advertising are not part of the $120.

How COGS Is Recorded

COGS is an expense, not revenue. It appears on the income statement directly below revenue (often net sales), and the line beneath it is gross profit. Public companies report it every fiscal quarter and year, so the figure is found in the income statement of a quarterly or annual report.

How the entry is booked depends on the inventory system:

  • Perpetual inventory system: each sale triggers two entries. One records the revenue (debit cash or accounts receivable, credit sales). The other moves the cost out of inventory (debit cost of goods sold, credit inventory). COGS builds up continuously through the period.
  • Periodic inventory system: purchases go to a purchases account during the period. At period end, the business counts its stock, values the ending inventory and calculates COGS with the formula above.

Under either system, the cost of a product sits on the balance sheet as an asset until the product is sold. Only then does it move to the income statement as an expense. This matches the cost with the revenue it helped produce.

Inventory Valuation Methods and Their Effect on COGS

When identical units are bought at different prices, the company needs a rule for which costs go to COGS and which stay in ending inventory. The rule is the inventory cost flow assumption. It does not have to match the physical movement of goods.

FIFO (First In, First Out)

FIFO assumes the oldest units are sold first. When purchase costs are rising, the older and cheaper costs flow to COGS, so COGS is lower and reported profit is higher than under LIFO. Ending inventory reflects the most recent, higher costs, which keeps the balance sheet value closer to current replacement cost.

LIFO (Last In, First Out)

LIFO assumes the newest units are sold first. When costs are rising, the most recent and more expensive purchases go to COGS, so COGS is higher, gross profit is lower and taxable income is lower. Older costs remain in ending inventory, which can leave the balance sheet figure well below current prices. LIFO is permitted under US GAAP but prohibited under IFRS. In the US, a company that uses LIFO for its tax return must also use it in its financial statements (the LIFO conformity rule).

Weighted Average Cost

This method divides the total cost of goods available for sale by the total units available and applies that average cost to every unit sold and every unit left in inventory. Averaging smooths the effect of a single unusually cheap or expensive purchase.

Specific Identification

Here the business tracks the actual cost of each individual item and charges that exact cost to COGS when the item is sold. It suits unique or high-value goods that can be told apart, such as cars, real estate, fine jewelry and artwork. It is impractical for large volumes of interchangeable items.

Example: The Same Sales Under FIFO, LIFO and Average Cost

The numbers are hypothetical. A distributor starts the quarter with no stock, then buys 100 units at $10 and later 100 units at $12. It sells 150 units.

  • FIFO: 100 units × $10 + 50 units × $12 = $1,600 COGS. Ending inventory is 50 units × $12 = $600.
  • LIFO: 100 units × $12 + 50 units × $10 = $1,700 COGS. Ending inventory is 50 units × $10 = $500.
  • Weighted average: total cost $2,200 / 200 units = $11 per unit. COGS = 150 × $11 = $1,650. Ending inventory is 50 × $11 = $550.

In each case COGS plus ending inventory equals the $2,200 of goods available. The method decides only how that total is split between the income statement and the balance sheet. With rising costs, the split gives LIFO the highest COGS and FIFO the lowest. When costs fall, the order reverses. This is why gross margins of two companies using different methods are not directly comparable without adjustment.

Why COGS Matters

It sets gross profit. Gross profit and gross margin show how much of each sales dollar remains after paying for the product itself, before overhead, interest and taxes. A rising COGS relative to revenue points to higher input costs, discounting, a shift toward lower-margin products or less efficient production. All else equal, higher COGS means lower net income.

It drives inventory ratios. Inventory turnover is COGS divided by average inventory, and days inventory outstanding is 365 divided by that turnover. These ratios use COGS rather than revenue because inventory is carried at cost, so both figures are measured on the same basis.

It is a tax deduction. In the US, businesses that sell products subtract COGS from gross receipts when computing taxable income. A higher COGS lowers the tax bill, but it also lowers the profit available to owners, so companies generally try to reduce COGS through better supplier pricing, less waste and more efficient production rather than to increase it.

It feeds other profit measures. COGS sits above every operating profit figure, including operating income and EBITDA. Depreciation of factory equipment is often embedded in COGS through manufacturing overhead, which matters when depreciation is added back.

Service Companies and COGS

Under GAAP, COGS refers to the cost of inventory sold. A business that sells only services usually holds no inventory and so reports no COGS. Accounting firms, law offices, consultants, appraisers and performers all have real expenses for delivering their work, but those are reported as cost of services or cost of revenue, not as COGS. IRS guidance lists doctors, lawyers, carpenters and painters among personal service businesses that generally do not calculate COGS.

Many service businesses also sell some goods. Airlines and hotels mainly provide transport and lodging, yet they sell food, beverages and gift items from inventory. They can report COGS for those goods and deduct it.

COGS vs. Operating Expenses

Both are costs of running the business, but they appear in different parts of the income statement. COGS covers production or acquisition of the goods sold. Operating expenses (OPEX) cover everything else needed to run the company, usually grouped as SG&A, along with items such as research and development. Typical operating expenses include:

  • Office rent and utilities
  • Office supplies
  • Legal and accounting fees
  • Sales and marketing
  • Administrative and management payroll
  • Insurance

The same type of cost can fall on either side depending on where it is incurred. Electricity for the factory floor is overhead in COGS. Electricity for the headquarters building is an operating expense.

COGS vs. Cost of Sales

The two terms are often used interchangeably, and many companies use “cost of sales” as the label for their COGS line. When a distinction is drawn, cost of sales is the broader term. It can include other direct costs of delivering a product or service to the customer, beyond the cost of the inventory itself.

COGS vs. Cost of Revenue

Cost of revenue is broader still. It covers all direct costs of generating revenue, including revenue from services and ongoing contracts. Depending on the business, it can include materials, direct labor, delivery costs and sales commissions. Those costs count as COGS only when they are tied to a tangible product sold. A software company that sells subscriptions, for example, typically reports cost of revenue for hosting and customer support rather than COGS.

Limitations of COGS

Because COGS depends on how ending inventory is counted and valued, it is one of the easier lines to distort. Ways it can be misstated include:

  • Assigning more manufacturing overhead to inventory than was actually incurred
  • Overstating supplier discounts
  • Overstating returns to suppliers
  • Manipulating the ending inventory count
  • Valuing inventory on hand above what it is worth
  • Failing to write down damaged or obsolete stock

Each of these inflates ending inventory. Since COGS equals goods available for sale minus ending inventory, a higher ending inventory produces a lower COGS, a higher gross margin and overstated net income. One warning sign is inventory growing faster than revenue or faster than total assets over several periods, especially alongside a rising gross margin.

Legitimate choices also limit comparability. Two companies with identical operations can report different COGS because one uses FIFO and the other uses LIFO or weighted average. Inventory write-downs can land in COGS in a single period and make that period’s margin look unusually weak. COGS also says nothing about cash timing: a company can pay suppliers long before or after the related goods are sold, which is why gross profit and free cash flow can diverge.

FAQs

Can COGS Be Higher Than Revenue?

Yes. If a company sells goods below what they cost, through clearance sales, aggressive pricing, or large inventory write-downs recorded in COGS, gross profit turns negative. A brief negative gross margin can follow a one-time write-down. A persistent one means the company loses money on its products before paying any overhead.

Is COGS the Same as Variable Cost?

No, although they overlap. Direct materials and much of direct labor rise and fall with production, so they behave as variable costs. Manufacturing overhead in COGS often includes fixed items such as factory depreciation and supervisor salaries. Some variable costs, such as sales commissions and outbound shipping, sit in operating expenses rather than COGS.

How Do You Calculate Average Cost of Goods Sold per Unit?

Under the weighted average method, divide the total cost of goods available for sale by the total units available, then multiply that average by the units sold. For a simple per-unit figure for a whole period, divide total COGS by the number of units sold.

The Bottom Line

COGS matters to anyone reading an income statement, from business owners pricing products to investors comparing gross margins. Only costs tied to producing or acquiring goods that were actually sold belong in the figure, and the inventory method shapes the result. Before comparing two companies, check whether they use FIFO, LIFO or weighted average, and watch for inventory growing faster than revenue.

About this page

Written by Markets & Investing Desk

The Markets & Investing Desk covers investing guides, the financial dictionary, companies, people, economics and market data.

Published
Last updated

Spotted an error? Tell the editors. This page is general information, not financial advice.