Revenue alone does not reveal how much a product actually earned. A seller can generate high sales volume and still lose margin if product costs, damaged stock, returns, and inventory valuations are tracked inaccurately. Tracking how to calculate COGS correctly ensures ecommerce sellers understand the true direct cost behind products sold during any given reporting period.
For marketplace and multichannel sellers, COGS should not be treated as one rough estimate. It should connect product cost, inventory records, completed sales, returns, and SKU-level margin so pricing and replenishment decisions are based on the real cost behind each order.

How to Calculate COGS Correctly
Knowing how to calculate COGS requires a standardized accounting formula:
COGS = Beginning inventory + purchases during the period – ending inventory
Cost of goods sold refers to the carrying value of goods sold during a particular period. For ecommerce sellers, the practical goal is to identify the cost of the items that were actually sold, not the cost of every product purchased or still sitting in stock.
For example, if a seller begins the month with $20,000 in inventory, buys $12,000 more, and ends the month with $15,000 in inventory, the COGS is:
$20,000 + $12,000 – $15,000 = $17,000 COGS
That $17,000 represents the cost assigned to products sold during the period.
Separate Product Cost From Operating Expenses
Before calculating COGS, sellers need to decide which costs belong in product cost and which belong somewhere else. This matters because mixing advertising, software, office expenses, or general labor into COGS can make product margin harder to understand.
COGS should focus on the direct cost tied to products sold. Other costs may still affect net profit, but they should be reviewed separately so the team can see the difference between product cost and operating cost.
Check 1: Include Direct Product Costs
For resellers, direct product cost usually includes the wholesale or supplier cost of the item. For sellers that assemble or manufacture products, it may also include direct materials, production labor, and product preparation costs tied to the unit.
If the product needs supplier packaging or required preparation before it can be sold, that cost may also belong in the product cost record.
Check 2: Keep Selling Costs Separate
Marketplace fees, advertising spend, payment processing, software, customer-service labor, and general overhead should not be automatically mixed into COGS. They still matter, but they belong in a wider profitability review.
A SKU-level COGS and margin review helps sellers compare COGS with revenue, marketplace fees, shipping costs, refunds, ad spend, and net profit instead of treating every cost as the same type of expense.
Use Inventory Records That Match Reality
How to calculate COGS depends heavily on inventory accuracy. If beginning inventory, purchases, adjustments, and ending inventory are wrong, the final COGS number will also be wrong.
The seller should reconcile stock records before using them for pricing, taxes, or channel decisions.
| Inventory record | What to verify | Why it affects COGS |
| Beginning inventory | Opening value at cost | Sets the starting pool of available goods |
| Purchases | Units and cost added during the period | Increases goods available for sale |
| Adjustments | Damage, shrinkage, corrections, or write-offs | Prevents false stock value |
| Ending inventory | Remaining units valued at cost | Identifies unsold inventory retained in stock |
| Returns | Whether items are sellable, damaged, or refunded | Affects sales, stock, and margin review |
Check 3: Confirm Beginning and Ending Inventory
Beginning inventory should match the ending inventory from the prior period. Ending inventory should reflect what remains at cost, not what the items could sell for.
A cost-aware inventory record helps sellers keep stock visibility, movement history, and availability clearer across channels. This is important when the same SKU sells through Amazon, Shopify, Walmart, eBay, or another storefront.
Check 4: Record Damaged and Unsellable Stock
Damaged, missing, expired, or unsellable inventory should not quietly remain in the same pool as sellable stock. If the record says an item is available but the warehouse cannot ship it, both inventory value and operational planning become unreliable.
Document write-offs and adjustments so COGS and remaining inventory do not depend on outdated counts.
Calculate COGS by SKU, Channel, and Period
A single total COGS number is useful for accounting, but it is not enough for ecommerce operations. Sellers should also review COGS by SKU, product group, marketplace, and promotion period.
How to calculate COGS at a more useful level means connecting the cost of sold units with where those sales happened. A marketplace may drive strong revenue but sell lower-margin SKUs. A direct store may sell fewer units but produce stronger contribution after costs.
A sales and SKU performance view helps sellers compare sales activity, order counts, product movement, refunds, and channel results before deciding which products deserve more stock or promotion.
Watch How Returns Affect the Number
Returns can make COGS harder to read. A returned item may be resellable, damaged, incomplete, or written off. A refund may reduce revenue, but the inventory record must also show whether the physical product returned to sellable stock.
Check 5: Match Returns to Inventory Status
Do not treat every return the same way. If the item is inspected and returned to sellable inventory, the stock record should reflect that. If it is damaged or incomplete, the cost may need to be handled differently.
An order and return review process helps teams connect returns, cancellations, refunds, and fulfillment exceptions with the product records behind each sale.
Check 6: Review Refunds Separately From COGS
Refunds reduce sales revenue, but they are not the same as product cost. Sellers should review refunds alongside COGS so they can see whether margin problems come from product cost, return behavior, shipping loss, or channel fees.
This is especially important for products with high return rates, sizing issues, fragile packaging, or unclear listings.
Avoid Common COGS Calculation Mistakes
The first mistake is using selling price instead of cost. Inventory and COGS should be based on what the product cost the business, not what the customer paid.
The second mistake is using purchases alone as COGS. Buying inventory does not mean all of it was sold during the period. Ending inventory must be subtracted so unsold stock remains on the books.
The third mistake is using one blended cost forever. Supplier prices, freight, packaging, damage rates, and purchase quantities can change. Update product costs when new batches arrive or when supplier terms change.
The fourth mistake is comparing channels without cost context. A channel with higher sales may still perform worse if it sells lower-margin products, drives higher returns, or requires more expensive fulfillment.
Use COGS to Improve Pricing and Replenishment
How to calculate COGS matters because the number should lead to better decisions. Sellers can use COGS to set prices, review discounts, compare suppliers, evaluate bundles, and decide which SKUs deserve more inventory.
If COGS rises but prices stay the same, margin shrinks. If COGS is lower on a new supplier batch but return rates increase, the cheaper product may not be better. Review COGS together with returns, customer complaints, sales velocity, and net profit before scaling a product.
Base Pricing and Replenishment on True Product Costs
Mastering how to calculate COGS requires starting with a simple formula: beginning inventory plus purchases minus ending inventory. However, the resulting metric is only as reliable as the underlying product costs, inventory counts, returns, and stock write-offs behind it.
Crazy Vendor unifies inventory tracking, order management, shipping, fulfillment, customer support, sales velocity, and profit analytics-giving ecommerce sellers the centralized data needed to calculate accurate COGS and protect net margins across every channel.








