Businesses need to track all direct costs of processing goods for sale, including labor and material expenses. These costs are known as Cost of Goods Sold (COGS), a calculation that usually appears in a business’s Profit and Loss statement (P&L).

COGS is also an important part of tax return information because who doesn’t want correct tax deductions? Knowing how to calculate COGS can help you determine the correct product price, detect growth opportunities, and manage your taxes.

What is the Cost of Goods Sold (COGS)?

Cost of Goods Sold (COGS) represents all costs involved in producing goods that a company sells over a certain period of time. The cost of goods sold, also known as the cost of services or the cost of sales, includes both the cost of materials used to create the goods and the cost of direct labor (employees’ salaries).

COGS illustration

COGS can be used by businesses that create products, including digital goods sold online. Besides that, companies in the service industry can also use COGS in the form of cost of revenue. 

How to Calculate Cost of Goods Sold – The Formula

You can apply the following formula to calculate the cost of goods sold:

COGS = beginning inventory + purchases – ending inventory

Let’s take a quick look at the components of COGS:

  • Beginning inventory: this is the company’s inventory from the previous period. It could be the previous quarter, month, year, etc.
  • Purchases: these are the total costs of what your company purchased during the specified accounting period.
  • Ending inventory: the inventory that remained during that period.

COGS includes direct costs like materials and labor but leaves out indirect expenses such as marketing and sales costs.

A man posing happily in front of a vivid purple background for an engaging blog post.

Like what you're reading?

Join the informed eCommerce crowd!

Stay connected to what’s hot in eCommerce.

We will never bug you with irrelevant info.

By clicking the Button, you confirm that you agree with our Terms and Conditions.

Cost of Goods Sold Examples

Example 1

Let’s say you want to calculate the cost of goods sold in the first quarter of 2021. Your inventory record’s beginning inventory will be on 1st January and ends on March 31. If your business had a beginning inventory of $20,000 and the purchases totaled to $9,000 for that quarter, and you hand an ending inventory of $5,000, then your total COGS for that quarter will be:

COG= Beginning Inventory + Total Purchases on the Specified Period – the Ending Inventory

COG= $20,000+ $9,000 -$5,000 = $24,000

Therefore, the total costs of goods (COG) sold in that quarter are $24,000.

Example 2

The beginning inventory recorded for the fiscal year ended in 2020 is $3,000. There is also an additional inventory purchased during the 2020-2021 fiscal year amounting to $2,000 and $1500 ending inventory recorded at the fiscal year ended 2021. Based on the COG formula, the cost of goods sold will be:

COG=$3,000 + $2,000 – $1,500 = $3,500.

Example of a Cost of goods sold worksheet (COGS Worksheet)

Example 3

Suppose you run a clothing store. At the start of the year, your inventory of clothing is valued at $30,000. During the year, you purchase an additional $50,000 worth of new stock. By the end of the year, you have $20,000 worth of clothing left unsold. Here’s how you would calculate your COGS:


In this example, your cost of goods sold for the year would be $60,000. This includes all the inventory purchased minus what is left at the end of the year, indicating how much was sold during the year.

Example 4

A software company might seem less intuitive because it deals with digital goods, which do not have physical inventory. However, if the company licenses third-party technologies or incorporates purchased codebases, these costs can be considered part of COGS. If the beginning inventory of licenses was $5,000, additional licenses bought were $25,000, and the ending value of licenses was $10,000, the COGS would be:


This reflects the cost of the licenses used to deliver sold products over the year.

Example 5

For a restaurant, the COGS includes the cost of ingredients and food items that are used to make meals for customers. Let’s say the beginning inventory of food supplies is $8,000, the restaurant buys $70,000 worth of ingredients during the year, and the ending inventory is $7,000. The COGS would be:


This calculation shows the cost of the food ingredients used in meal preparation throughout the year.

Extended COGS Formula

To capture a more complete picture of your production costs, it’s crucial to consider additional variables that can affect your bottom line. This extended COGS formula incorporates key elements such as returns, freight charges, discounts, and allowances, providing a detailed calculation that reflects the true cost of goods sold more accurately. By including these factors, businesses can ensure a more precise financial analysis and make informed decisions to enhance profitability. Here’s how each component plays a crucial role in the formula:

COGS = Beginning inventory + purchases + Freight In – Ending inventory – Purchase Discounts – Purchase Returns and Allowances

  • Beginning inventory: this is the inventory amount at the opening of the stock period.
  • Purchases: any costs incurred for purchasing manufactured products or setting up a product, for instance, raw materials.
  • Freight In: the transport costs incurred for the raw materials being brought to the setup location or factory.
  • Ending inventory: the amount of closing stock for the specified period.
  • Purchase discounts: they are discounts that are received in the product supply chain.
  • Purchase returns and allowance: purchase returns are costs incurred when items are returned to suppliers. Meanwhile, allowances are any additional benefits that are received in the product’s purchase chain.

