Get started

Formula for cost of goods sold: how to calculate COGS accurately

Oksana Arbaciauskaite
  • 12 min read

  • Updated: June 05, 2025

Cost of goods sold formula: how to calculate COGS accurately

One of the main things a company needs to keep a close eye on to stay afloat is different numbers and metrics.

The COGS formula is: COGS = beginning inventory + purchases during the period (P) − ending inventory.

One such metric is the cost of goods sold, which represents how much money a business will need to spend to produce its goods. Calculating and accurately planning your expenses related to production costs will save you a lot of headaches in the future — and money, of course. Understanding COGS impacts various aspects of business operations, from budgeting to pricing strategies.

Find out the formula for the cost of goods sold and a step-by-step calculation guide.

What is the cost of goods sold (COGS)?

The cost of goods sold is a metric used to display the direct cost of producing goods a business sells. It shows the true cost of a product a business intends to sell and has invested money in.

Remembering the word “inventory” in the context of the cost of goods sold is also important. Let’s turn to its definition in the International Financial Reporting Standards (IFRS) – globally recognized accounting principles designed to standardize financial reporting practices across countries (required or permitted to use in over 140 countries, including the EU). According to IFRS, inventories are assets:

  1. held for sale in the ordinary course of business;

  2. in the process of production for such sale;

  3. in the form of materials or supplies consumed in the production process or the rendering of services.

Inventory can refer to a company’s merchandise or the materials used to create it.

To better understand what is the cost of goods sold, let’s list the direct costs involved:

  • Raw materials that were directly used to create a product (a car manufacturer buys steel to use for car production);

  • Wages paid to employees who were directly involved in creating a product (a car manufacturer pays mechanics to install engines).

These are considered direct expenses in the context of COGS.

Note that the cost of goods sold includes indirect costs, such as manufacturing overhead costs. Also known as production overheads or factory overheads, these are costs that can’t be traced to specific production units but are still required to manufacture a product. For instance, if a company purchases equipment to help produce their product, it is considered an overhead. Some fixed costs, such as factory rent, can even be considered overheads.

At the same time, COGS excludes indirect expenses related to advertising, sales commissions, marketing campaigns, promotional activities, distribution costs, and administrative expenses.

The cost of goods sold formula

The cost of goods sold formula is fairly straightforward: COGS = beginning inventory + purchases during the period (P) − ending inventory.

What does it all mean? Let’s review the formula for cost of goods sold in more detail:

  1. Beginning inventory. It is the cost of all goods a company has at the beginning of the calculation period. These are both goods held for sale or in the process of production.

  2. Purchases during the period (P). This figure represents the cost the business will spend on buying raw materials and producing goods during the period, including any additional inventory acquired.

  3. Ending inventory. It is the cost of products and inventory that weren’t sold or used during the period, also referred to as the ending inventory balance.

Here’s a simple example with figures for one month:

Beginning inventory (€17,300) + purchases during the period (€52,110) – ending inventory (€ 7,960) = cost of goods sold formula (€61,450).

Open an account

in Genome online

Get Started

Step-by-step instructions to calculate COGS

Let’s use a startup online clothes store as an example for calculating the formula for the cost of goods sold. Understanding the actual cost of goods is crucial for accurate COGS calculation.

1. Determine beginning inventory

A small e-store wants to calculate the cost of goods sold for the month. It all starts with finding out the beginning inventory costs, i.e., the cost of goods the store didn’t sell last month, which is part of the company’s inventory.

This inventory value will consist of different clothing items for the clothes store. For example, the inventory remaining is 120 units of dresses, 64 units of shirts, 72 units of trousers, etc., totaling €34,000.

Note: The inventory you started with is the same as the end inventory value from the previous month, which you can find on the company’s balance sheet.

2. Add purchases during the period

These costs will include all the inventory purchased during the month that is required to produce clothes, as well as the manufacturing costs incurred during production.

Let’s say the direct cost of direct raw materials (fabrics, zippers, buttons, labels, etc.) bought by the company is €9,540. Additionally, the e-store paid €2,000 for shipping.

