Your Favorite eCom Newsletter  (Once you know it exists) Your Favorite eCom Newsletter (Once you know it exists)
Take a look

Cost of Goods Sold (COGS): Definition & How to Calculate It

By Tracy NgMay 26, 202511 min read
Cost of Goods Sold (COGS): Definition & How to Calculate It

Understanding your real profit starts with knowing your Cost of Goods Sold (COGS). Whether you’re running a Shopify store or a broader eCommerce operation, COGS helps you figure out exactly how much it costs to sell a product—so you’re not guessing when it comes to profitability.

In this guide, we’ll break down what COGS is, how to calculate it, and how eCommerce businesses can use it to make smarter decisions. 

What Is Cost of Goods Sold (COGS)?

Cost of Goods Sold (COGS) refers to the direct costs involved in producing or acquiring the products you sell. Your COGS directly impacts your gross profit. The higher your costs, the less profit you keep. That’s why understanding your COGS is essential to growing a sustainable Shopify business.

If you’re a Shopify seller, check our dedicated guide on Shopify COGS.

For most eCommerce stores, COGS typically includes:

  • Product or manufacturing costs
  • Packaging
  • Shipping to warehouse
  • Custom duties or import fees
  • Any direct fulfillment costs

Note: COGS doesn’t include marketing spend, platform subscriptions, or payroll—it focuses only on what it takes to deliver your product to the customer.

Cost of Goods Sold Formula

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

But for eCommerce sellers, especially those using dropshipping or third-party fulfillment, this formula simplifies into:

COGS = Product Cost + Packaging + Shipping + Customs/Duties

How to Calculate Cost of Goods Sold 

To calculate the cost of goods sold accurately, you need to account for every direct cost that goes into delivering your product to the customer. Here's a practical step-by-step process tailored for eCommerce stores:

1. Start with the cost per unit

This is your base product cost—what you pay your supplier or manufacturer per item. If you purchase in bulk, divide the total cost by the number of units.

Example: If you buy 500 units for $5,000, your unit cost is $10.

2. Add fulfillment and packaging

Include any warehouse pick-and-pack fees, packaging materials (boxes, tape, inserts), and branding costs like custom labels or thank-you cards. These often vary depending on how you fulfill orders (in-house, 3PL, or dropshipping).

Notice: Don’t underestimate these "small" costs—they add up fast.

3. Include shipping to customers or warehouses

This covers the cost to either ship from your supplier to your fulfillment center or directly to your customers. If you offer free shipping, it should still be included in your COGS since you're covering the cost. For global sellers, you need to account for both international freight and local last-mile delivery fees.

4. Don’t forget transaction-level costs

These are often overlooked. Include customs fees, taxes, currency conversion fees, per-order transaction costs, or processing fees if applicable. For print-on-demand or dropshipping models, these are especially important to track accurately.

5. Track COGS in Real Time - Not at Month-End

Many eCommerce merchants track COGS monthly or in batches but by then, the data’s already outdated. In reality, COGS fluctuates constantly. Moreover, it isn’t just hard to track—it’s easy to get wrong. A supplier discount today, a packaging change next week, or region-based shipping fees can all affect your true cost per order. When you rely on monthly averages or static spreadsheets, you risk misjudging your profit margins - especially at the SKU level.

Even a small change, like a $2 difference in supplier cost, can throw off your entire profit forecast if you’re relying on spreadsheets. That’s why real-time, precise tracking is non-negotiable.

Tip: To make better decisions, you need COGS data that reflects what’s happening now, not what used to be true last month. Tools like TrueProfit help you automate this process, tracking COGS per product, per order, and in real time - so every marketing, pricing, or scaling decision is based on accurate numbers.

Cost of Goods Sold Example

Let’s say you run a store selling custom hoodies. Here’s how your COGS might look:

Item

Cost (USD)

Product cost from supplier

$15.00

Branded packaging

$1.50

Shipping to customer

$5.00

Customs/import fees

$1.00

Total COGS

$22.50

If you sell the hoodie for $45, your profit would be:

$45 - $22.50 = $22.50

Tip: If you don’t want to manually check your profit, try this free profit checker.

