Blog

Cost of Goods Sold: Formula, Examples, and How to Calculate | Cin7

Written by Ciara Rogers | Aug 5, 2026, 9:30:00 AM

If you've been hanging around the accounting department, chances are you've heard the term cost of goods sold (COGS) thrown around a few times. But while COGS is important, it's also a concept people tend to misunderstand, which makes understanding what COGS is key to making smarter business decisions.

Knowing what COGS is will help you better understand all of the costs associated with your product and your profit margins. In this article, we'll go over this common accounting term, including what it is, how to calculate yours, and how it affects your bottom line.

Key Takeaways

  • Cost of goods sold (COGS) represents the direct costs of producing or purchasing the products your business sells, including materials, direct labor, and freight-in.
  • The COGS formula is: Beginning Inventory + Purchases − Ending Inventory = COGS.
  • COGS excludes indirect costs like rent, marketing, and administrative salaries.
  • Tracking COGS helps you set profitable prices, calculate gross profit, and make smarter inventory decisions.
  • Your choice of inventory valuation method (FIFO, LIFO, or weighted average) directly affects your COGS figure.

What Is the Cost of Goods Sold?

Cost of goods sold (COGS) refers to the direct costs of producing or acquiring the goods that your business sells. COGS is classified as an expense account on your income statement, representing the amount you need to recover from each sale before you can turn a profit.

COGS is only recognized upon the sale of inventory and is reported in the financial period in which those sales occur. For example, let's say you run a clothing business with $5,000 worth of inventory. If you sell $2,500 worth of that inventory in the second quarter, you'd record $2,500 in COGS. The rest stays in your inventory account until it sells.

As you can see, the cost of inventory sold and COGS match. That's because the value of your inventory stems from the direct costs of the items themselves, whether you've bought materials to manufacture products or purchased them for resale. COGS also includes additional charges directly related to getting products ready for sale, like packaging and inbound delivery fees.

Put simply, COGS equals the direct cost related to producing or purchasing products sold. The value of your inventory on hand is considered an asset until the inventory is sold.

What's Included in COGS (and What's Not)