Remember to include direct labor — the wages of employees directly involved in producing the merchandise. In this case, the direct labor is the company’s designer, who comes up with garment concepts. The direct costs related to the designer’s wages are €3,000.

Plus, manufacturing overhead costs: the store needed to pay the factory’s rent (€1,500) and repair one of the sewing machines (€700).

The costs incurred amounted to €16,740. Keep all the invoices for purchases made during the period to track your operating expenses more easily.

3. Subtract ending inventory

It refers to the products the company didn’t sell by the end of the month. Knowing this figure is important for calculating the cost of goods sold and evaluating your company’s performance.

Three calculation methods exist – first-in, first-out (FIFO), last-in, first-out (LIFO), and weighted average cost method. These are different accounting methods used for inventory valuation under GAAP, and they can lead to varying inventory values and affect the cost of goods sold (COGS) and overall profitability.

Points of comparison

First-in, first-out

Last-in, first-out

Weighted average cost

Time of sale

The earlier the goods are produced / purchased, the earlier they are sold.

Goods that were produced / purchased later are sold first.

Doesn’t matter.

Calculation process

Is based on the costs of the most recent goods produced / purchased.

Is based on the costs of goods produced / purchased the earliest.

Averages the cost of all similar goods available for sale.

Impact on COGS

Cost of goods sold is lower, as it reflects higher costs. The gross profit will be higher.

Cost of goods sold is higher, as it reflects lower costs. The gross profit will be lower.

Falls between FIFO and LIFO during periods of price fluctuation, creating a more stable gross profit.

How these can apply to the store’s ending inventory: on May 5th, the e-shop produced 25 t-shirts costing 35 euros each, and on May 20th, it produced 30 t-shirts costing 40 euros.

  • If the first-in, first-out method applies, then the cost of goods served will be 35 euros per t-shirt.

  • If the last-in, first-out method applies, the cost of goods served will be 40 euros per t-shirt.

  • If the weighted average cost applies, the total cost of all t-shirts (€2,075) is divided by the total number of t-shirts (55 units), meaning the cost of goods served will be 37,7 euros per t-shirt.

For our example, the ending inventory is €23,700.

4. Calculate the cost of goods sold

Now that we have all the costs let’s get to calculating the cost of goods sold formula. Beginning inventory (€34,000) + purchases during the period (direct costs attributable to raw materials and shipping (€9,540 + €2,000), labor costs (€3,000), and manufacturing overheads (€1,500 + €700)) ending inventory (€23,700) = €27,040. This total includes all direct costs incurred in producing and selling the goods. You can also use a special cost of goods sold calculator.

Open an account

in Genome online

Get Started

Importance of accurate COGS calculation

You need the cost of goods sold to calculate a company’s gross profit, which represents the revenue from selling products after deducting the production costs. The formula for gross profit is revenue minus the cost of goods sold. COGS is a critical line item on a company’s income statement, especially for product-based businesses, as it directly impacts the company’s gross profit.

COGS is also necessary to determine the net income – profit remaining after the deduction of all expenses. Not to mention profit margins – another crucial metric that determines how much the company has actually earned relative to the revenue.

At the same time, if you make mistakes during the COGS calculation, it can distort your gross profit, net income, and profit margins.

To keep all your business transactions recorded and access financial reports at any time, – open an account in Genome! We offer multi-currency accounts for all your company’s needs with straightforward currency exchange and money transfer services – both SEPA Instant Transfers and international money transfers (SWIFT) are available! Issue hundreds of Visa Business cards, and don’t worry about losing any financial data – all records of your operations will be easily accessible online!

Accounting methods for COGS

The accounting method for COGS is crucial in determining the accuracy of the cost of goods sold calculation. There are several accounting methods that can be used, including the First-In, First-Out (FIFO) method, the Last-In, First-Out (LIFO) method, and the Average Cost method. Each method has its own advantages and disadvantages, and the choice of method depends on the specific business needs and circumstances.