Here’s an example that demonstrates how to apply the Extended COGS Formula in a practical scenario.

Consider a company XYZ manufacturing packet of pens. Note that the direct cost of manufacturing one packet is $2.00, and below are the other statistics.

  • Opening inventory: 3000 packets
  • Closing inventory: 1,000 packets
  • Freight in $20,000
  • Discounts received: $4,500
  • Purchase costs: $50,000

The cost of opening inventory: 3000 x 2 = $6,000
The cost of closing inventory: 1000 x 2 = $2,000
COG= $6,000 + $50,000+ $20,000-$4,5000 – $2000 = $69,500.

By utilizing specific data such as opening and closing inventory, freight costs, discounts, and purchase expenses, the solution calculates the total COGS for a company manufacturing packets of pens. This illustration aims to offer readers a clear understanding of how the formula works in real-world contexts, aiding them in their financial analysis and decision-making processes.

> Discover the top 10 KPIs that have a major impact on your Customer Lifetime Value.

Smart Tips for Calculating COGS Accurately

  • It’s crucial to understand the difference between direct and indirect costs when you’re calculating your COGS. Direct costs are directly tied to production, like raw materials and labor used on the product line. Indirect costs, which shouldn’t factor into your COGS, include things like salaries for staff who don’t work on the production line, rent for your office spaces, and depreciation of non-production assets.
  • Keep tabs on your beginning inventory. Ideally, your starting inventory at the beginning of the year should match the ending inventory from the previous year. This consistency ensures accuracy in your year-over-year cost tracking.
  • Returned goods can directly affect your COGS calculation. Ensure you properly account for all returns and allowances. Deduct these from your total sales to prevent overstating your revenue, which, in turn, adjusts your COGS for goods that were not actually sold.
  • The method used for inventory valuation (e.g., FIFO, LIFO, Average Cost) can affect your COGS calculation. Consistently applying the same accounting method is crucial for accurate financial reporting and comparison across periods. Switching methods can lead to significant variations in COGS, affecting financial analysis and forecasting.
  • Changes in supplier pricing can affect your COGS. Regular monitoring of these changes helps anticipate impacts on your cost structure. This is particularly important for businesses where raw materials constitute a large portion of COGS. Timely adjustments in pricing strategy or sourcing decisions may be necessary to maintain profitability.

Changes in COGS/ How to Value Your Inventory

There are three types of inventory costing techniques that you can use to value your inventory:

First In, First Out (FIFO)

Goods that were manufactured or purchased first are the first ones to be sold. With FIFO inventory, it means that your business will have to sell first the least-expensive products. That’s why this method usually results in lower COGS.

Last In, First Out (LIFO)

Opposite of FIFO, this assumes the last items purchased are the first sold. Useful in reducing income tax during inflation but can lead to higher COGS.

Average Cost

 This method smooths out price fluctuations by averaging the cost of goods available for sale during the period.

Note: Regardless of the inventory method you choose, it’s important to find a technique that works for your business and stick to it. This will help to ensure calculation consistency. Besides that, this brings in familiarization and can help you quickly determine possible calculation errors.

Interpreting Your Business’s COGS

Now that you know the information relayed by COGs, what does this mean to your business? The first thing you need to realize is that COGS is critical in determining the operational efficiency of your business. This can help you quickly pinpoint the parts of the production process that increase your operational costs.

This way, you can reduce operational costs by minimizing your staff, reducing machine idle time, or implementing new business tactics. With the use of COGS, you can promote operational efficiency by:

  • Trying to minimize thefts and product damage in the best way possible
  • Avoiding overstocking to avoid losses and increased warehousing and storage costs
  • Getting enough stock to avoid last-minute orders or loss of revenue

Apart from production efficiency, this formula is also ideal in comparing the costs of different products. For companies dealing with multiple products, such information can help identify products that bring in more money and result in losses.

So, what happens if you think you are efficiently running your business, but you still find your COG is extremely high? If you are selling multiple products, you might want to discontinue products with high COGS.

COGS Metrics and Ratios

To effectively determine the number of goods sold for a business and its financial health, the ratios and metrics that can be used with COGS are:

COGS Ratio

It is usually used to highlight the sales revenue percentage used by businesses to pay for those expenses that directly vary with sales.

COGS ration = (COGs/ Net Sales) x 100

For instance: if a Company Z has COGS of $50,000 and total net sales of $60,000, then its COGS ratio will be:

(50,000/60,000) x 100 = 83.3%

Inventory Turnover

It’s a type of ratio used to determine how well a company can generate sales from the inventory. Inventory turnover indicates the number of times that the involved company has sold and replaced its inventory in a given period. To calculate it:

Inventory formula = COGS/ Inventory Average

The average of any inventory can be established by adding the ending and beginning of the inventory and then dividing this amount by two. High inventory turnover is proof of more sales and moderately good inventory.

Gross Profit Margin