Why COGS Matters for eCommerce Profitability

Among ecommerce metrics, COGS is the foundation of every profit calculation you make. It’s how you determine whether your pricing strategy is sustainable, if your ad campaigns are truly profitable, and where you can afford to scale.

Here’s why tracking COGS helps you grow:

  • See true profit in real time. Especially if you’re running paid ads or influencer campaigns.
  • Spot unprofitable products. If a SKU has high returns or low margins, COGS will reveal it.
    Make better pricing decisions. Know your break-even point before running discounts or promos.
  • Scale smartly. Once you know your high-margin winners, you can confidently reinvest in them.

Stop relying on rough estimates. Start scaling with confidence.

Large preview

TrueProfit's COGS Dashboard

If you're not tracking your Cost of Goods Sold (COGS) with precision, every pricing or marketing move could be based on false assumptions. COGS is constantly evolving with supplier rates, packaging updates, regional fees, and order sizes. Applying a flat cost across all orders might seem efficient, but it can quietly erode your margins and lead to costly misjudgments.

That’s where TrueProfit stands out. It calculates your COGS with unmatched granularity. It factors in SKU-level changes, time-based fluctuations, regional differences, and supplier dynamics. From packaging tweaks to seasonal price hikes, every change is captured in real time, with zero manual input.

And because TrueProfit also syncs your ad spend, fees, shipping costs, and refunds, you get a real-time, 360° view of your actual profitability - not just numbers on a spreadsheet.

Don’t let outdated COGS data sabotage your store growth. Try TrueProfit and turn every business decision into a profit-backed move.

TrueProfit Shopify Profit Tracker

Cost of Goods Sold FAQs

How do you calculate cost of goods sold?

COGS = Beginning Inventory + Purchases During the Period – Ending Inventory.

For ecommerce, you’ll also factor in fulfillment, shipping, and product-level costs.

What is included in the cost of goods sold?

COGS includes all direct costs to produce or purchase the products you sell: product cost, packaging, shipping to warehouse/customers, and transaction-level fees like customs or duties.

What does the IRS consider the cost of goods sold?

The IRS defines COGS as the direct costs of producing goods, including materials, labor, and manufacturing overhead. It excludes indirect expenses like marketing or rent.

Where are COGS on an income statement?

COGS appears directly below revenue on your income statement. It’s subtracted from total sales to calculate your gross profit.

How to calculate COGS using a calculator?

Use a COGS calculator by entering your beginning inventory, purchases, and ending inventory. Advanced tools like TrueProfit auto-calculate COGS by SKU in real time for Shopify stores.

What is the formula for COGS available?

COGS Available for Sale = Beginning Inventory + Purchases.

This represents the total cost of inventory that was available to sell during a period.

What do COGS not include?

COGS does not include indirect expenses such as rent, utilities, salaries (unless direct labor), marketing costs, or administrative overhead.

What is the cost of goods sold for dummies?

COGS is the total cost you pay to make or buy the products you sell. If you sell T-shirts, your COGS includes the shirt cost, printing, packaging, and shipping—not your store’s rent or ads.

Is rent included in the cost of goods sold?

No, rent is typically considered an operating expense, not part of COGS—unless it’s rent for a production facility used to manufacture goods.

How do you calculate CoG?

CoG usually refers to Cost of Goods, which is calculated by adding up all the direct costs required to produce or source the item.

What is the formula for total cost of goods sold per unit?

COGS per unit = Total COGS ÷ Number of Units Sold.

This helps you analyze profitability at the SKU level.

What is the formula for COGS in manufacturing?

Manufacturing COGS = Raw Materials + Direct Labor + Manufacturing Overhead – Ending Inventory.

This gives the total cost of producing goods sold during the period.

How do you calculate sold goods?

To calculate goods sold, subtract your ending inventory from the sum of your beginning inventory and purchases. This gives you the volume of goods sold, which feeds into the COGS formula.

Tracy is a senior content executive at TrueProfit – specializing in helping eCommerce businesses scale profitably through content. She has over 4 years of experience in eCommerce and digital marketing editorial writing. She develops high-impact content that helps thousands of Shopify merchants make data-driven, profit-focused decisions.