Understanding what goes into COGS (and what doesn't) helps you calculate it accurately and price your products right. Here's the breakdown:

Costs Included in COGS

  • Raw materials and components: The physical materials that go into your product.
  • Direct labor: Wages for employees who directly manufacture or assemble products.
  • Freight-in and shipping to your warehouse: Costs to get inventory to your location.
  • Packaging materials: Boxes, labels, and wrapping used to prepare items for sale.
  • Manufacturing overhead: Factory utilities, equipment depreciation, and production supplies directly tied to making products.

Costs Excluded From COGS

  • Marketing and advertising: Costs to promote your products.
  • Rent and utilities for office or retail space (not production facilities).
  • Administrative salaries: Pay for accountants, HR, and other non-production staff.
  • Shipping to customers: Outbound distribution and delivery costs.
  • Sales commissions: Payments to salespeople.

These excluded costs fall under operating expenses, not COGS. If you're unsure which COGS formula to use for your business, the key is distinguishing between direct production costs and indirect overhead.

COGS vs. Operating Expenses

One common point of confusion is the difference between COGS and operating expenses. Here's how to think about it:

  • COGS covers the direct costs of making or buying the products you sell. If the cost wouldn't exist without producing that specific product, it's likely COGS.
  • Operating expenses are the indirect costs of running your business, regardless of how many products you sell. Rent, marketing, administrative salaries, and office supplies all fall here.

Quick example: You run a candle business. The wax, wicks, and fragrance oils are COGS. The rent for your studio, your marketing spend, and your accountant's salary are operating expenses.

On your income statement, you'll see COGS subtracted from revenue first to get gross profit. Operating expenses come out after that to arrive at operating income. Understanding this distinction helps you spot exactly where your money is going and where you can cut costs to improve profitability.

Why Is It Important to Calculate COGS?

Most businesses are in it to be profitable, and calculating your COGS is a critical step to getting in the black. When you know your COGS, you can work to reduce the costs associated with selling, including the cost of your inventory.

COGS tells you the direct expenditures you incur getting products ready for sale. For instance, if you know t-shirt fabric costs $5/yard, the labor to sew the shirts is $15/hour, and packaging runs about $1 per item, you can price your t-shirts at a point where you'll actually profit.

In this case, setting t-shirts at $15 wouldn't make you any money. Assuming each shirt uses two yards of fabric and takes 30 minutes to make, you need to price them at $30 or more before you see even a small profit. Seriously, calculating COGS can make or break your business. Here are some of the other benefits:

1. Helps Create a Pricing Strategy

As shown above, you can determine your selling price by knowing the direct costs of producing or procuring products. Once you know these costs, you can figure out how to price products to also cover your indirect expenses and earn a profit. But if you don't know your COGS, you're honestly just guessing.

Overall, knowing COGS helps you determine how much profit margin you can keep on the products you sell. You can also explore how COGS changes at different business stages to fine-tune your pricing as you scale.

2. Helps Determine Total Expenses Incurred in Selling Products

Your profit and loss statement needs to list all your income and expenditures. By calculating the direct costs you've spent acquiring stock, you can arrive at total expenses by including indirect costs like overhead, sales, and marketing.

You also need to know COGS before calculating your inventory turnover ratio, which can help you make more informed decisions about inventory and cut expenses further.

For example, if you calculate your inventory turnover ratio and find it's pretty low, you'll know you don't need to replenish inventory as often. That means you can negotiate better deals with suppliers to reduce costs even more.

3. Compare Market Value With Competitors

Determining profit margin by only considering direct costs is an incomplete picture. If your prices are higher than competitors, you may make fewer sales.

If your prices are lower, you can still incur a loss since your slim profit margin might not cover indirect expenses. COGS helps you sell products at a competitive price, grow sales, and earn profits.

Now that you know why calculating COGS matters, let's learn the formula.

How to Calculate COGS

Here's the formula to derive COGS:

COGS = Beginning Inventory + Purchases Made During the Period − Ending Inventory

Let's break this down into steps:

  1. Determine your beginning inventory. This is the value of all unsold inventory at the start of your reporting period (month, quarter, or year). It should match the ending inventory from your previous period.
  2. Add all purchases. Include the cost of any new inventory acquired during the period. Don't forget to add freight-in charges, customs duties, and any other costs to get products to your warehouse.
  3. Subtract your ending inventory. Count and value all unsold inventory at the end of your reporting period. This is what you still have on hand.

The result is your COGS: the cost of inventory that was actually sold during the period.

Note that this basic formula doesn't account for returns, discounts, obsolete stock, or your inventory valuation method. It's still incredibly useful, though, as shown in our example below.

Where to Find COGS

On your financial statements, COGS appears on the income statement directly below revenue. When you subtract COGS from revenue, you get your gross profit. This placement makes it easy to see how much of your sales revenue goes toward the products themselves versus what's left over to cover operating expenses and profit.

Inventory Valuation Methods and How They Affect COGS

The inventory valuation method you choose has a direct impact on your COGS figure, especially when prices fluctuate. Here are the three main approaches:

FIFO (First In, First Out)

With FIFO, you assume the oldest inventory is sold first. When costs are rising, FIFO results in lower COGS (since you're expensing older, cheaper inventory) and higher gross profit. This method often reflects the actual physical flow of goods for perishable items or products with expiration dates.

LIFO (Last In, First Out)

LIFO assumes your newest inventory is sold first. When costs are rising, LIFO results in higher COGS (you're expensing newer, more expensive inventory) and lower reported profit. This can reduce taxable income in inflationary periods. Note that LIFO is permitted under US GAAP, but IAS 2 (the IFRS inventories standard) prohibits LIFO.

Weighted Average Cost

This method averages the cost of all inventory available for sale during the period, then applies that average cost to units sold. It smooths out price fluctuations and is often used by businesses with large quantities of similar items. If you use a perpetual inventory system, your average cost updates with each purchase.

Whichever method you choose, consistency is key. Switching valuation methods can distort your financial comparisons over time and may require disclosure on your financial statements.

Example of COGS

Let's say Company X uses the calendar year to track inventory. The beginning inventory value was recorded on January 1, and the ending inventory value was recorded on December 31.

Here are the numbers:

  • Beginning inventory: $20,000
  • Purchases during the year: $7,000
  • Ending inventory: $4,000

Now, let's calculate COGS using the formula:

COGS = Beginning Inventory + Purchases − Ending Inventory

COGS = $20,000 + $7,000 − $4,000

COGS = $23,000

This means Company X spent $23,000 on the goods it actually sold that year. Use this formula to inform production, purchasing, and pricing decisions.

Calculating COGS also helps you determine gross profit. Suppose revenue for the year is $75,000:

Gross Profit = Revenue − COGS

Gross Profit = $75,000 − $23,000

Gross Profit = $52,000

That $52,000 is what's left to cover operating expenses (rent, marketing, salaries) and, ideally, leave you with net profit.

COGS-to-Sales Ratio and Gross Margin

Once you know your COGS, you can calculate two key profitability metrics: the COGS-to-sales ratio and gross margin.

COGS-to-Sales Ratio

This ratio shows what percentage of your revenue goes toward the direct costs of goods sold:

COGS-to-Sales Ratio = (COGS ÷ Revenue) × 100

Using Company X's numbers: ($23,000 ÷ $75,000) × 100 = 30.7%

A lower ratio means you're keeping more of each dollar earned. If your ratio is creeping up, it's a signal to investigate rising material costs, supplier pricing, or production inefficiencies.

Gross Margin

Gross margin (or gross profit margin) is the flip side. It tells you what percentage of revenue remains after covering COGS:

Gross Margin = ((Revenue − COGS) ÷ Revenue) × 100

For Company X: (($75,000 − $23,000) ÷ $75,000) × 100 = 69.3%

A healthy gross margin gives you room to cover operating expenses and invest in growth. Tracking this metric over time helps you spot trends before they become problems. With real-time reporting and analytics, you can monitor these numbers as they happen, not weeks later.

COGS: Key Business Takeaways

The COGS formula can be applied at an individual product level to inform decisions before you produce, procure, or sell. It helps you decide how much inventory to purchase, whether a slow-selling product needs a marketing push, and it's useful when tax season rolls around too. According to IRS Publication 334, businesses that make or buy goods to sell can deduct their cost of goods sold from gross receipts on Schedule C.

The COGS for a reporting period is the total of all product sales costs for that period. It's a vital metric on your financial statements, used to calculate gross profit and assess how well your business covers expenses.

Gross profit is a profitability measure that shows how well a business can cover indirect expenses and earn a profit. The value of COGS will always depend on the direct costs of products sold and the inventory valuation method your business uses.

For many product businesses, keeping COGS in check is the single biggest lever for profitability. That's why brands like The Spice & Tea Exchange rely on connected inventory systems to stay efficient. With Cin7, they fulfill orders quicker with better accuracy and comfortably serve their franchisees while carrying less inventory. When you have real-time visibility into inventory values, you can keep COGS low and margins healthy.

Frequently Asked Questions

What Is the Difference Between COGS and Expenses?

COGS measures the direct expenses associated with producing or buying the goods you sell: labor, manufacturing, and materials. It does not include indirect expenses like rent, marketing, or general office supplies. Those fall under operating expenses.

Is the Cost of Goods Sold the Same as Profit?

No. The name "cost of goods sold" tells you COGS covers some of your expenses, not your earnings. However, you can figure out profit if you know your COGS:

Revenue − Cost of Goods Sold = Gross Profit

COGS tells you how much your items cost to make and sell. Profit is what you keep after those expenses.

Is the Cost of Goods Sold Taxable Income?

COGS itself is not taxable income. According to IRS Publication 334, businesses that make or buy goods to sell can deduct their cost of goods sold from gross receipts on Schedule C. The result is your gross profit, which factors into taxable income.

COGS and operating business expenses are separate categories. Costs included in COGS are accounted for there and not also deducted as separate business expenses.

Are Salaries Included in COGS?

It depends on the role. Direct labor wages for employees who physically manufacture or assemble products count as COGS. However, salaries for administrative staff, salespeople, and other non-production roles are classified as operating expenses, not COGS. If someone's work directly touches the product, their wages go into COGS.

How Often Should You Calculate COGS?

Most businesses calculate COGS at the end of each accounting period, whether that's monthly, quarterly, or annually. If you use a perpetual inventory system, your COGS updates automatically with every sale. Frequent calculations give you better visibility into margins and help you catch cost issues before they eat into profits.

Can Cost of Goods Sold Be Negative?

Technically, no. COGS represents actual costs incurred, so it should never dip below zero. If your calculations show a negative COGS, it's usually a sign of an accounting error, such as incorrect inventory counts, duplicate entries, or misrecorded purchase returns. Double-check your numbers if you see a negative figure.

How Do You Calculate COGS in Excel?

You can set up a simple formula: =Beginning_Inventory + Purchases - Ending_Inventory. Enter your beginning inventory in one cell, purchases in another, and ending inventory in a third. Then reference those cells in your formula. For more complex needs, use a table to track purchases by date and apply FIFO or weighted average calculations with helper columns.

What Is a Good COGS-to-Sales Ratio for a Retail Business?

Per NYU Stern (Damodaran) data as of January 2024, US general retail averaged about a 30.9% gross margin, which implies roughly a 69% COGS-to-sales ratio. However, this varies by subsector: grocery runs a lower gross margin than specialty or building-supply retail. The most useful comparison is against your own subsector and your own historical trend over time.

Closing Remarks

COGS is a big part of running a profitable business, and your inventory is a big part of COGS. To keep track of it all, you should invest in a cloud-based inventory management system like Cin7.

When you add an IMS to your operations, you get a much clearer view of how to address slumps, slow-downs, or missed sales opportunities. Choosing the right inventory software can help your business hold onto less while making more. With integrated accounting features, you'll always know exactly what your inventory is worth and what it's costing you.

Ready to get COGS under control? Request a demo and see how Cin7 can help.