For example, the FIFO method assumes that the oldest inventory is sold first, which can be beneficial in times of rising prices as it results in lower COGS and higher gross profit. On the other hand, the LIFO method assumes that the most recent inventory is sold first, which can be advantageous in times of inflation as it results in higher COGS and lower taxable income. The Average Cost method calculates the average cost of all inventory items, providing a middle ground between FIFO and LIFO.

When calculating COGS, it’s essential to consider the accounting method used, as it can significantly impact the accuracy of the calculation. By using the correct accounting method, businesses can ensure that their COGS calculation is accurate and reliable, ultimately leading to better financial management and decision-making.

Financial statements and COGS

COGS is a critical component of a company’s financial statements, particularly the income statement. The income statement shows the revenues and expenses of a business over a specific accounting period, and COGS is one of the most significant expenses. The COGS calculation is used to determine the gross profit, which is the difference between revenues and COGS. The gross profit is then used to calculate the gross margin, which is a key indicator of a company’s profitability.

By analyzing the COGS on the income statement, businesses can identify areas for cost reduction and improvement, ultimately leading to increased profitability. Additionally, the balance sheet also plays a crucial role in COGS calculation, as it provides the beginning and ending inventory values. To calculate COGS, businesses need to understand how to read and analyze their financial statements, including the income statement and balance sheet. This comprehensive understanding allows businesses to make informed decisions that enhance their financial health and operational efficiency.

Common mistakes in calculating COGS and direct costs

Businesses can encounter common mistakes when calculating the cost of goods sold.

  • Overlooking indirect costs. Costs directly related to production are much easier to determine, making companies overlook other operating expenses, which are a part of the production process. For instance, paying for machinery rental at a factory is such an overhead.

  • Misclassifying inventory items. Some businesses make mistakes when classifying the merchandise they create as raw materials. It can result in the inaccurate cost of goods sold.

  • Inaccurate inventory counts. Such things happen as well, especially when a small business counts its goods manually, creating additional costs and vice versa. Your company needs to have appropriate inventory management tools and conduct periodic physical inventory counts to avoid this issue.

Methods to ensure accurate COGS calculation

  • Use inventory management systems to your advantage. They are more practical than counting the inventory still in stock and items purchased manually.

  • Make the inventory audits regular to avoid any miscalculations. You will also have a better understanding of how your company is doing.

  • Using accounting software will make every accounting period easier to analyze and calculate.

  • Hold training sessions for your employees to teach them proper management of the inventory and the basics of the company’s financial health.

Accurate COGS calculation is essential for effective financial analysis, aiding informed business decisions.

Open an account

in Genome online

Get Started

Examples of COGS calculations for different industries

  1. A retail company sells home decor supplies. To calculate its COGS for the month, we take the following information:

  • It begins the month with a diverse inventory of variable costs that amounts to €320,700.

  • During the month, it purchases more products to sell, which in total cost €154,000.

  • At the end of the month, after evaluating units sold, the remaining inventory is €89,500.

€320,700 + €154,000 – €89,500 = COGS of €385,200.

  1. A tech company selling goods that it manufactures in-house.

  • At the beginning of the month, it has €589,000 worth of unsold technical gadgets.

  • During the month, the company buys materials to create more products (€123,900), pays the employees’ wages (€101,000), and covers overheads related to manufacturing (€78,300).

  • After calculating the inventory sold, the remaining products total €120,000.

€589,000 + (€123,900 + €101,000 + €78,300) – €120,000 = COGS of €772,200.

  1. A business that offers cleaning services to offices.

  • At the beginning of the month, the equipment it uses for cleaning costs €30,000, including equipment depreciation.

  • During the month, the company buys more cleaning equipment worth €2,500 and pays employees who provide cleaning services (€12,700).

  • After calculating services sold, the inventory remaining at the end of the month is €11,200.

€30,000 + (€2,500 + €12,700) – €11,200 = COGS of €34,000

These goods sold examples illustrate how different industries calculate their COGS, highlighting the variations in direct expenses and accounting methods.

