What is Cost of Goods Sold and How to Calculate It For E-commerce Stores

COGS - guide

In the simplest of terms, Cost Of Goods Sold (aka COGS) is the amount that’s spent on producing or procuring products and delivering them to customers.

It is also known as “Cost of Products Sold”, “Product Costs” or “Cost of Sales”.

Typically, Cost of Goods Sold includes the cost of manufacturing and storing (labor, materials, and overhead) a product, plus any estimated aftermarket costs.

Sometimes, product costs may include shipping fees to transport your inventory from a supplier to your warehouse.  Typically, calculating COGS includes purchasing costs, production materials, factory labor (if any), tariffs, inbound freight, retail packaging fees, and storage costs.

Why is COGS important?

Here are a few reasons:

  • For any eCommerce business, COGS is by far the largest expense you’ll deal with.
  • Inaccurate calculation of COGS can damage gross margins and hurt taxable income.
  • Misunderstood COGS will lead to flawed profit statements.
  • COGS has a major influence on critical decisions such as your ad spend, inventory orders, and retail pricing. The domino effect of an incorrect COGS means many other business choices will be flawed as well.

Difference between Operating Expenses and COGS

Operating expenses are necessary to keep your company running. They’re not related with producing goods and services, which is why they have their own line on an income statement separate from COGS (costs associated directly with generating revenue).

Overhead costs and SG&A (Selling and General Administrative) expenses are typically included as a separate line item under operating expenses.

Some examples of overhead expenses are utilities, rent, office supplies, sales and marketing, legal costs, insurance premiums, and payroll. You’ll spend money on these expenses regardless of whether you sell 10 or 10,000 different products.

Meanwhile with COGS, you’re only looking at the direct costs to procure, produce, and store products to be sold.

There are two formulas that you can use to calculate COGS. 

A simple formula and a standard formula. The simple version of the formula is often used by ecommerce merchants who resell products, whereas merchants who manufacture their own products tend to calculate COGS using the traditional formula.

Note: Based on the need, both of these formulas can be used alternatively to calculate COGS and check inventory.

Now let’s take a look at them.

Simple COGS Formula

Resellers who depend on various suppliers to source their product may calculate COGS with the below formula. It helps in determining unit cost of each lot of products or the cost for the entire purchase from a supplier.

COGS = Product Cost + Shipping Cost + Maintenance


  • Product Cost refers to cost involved in suppliers manufacturing your products.
  • Shipping Cost refers to the cost involved in shipping your products from suppliers to your warehouse.
  • Maintenance refers to the cost of maintaining your stock and inventory.

Let’s look at a quick example.

Imagine you sell a luxury line of clothes online, and you procure products from India.

  • The product cost for manufacturing each unit is $100.
  • The shipping cost for each unit is $50.
  • The maintenance cost for each unit is $25.

That brings the total cost of the good to $175.

Now if you retail this product at $499 and 100 units get sold in a month, then the total revenue is $49,900.

The cost of goods sold is $17,500.

Using these two metrics, you can now find the gross profit earned. You need to subtract the cost of goods sold from your revenue and that gives gross profit.

Gross Profit = Revenue – Cost of goods sold

Gross Profit = $49,900 – $17,500 = $32,400.

You can also calculate your gross margin with these numbers,

Gross Margin = ((Revenue — Cost of Goods Sold) / Revenue) X 100

Gross Margin = (($49,900 – $17,500) / $49,900) X 100 = 64.93%

That’s how you can calculate COGS and your gross margin using the above formulas.

Now, let’s look at a more standardized formula used by merchants who manufacture their own products.

Standard COGS Formula

This is a standard COGS formula used by most resellers and manufacturers. But manufacturers tend to use it often. Here’s the formula:

Cost Of Goods Sold (COGS) = Beginning Inventory + Purchases – Ending Inventory


  • Beginning Inventory refers to existing on-hand inventory at the start of the month.
  • Purchases refers to any new inventory bought or manufactured in the month.
  • Ending Inventory refers to remaining inventory after product sales in the month.

Let’s look at a quick example.

Imagine you’re a leather bag manufacturer, and you had 100 units of inventory at the beginning of the month. Each unit costs you $60 to manufacture.

In the mid of the month, you manufactured a new batch of 40 products.

At the end of the month, you sold a total of 80 products. So that’ll leave you with 60 products as ending inventory.

Now let’s check how much COGS is.

COGS = Beginning Inventory + Additional Purchases – Ending Inventory.

Beginning Inventory: 100 units X $60 = $6,000

+ Additional Purchases: 40 Units X $60 = $2,400

– Ending Inventory: 60 Units X $60 = $3,600

COGS = $6,000 + $2,400 – $3,600 = $4,800.


If your retail price for each is $200. Then the total revenue for the month is $16,000.

Now we can find gross profit and gross margin.

