How to Calculate COGS: Know What Your Products Really Cost

If you sell physical products, cost of goods sold (COGS) is one of those numbers that quietly runs your entire business. Get it wrong and your gross profit lies to you. Get it right and you finally know whether that bestselling SKU is actually making you money after accounting for what it cost to acquire or produce the inventory you sold. The good news? The COGS formula itself is simple. The hard part is making sure the inventory and purchase numbers going into it are accurate. The COGS Formula For a business using the periodic inventory method, cost of goods sold is calculated by taking your beginning inventory, adding purchases and other costs included in inventory, and subtracting your ending inventory. COGS = Beginning Inventory + Purchases − Ending Inventory That’s it. Three numbers, one subtraction. The complexity isn’t in the math. It’s in getting each of those three numbers right and consistently valuing your inventory. Step 1: Find Your Beginning Inventory Beginning inventory is the value of the inventory you had on hand at the start of the period you’re measuring. That period could be a month, quarter, or full year. For example, if you ended last year with $40,000 worth of inventory, that amount generally becomes your beginning inventory for the new year. Your beginning inventory should also match the prior period’s ending inventory. If those numbers don’t line up, something may have changed in your inventory records, valuation, or accounting entries and should be investigated before you calculate COGS. For an e-commerce business, beginning inventory can include products sitting in your own warehouse as well as inventory held at a third-party fulfillment location, depending on who owns the inventory and how it is accounted for. Step 2: Add Purchases and Other Inventory Costs Next, determine the inventory you acquired or produced during the period. For a typical e-commerce seller, this can include This is where Amazon and Shopify sellers often get tripped up. For example, suppose you buy $20,000 of inventory from an overseas supplier and spend another $2,000 on inbound freight and applicable import costs to get those goods ready for sale. Treating all $22,000 appropriately as inventory cost can give you a more accurate picture of what those products actually cost you. By contrast, expenses such as advertising, Shopify subscriptions, general administrative costs, and most selling expenses don’t become part of the product’s inventory cost simply because they helped you sell the product. Step 3: Subtract Ending Inventory Ending inventory is the value of the products you still own at the end of the period. Those goods haven’t been sold yet, so their cost generally remains on the balance sheet as inventory rather than becoming part of COGS for the current period. That’s why ending inventory is subtracted from the formula. This is also where accurate inventory records become critical. If your ending inventory figure is wrong, your COGS figure will be wrong too. A physical inventory count can help verify the quantities you actually have on hand. Businesses with large catalogs may also rely on inventory management and accounting systems, provided those systems are properly maintained and reconciled. A Quick COGS Example Suppose your e-commerce business starts the quarter with: Your COGS would be: $25,000 + $18,000 − $15,000 = $28,000 So your COGS for the quarter is $28,000. If the business generated $60,000 in revenue during the same period: $60,000 − $28,000 = $32,000 gross profit Your gross margin would be approximately 53.3%. That $32,000 gross profit is the amount available to cover operating expenses such as advertising, software, payroll, professional fees, and other costs before arriving at operating or net profit. What Actually Counts as a Purchase? This is where much of the confusion around COGS comes from. “Purchases” in the formula isn’t necessarily limited to the amount printed on your supplier invoice. Depending on your accounting method and the nature of the cost, inventory cost can include other costs directly associated with acquiring or producing goods. For a typical ecommerce seller, inventory cost may include: What generally doesn’t belong in product inventory cost are expenses associated with operating or selling the business, such as: The important distinction is between costs that become part of the inventory and operating or selling expenses incurred to run the business. If you mix those categories, your gross margin can look very different from the economics of the actual products you’re selling. Why Beginning and Ending Inventory Need to Be Accurate A surprising number of small e-commerce sellers estimate inventory value instead of maintaining reliable records, especially as their catalog grows. That’s a problem because COGS is only as accurate as the inventory figures behind it. If ending inventory is overstated, COGS will be understated, which makes gross profit appear higher than it really is. If ending inventory is understated, the opposite happens: COGS is overstated and gross profit appears lower. The solution isn’t complicated, but it does require consistency. Perform regular inventory counts or use reliable inventory software that tracks stock movements as orders, purchases, returns, adjustments, and transfers occur. Then reconcile those records to your accounting system. For Shopify sellers, inventory tools such as Cin7 or Katana can help with inventory tracking, but software is only useful when the underlying transactions and quantities are maintained correctly. COGS vs. Cost of Revenue: What’s the Difference? You’ll sometimes see “cost of revenue” and “cost of goods sold” used interchangeably, especially in financial reporting. For a business that primarily sells physical products, COGS is the more specific term. Cost of revenue can be broader and may include costs associated with delivering products or services, depending on the company’s business model and reporting practices. For example, a business that combines physical products with subscriptions or ongoing services may have a broader cost-of-revenue category than a straightforward e-commerce retailer. If your business primarily buys or manufactures physical products for resale, COGS is the terminology you’ll most commonly encounter in e-commerce bookkeeping and inventory accounting. How to Calculate COGS