Interpreting COGS results

Interpreting COGS results is essential to understand the financial health of a business. A high COGS can indicate that a business is struggling with production costs, while a low COGS can indicate that a business is operating efficiently. By analyzing the COGS results, businesses can identify areas for improvement, such as reducing direct labor costs or overhead costs.

Additionally, COGS results can be used to compare the performance of different products or business segments, allowing businesses to make informed decisions about resource allocation. To interpret COGS results effectively, businesses need to consider factors such as pricing strategies, production costs, and inventory management. By doing so, businesses can gain valuable insights into their operations and make data-driven decisions to drive growth and profitability.

COGS metrics and ratios

There are several COGS metrics and ratios that businesses can use to evaluate their performance. One of the most common metrics is the COGS ratio, which is calculated by dividing COGS by revenues. This ratio can help businesses understand the percentage of revenues that are spent on production costs. Another important metric is the gross margin ratio, which is calculated by dividing gross profit by revenues. This ratio can help businesses understand the profitability of their products or services.

Additionally, businesses can use metrics such as inventory turnover and days inventory outstanding to evaluate their inventory management performance. By tracking these metrics and ratios, businesses can identify areas for improvement and make data-driven decisions to optimize their operations. For example, a business with a high COGS ratio may need to focus on reducing production costs, while a business with a low gross margin ratio may need to focus on increasing prices or reducing operating expenses.

Additional tips for managing COGS

Small details can be significant when managing the cost of goods sold. For instance:

  • Keep records and analyze how quickly your products are sold. This will help you better understand your remaining stock and reduce holding costs.

  • If you have been using the same suppliers for a long time, try renegotiating some of the prices and request a discount if possible.

  • Improve management techniques by aligning the time of materials delivery with production cycles, which is called the just-in-time inventory method.

  • Negotiate cash discounts with your suppliers to lower the direct costs and effectively manage your COGS.

Limitations of COGS

While COGS is a critical component of a business’s financial statements, it has several limitations. One of the main limitations is that it only includes direct costs, such as raw materials and direct labor, and does not include indirect costs, such as overhead costs and distribution costs. Additionally, COGS does not take into account other expenses, such as operating expenses and income tax.

Furthermore, COGS can be affected by accounting methods, such as the choice of inventory valuation method, which can impact the accuracy of the calculation. To overcome these limitations, businesses need to consider other financial metrics and ratios, such as operating expenses and net income, to get a comprehensive understanding of their financial performance. By understanding the limitations of COGS, businesses can use it as a tool to inform their decision-making rather than relying solely on it. For instance, a business may need to consider other costs, such as shipping costs and storage costs, when making pricing decisions.

Key takeaways

Understanding and effectively managing the goods sold cost (COGS) is crucial for any business aiming to maintain its financial health. It’s important to keep small details about the formula in mind to avoid mistakes associated with COGS.

Understanding and managing COGS is also crucial for running a profitable business.

Open an account

in Genome online

Get Started

FAQs 

What is the difference between COGS and operating expenses?

COGS is directly linked to expenses related to producing goods or services. Meanwhile, operating expenses are funds a business spends on day-to-day operations that aren’t directly tied to production. For instance, such a business expense can be rent, utilities, salaries of administrative staff, marketing, and sales costs.

How often should COGS be calculated?

Usually, the cost of goods sold is calculated at the end of each accounting period (every month, quarter, and year) to better reflect how the business is doing and to analyze it along with other financial statements. Regular calculation of COGS is also crucial for accurate tax reporting, helping businesses manage expenses and maximize deductions.

Can COGS be used to determine pricing strategies?

Yes, because it is important to any company to comprehend how much money goes into the production of your merchandise or services. Based on expenses, they set appropriate prices for goods. 

What is the impact of inventory valuation methods on COGS?

We previously described three inventory valuation methods: FIFO, LIFO, and weighted average cost. FIFO results in lower COGS, LIFO – in higher COGS, and weighted average cost falls between the two. 

You may also like