Gross profit = $16,000 (total revenue) – $4,800 (cogs) = $11,200

Gross Margin = (($16,000 – $4,800) / $16,000) X 100 = 70%

And that’s how you can calculate your cogs and gross profit using the standard formula.

Common Errors When Calculating Cogs

Error 1

Quite often a lot of eCommerce startups account for all the COGS in the first month and then assume that they’re making a full profit in the months following.

Incorrect COGS recording:

Can you see the problem now? – This is an incorrect calculation and can lead to a lot of discrepancies.

It is important to remember that inventory is an asset. For example, a bank would offer you a loan with your inventory as an asset. So you must inventory correctly each month.

Error 2

Most merchants make a common mistake of calculating COGS when they’re purchasing their inventory, instead of waiting till the sales kick in.

Not only is this a wrong accounting practice, but it will result in various discrepancies down the road when calculating your gross and net profit.

Direct costs, regardless of what product you make, are a major headache that should be taken into consideration. They can have a direct impact on your profitability. How can you lower direct costs while not compromising the quality of your product or changing what your customers have come relying on?

Reduced COGS is like a cost-benefit analysis that works. It starts with an in-depth analysis of all the possible ways it can be made to work efficiently.

Here are a few proven ways to reduce your COGS.

Procure materials for lower costs, if possible

Material costs are probably one of the biggest expenses in retail and ecommerce businesses. If you’re a D2C merchant then it would be in your best interest to reduce your raw material costs.

While it is a fantastic idea to reduce material costs, it should be done with caution.

When you’re considering changing the materials used in your product manufacturing, it is important to consider all factors such as adoption to technology, supply and demand, and the related prices.

It is also important to consider whether your product has an important role in the minds of your customers. For example, you may have a food product that uses organic material instead of non-organic. And organic crops generally have higher costs.

However, if your customers don’t value these features, you might consider switching to cheaper input materials.

It is critical to remember that you can always opt for lower-cost materials but you should never compromise on the quality of your product. Taking drastic and uncalculated measures while trying to reduce your product costs can drive your customers away.

So approach this move with caution.

Choose between multiple suppliers

If your products aren’t too unique or custom-built, then you may find multiple suppliers who offer similar products. Compare the features, advantages, and disadvantages of different suppliers to determine which ones are most beneficial for you and your customers.

You may want to ask questions such as: Is there a lower rate? Or Do they have quick delivery? Or Do they offer better discounts?

Choosing the supplier with the most advantages will always reduce your inventory costs.

Place bulk orders to get discounts

You can get attractive discounts when you order bulk. Shipping discounts may also be available as it is less expensive to ship a full container of products instead of a few. Ask your suppliers about the discounts they offer to help reduce your COGS indirectly.

Get Good with Negotiating with Your Suppliers

Your business’ success depends on strong relationships with suppliers and vendors. However, you shouldn’t be afraid to negotiate for the best price. To reduce your COGS, you should develop a negotiation strategy with your suppliers.

Most certainly, your suppliers would also want to be as profitable as you are. However, you should not give them too much leverage and play your cards well.

Your ability to get the best price for your products and to pay your suppliers and vendors the lowest possible price will greatly impact your profit.

Here are some examples of how you can negotiate with your suppliers:

  • Getting discounts by ordering bulk shipments
  • Leveraging discounts by clearing your invoices faster
  • Become part of trade groups where your supplies have better prices


Reduce wastage as much as possible

COGS can include wastage, which can come in many forms. There may be unfortunate circumstances where some of your inventory is lost or destroyed. There could also be special features in your product that are not standard and require additional steps to manufacture it.

These sorts of occurrences can drastically increase the cost of the product.

By taking precautions to safeguard your inventory and by understanding your customers’ needs, you can determine how to get rid of unnecessary expenses, thereby reducing your COGS and increasing your profits.

Adapt technology to automate repetitive process

With the advent of technology in multiple aspects of the ecommerce supply chain, you can easily adapt them to automate processes that require little human effort.

Automating such processes gives you the ability to reduce human resource expenses. It also provides competitive advantage in the market from an operations standpoint.

It also reduces costs and improves the reliability and speed of task execution, development, and support. It can also reduce human errors to the maximum extent and improve the productivity  of your organization.

Outsource your manufacturing and operations

Outsourcing refers to the act of moving a business process to another country where labor and material costs are lower. This business model is not new. Many globalized businesses have been using it for years.

China has been a popular destination for Western business owners because of its lower labor costs and material cost. Likewise countries like India and Philippines have been very lucrative places to produce goods for less costs.

However, sending your manufacturing duties offshore can have both positive and negative effects on your business. You will face cultural issues, communication barriers, and then there is also the problem of quality control.

But if you’re able to figure out a way that works best for you, then you’re most certainly going to experience better profit margins.

Ready to Transform Your Shopify Store?
Discover How We Can Help.