It’s the percentage of sales revenue a company retains after incurring all its COGS. It should be noted that the higher the gross margin, the more the amount a business can retain from every dollar of revenue.

Gross margin = ((Sales revenue – COGS) / Sales Revenue) x 100

> Discover how to promote your best products using the Product Assortment Optimization Framework.

Cost of goods sold versus operating expenses

To understand the difference between operating expenses and the costs of goods sold, you must take into account how you attribute said costs.

Operating expenses the expenses that aren’t directly tied to creating the product. These can include rent, administrative fees, office supplies, etc. The majority of your costs will go under this category.

COGS, on the other hand, refers strictly to the costs directly involved in producing the goods: the materials you used, delivery, labour, etc.

Why Is It Important to Know COGS?

Understanding COGS is essential for small business owners for the following reasons:

Setting the right product price

If you know your COGS, you can set up the correct product cost without deterring your customers. With the right price, you will be able to successfully cover your business’s operating costs while ensuring that you earn a healthy profit margin. Generally, you will be in a good position to know when you need to reduce or increase your product prices. Of course, you can use COG alongside other industry-approved techniques to ensure that you effectively compete with other businesses in the same niche.

cogs income statement

Managing Your Taxes

There is a direct relationship between your COGS and your taxes. Note that sold COGS for your business are tax-deductible. COGS are usually the second line item that appears in the income statements of companies. You don’t want to get into legal disputes for not correctly filing your taxes.

If your business has high COGS, you will pay less in taxes with lower net income. This will also be a key highlight in alerting you that your business is highly likely not making enough profit; hence, you need to implement a system that creates a healthy balance between your business’s profitability and operational costs.

Detecting Growth Opportunities

Consistently using COGS means using the historical data attained to determine seasonal trends. By using the historical changes, you can identify new opportunities that will drive the growth of your business. For instance, if your COGS is higher in winter, you can diversify your business with products in demand in winter to minimize the risk of making losses.

Analyzing Your Business’s Health

You can use COGS to calculate different ratios, which means that you can conveniently determine your business’s health. As a result, you can make better decisions, especially those more likely to impact your business positively. Additionally, the obtained information can help you figure out if your business should try and reduce operational costs, if you can fully pay your debts or if you should consider closing down your business.

If you are an eCommerce business looking for a way to unlock significant data-driven growth, then you should consider using REVEAL. This software program can organically increase the number of customers loyal to your business. Additionally, it provides actionable insights on how you can maximize profits and helps to enhance customer lifetime value.

The high-performance software program is already being used by more than 2200 brands, including Decathlon, Heineken, Culture Kings, Your Super Foods, etc. REVEAL’s main features include:

If you are ready to enhance your e-commerce customer lifetime value, then get REVEAL now on Shopify or other platforms.

Are There Businesses That Don’t Have Listed COGS?

Yes, there are businesses with zero COGS. Therefore, they don’t list their COGS in the income statement. However, this doesn’t mean that these businesses don’t have any expenses because they might still have operating costs such as office supplies, rent, and other utilities. Examples of companies without inventories include:

  • Accounting firms;
  • Business consultants;
  • Software as a Service (SaaS) businesses.

Limitations of COGS

An important aspect when we talk about understanding the cost of sold goods is that the numbers can be misleading.

Let’s look at the limitations of COGS and how you can avoid falling into them.

Numbers can be manipulated

Whether it’s about a misleading accountant, or someone who honestly doesn’t know the cost of goods sold formula, your COGS on paper do not always reflect the reality.

Keep an eye out for the value of ending inventory (which can be altered), discounts (can be overstated), and manufacturing costs (which can be exaggerated).


Frequently asked questions about COGS

How Do We Calculate Cost of Goods Sold COGS?

COGS = the starting inventory + purchases – ending inventory.
Beginning inventory is the value of the product inventory that you started with. It’s usually the same number recorded in the previous ending inventory. Purchases are usually the costs incurred during the reporting period, while ending inventory is the value left at the end of the reporting period.

What Goes into the Cost of Goods Sold or COGS?

These are direct costs involved in producing goods sold for your business. COGS includes directly used labor and the total costs of the materials used to create products. Additionally, other costs such as trade and cash discounts, freight-in, and total costs are included in this calculation. However, COGS doesn’t include any indirect costs, e.g., sales forces expenses or distribution costs.

What is cost of goods sold and how is it calculated?

Costs of Goods Sold (COGS) represent the expenses involved into producing your goods over a certain period of time. The COGS formula is: COGS = the starting inventory + purchases – ending inventory.

What are examples of COGS?

Examples of COGS include the cost of raw materials, direct labor costs, and manufacturing overhead costs. In a retail business, the cost of the products purchased for resale would be considered COGS. For a service business, COGS may include the cost of supplies or labor directly associated with providing the service. Essentially, any costs directly tied to the production or purchase of goods or services sold by the business can be considered COGS.