Cost of goods sold, or COGS, is what it cost you to make or buy the items that customers actually paid for. If you sold 200 mugs this month and each one cost you $6 to produce, your COGS for those mugs is $1,200. It is the first cost you subtract from revenue, and it tells you whether each sale leaves money on the table before rent, ads and software.
It concerns every seller, but in different ways. A brand buying stock from a manufacturer lives and dies by it. A creator selling a $29 ebook has a COGS close to zero, which is exactly why digital products are attractive. Knowing your number, even roughly, is what separates a store that grows from one that gets busier and poorer at the same time.
What is cost of goods sold?
COGS is the sum of the direct costs attached to the units you sold during a period. "Direct" means the cost would not exist if the unit had not been made or bought. "Sold" means you count units that left with a customer, not units sitting on the shelf.
Typical items in COGS for an online store:
- Purchase price of finished goods from a supplier, or raw materials if you make them.
- Inbound freight and import duties to get the goods to you.
- Direct labour for making the product, if you pay someone per unit or per batch.
- Product packaging that is part of the item (the jar, the box it is sold in).
What it is not. Your rent, your website plan, your ad spend and your salary are operating expenses, not COGS. Outbound shipping cost and payment processing fees are a grey area. Accountants often keep them out of COGS, but many ecommerce sellers track them in a "cost per order" line right below COGS, because they scale with every sale. Whatever you choose, be consistent from month to month.
Related vocabulary: "gross profit" (revenue minus COGS), "gross margin" (gross profit as a percentage of revenue), "landed cost" (purchase price plus freight, duties and insurance per unit), and "contribution margin" (what is left after COGS and all variable costs per order).
Why it matters
COGS sets the ceiling on everything else. Every dollar of gross profit has to pay for ads, tools, returns and your own time. If gross margin is thin, no amount of traffic fixes it.
A worked example. A candle brand sells 300 candles a month at $32 each, so revenue is $9,600. Each candle costs $7.50 in wax, wick, fragrance and jar, plus $1.20 in inbound freight per unit. Landed cost is $8.70, so COGS is 300 × $8.70 = $2,610. Gross profit is $9,600 − $2,610 = $6,990, a gross margin of 72.8%.
Now the brand runs a 25% off promotion for a month and sells 420 candles at $24. Revenue is $10,080, up 5%. COGS is 420 × $8.70 = $3,654. Gross profit is $6,426, down $564, even though more candles went out the door. The team was busier, spent more on packing and shipping, and earned less. Without COGS per unit in front of them, the promotion looked like a win.
How to calculate it
There are two ways, depending on how you track stock.
- Per unit (simplest for small stores): COGS = units sold × landed cost per unit. Sum it across products.
- Periodic inventory method: COGS = beginning inventory value + purchases during the period − ending inventory value. This catches shrinkage, breakage and write-offs.
- Landed cost per unit = (supplier invoice + inbound freight + duties + insurance) ÷ units received.
- Gross profit = revenue − COGS.
- Gross margin = gross profit ÷ revenue × 100.
Periodic example. You start March with $4,000 of stock at cost. You buy $2,500 more during the month. On March 31, you count $3,100 of stock left. COGS for March = $4,000 + $2,500 − $3,100 = $3,400. If March revenue was $11,000, gross profit is $7,600 and gross margin is 69%.
For digital products, the calculation is the same but the inputs are different. A $49 online course has no material cost. Its direct costs per sale are the share of hosting or video delivery, any per-sale licence fee for a font or music track, and the payment processor fee if you choose to count it. That might total $2.10 per sale, for a gross margin of about 96%. The production cost of the course (filming, editing) is usually treated as an upfront investment, not as COGS per unit.
Benchmarks and examples
Gross margins vary a lot by category. These ranges are typical for small direct-to-consumer sellers.
- Digital products and courses: 85% to 97% gross margin.
- Cosmetics, candles, supplements made in-house: 60% to 80%.
- Apparel and merch: 45% to 65% with bulk production, 25% to 45% with print-on-demand.
- Electronics and accessories bought wholesale: 20% to 40%.
- Dropshipping: 15% to 35% after supplier price and supplier shipping.
A creator selling a $35 print-on-demand T-shirt might pay $14 for the shirt and printing and $5 for supplier shipping. COGS of $19 gives a 46% gross margin. The same creator selling a $15 preset pack has COGS of maybe $0.75 in processing fees and a 95% margin. That gap explains why so many creators add a digital product next to their merch.
Common mistakes
- Using the supplier price alone. Freight, duties and packaging often add 10% to 25% to the unit cost. Use landed cost.
- Counting purchases instead of sales. Buying $5,000 of stock in one month is not $5,000 of COGS. Only what sold counts.
- Forgetting shrinkage. Broken, lost and gifted units are real costs. A periodic count catches them.
- Mixing one-off costs into unit cost. A $600 mould or a $2,000 course shoot is an investment. Spreading it over the first 100 units makes early margins look awful and later ones look inflated.
- Never updating costs. Supplier prices rise. A landed cost from two years ago can overstate your margin by several points.
How to improve it
- Negotiate by volume, carefully. Ordering 500 units instead of 200 may cut unit cost by 15%, but only if you sell them before cash runs out. Weigh it against inventory holding costs.
- Consolidate inbound freight. Fewer, larger shipments from suppliers lower freight per unit.
- Redesign packaging. A lighter jar or a flat-pack box can cut both product cost and shipping cost.
- Raise prices before cutting quality. A $2 price increase on a $30 product lifts gross margin more than most supplier negotiations.
- Push higher-margin items. Bundle a digital guide with a physical product, or feature best-margin variants first on the product page.
- Watch discounts as a COGS problem. Every discount comes out of gross profit, not revenue in the abstract. Check margin after discount before launching a discount code.
In Roctify
Roctify keeps the product data you need to reason about COGS in one shared catalog: each product, variant and SKU has its own price and stock, and the same record is used by your storefront and your link-in-bio page. When you know the landed cost of a variant, comparing it with the selling price tells you its margin at a glance, and stock movements show what actually sold.
Roctify charges 0% transaction fees on every plan, including the free one. Only the payment provider's processing fee applies, so there is no extra platform percentage eating into your gross profit. On the Pro plan, reports and exports let you pull orders by product into a spreadsheet and multiply units sold by your landed cost to get COGS and gross margin for the month.
FAQ
Is shipping part of COGS?
Inbound freight, the cost of getting stock to you, is part of landed cost and belongs in COGS. Outbound shipping to customers is often recorded separately as a selling or fulfillment expense. What matters most is that you track both and apply the same rule every month.
Do digital products have a cost of goods sold?
Yes, but it is small. Direct per-sale costs like delivery bandwidth, licences paid per sale and, if you include them, payment fees usually add up to a few percent of the price. The cost of creating the product is generally treated as an upfront investment rather than per-unit COGS.
What gross margin should an online store aim for?
It depends on the category, but most small online stores need at least 50% gross margin to pay for ads, shipping subsidies and tools and still make a profit. Below 30%, paid acquisition becomes very hard to make work. Digital products routinely clear 85%.