A COGS calculator adds your beginning inventory and new purchases, then subtracts your ending inventory, so the result is only the cost of the stock you actually sold. The formula is Beginning Inventory + Purchases − Ending Inventory. That answers "what did my sold goods cost," but it stops one step short of what you really want: profit per order. This guide walks the formula, a worked example, and the profit chain most COGS calculators skip.
What a COGS calculator actually does
Cost of goods sold (COGS) is the direct cost of the products you sold in a period. It counts what you spent to make or buy the items that left your shelves, and nothing else.
Most free tools online run the same accounting formula. You enter three numbers and they return one. The math is simple, but the value comes from knowing which costs belong inside it.
The standard formula is COGS = Beginning Inventory + Purchases − Ending Inventory. Beginning inventory is the value of stock you started with, purchases are what you bought during the period, and ending inventory is what is left unsold at the end.
The two COGS formulas most calculators only show one of
There are really two ways to calculate COGS, and the popular calculators only surface the first one.
1. The period formula (accounting view)
This is the one you file with. Say you started a month with $10,000 of inventory, bought $25,000 more, and ended with $8,000 still on the shelf. Your COGS is $10,000 + $25,000 − $8,000 = $27,000.
This view is perfect for a tax return or a profit-and-loss statement. It tells you the total cost of everything sold across the whole period.
2. The per-unit formula (decision view)
To price a product or judge a single order, you need cost per unit, not a monthly total. Here COGS is the sum of the direct costs baked into one item: Per-unit COGS = materials + direct labor + per-item production or fulfillment cost.
Say you run a print-on-demand shirt store. One order is a $6.00 blank garment, a $4.00 print charge, and $6.00 of base fulfillment built into the supplier's item price. That is $16.00 of COGS on a shirt you sell for $40.00.
The per-unit view is the one that drives real decisions. It feeds every margin and pricing question you will ever ask.
What counts as COGS (and what quietly doesn't)
The most common COGS mistake is scope. Put too much in and your margins look terrible; leave too much out and you think you are more profitable than you are.
Costs that belong in COGS are the ones that scale directly with each unit sold: raw materials, the blank product, direct production labor, and per-item printing or manufacturing fees. If you make one more unit, these go up.
Costs that do not belong in COGS include rent, salaried staff, software subscriptions, and advertising. These are operating or fixed costs, and folding them into COGS distorts your gross margin.
One gray area trips up print-on-demand and dropshipping sellers: shipping and payment fees. A supplier's flat print fee can sit in COGS or in fulfillment, but pick one and hold it, or your margin will drift every month. For the full map of how these buckets connect, see our ecommerce metrics guide.
A worked example: from COGS to real profit
Here is where a plain COGS calculator leaves money on the table. Knowing your COGS is $16 on a $40 order is only the first line of the story.
Start with gross margin. Gross profit is $40 − $16 = $24, so your gross margin is $24 ÷ $40 = 60%. That is the number the calculators stop at.
But you have not sold anything for free. Carrier shipping costs $5.00. Payment processing at Stripe's standard 2.9% plus 30 cents per transaction works out to about $1.60 on a $40 order. Pick-and-pack labor is another $1.40.
Subtract those variable costs and you get contribution margin before ads: $24 − $5 − $1.60 − $1.40 = $16.00, or a 40% margin. This number, not gross margin, tells you what each order really contributes. The full method lives in our contribution margin formula breakdown.
Now add ad spend. Say you spend $10.00 in ads to win that order. Your contribution margin after ads is $16 − $10 = $6.00 — a 15% margin. That $6, not the $24 gross profit, is what actually lands in your pocket per order.
The metric a COGS calculator can't give you: break-even ROAS
Once you know your true margin, COGS unlocks the single most useful number in paid media: the return on ad spend you must clear just to break even.
Break-even ROAS is 1 ÷ your contribution-margin ratio. On the 40% margin above, that is 1 ÷ 0.40 = 2.5. Any campaign below a 2.5 ROAS is losing money, no matter how good the revenue looks.
Notice how COGS drives this. If your blanks got $4 more expensive, your margin ratio would fall and your break-even ROAS would rise, meaning you would need more efficient ads just to stay level. See how the ratio behaves in our ROAS formula explainer, and if rising ad costs are the culprit, our ad frequency calculator shows when audience fatigue is quietly pushing your COGS-to-profit gap wider.
This is the chain no standalone COGS calculator connects: COGS sets margin, margin sets break-even ROAS, and break-even ROAS decides whether your ads are building the business or draining it.
Why manual COGS math breaks at scale
Calculating COGS for one order on a whiteboard is easy. Doing it live, across hundreds of orders with different products, ad costs, shipping zones, and fees, is where spreadsheets fall apart.
The trouble is that the pieces live in different places. Your product cost is in your supplier, your fees are in Stripe, your ad spend is in Meta and Google, and your orders are in Shopify. Stitching them into a true per-order number by hand is slow and error-prone. A leak in checkout only makes it worse, which is why watching your checkout conversion rate matters alongside cost.
This is the gap PodVector closes. It connects Shopify, Meta Ads, Google Ads, Printify, and Printful, then computes true per-order profit automatically, pulling your real COGS, fees, shipping, and ad spend into one honest number.
PodVector is not a dashboard you have to read. Victor, its AI employee, analyzes your live data and proposes moves, and with your approval he acts on the Shopify side to protect your margin. Victor does not touch your ad account; he reads the ad data and tells you what it means for profit. If you are tired of guessing at your real cost per order, start with PodVector free.
FAQs
What is the COGS formula?
The standard period formula is Beginning Inventory + Purchases − Ending Inventory. For pricing a single product, use the per-unit version instead: the sum of materials, direct labor, and per-item production or fulfillment costs for one unit.
Does COGS include shipping and payment fees?
It depends on how you scope it. Direct production costs always belong in COGS, while outbound shipping and payment fees are usually treated as separate variable costs in your contribution margin. The key rule is to pick one treatment and apply it consistently every period.
Are advertising and salaries part of COGS?
No. Advertising, salaried staff, rent, and software are operating or fixed costs, not COGS. Folding them in makes your gross margin look artificially low and hides which products are actually profitable to make.
How is COGS different from gross profit?
COGS is the cost side; gross profit is what's left after you subtract it from revenue. On a $40 order with $16 of COGS, gross profit is $24. Gross margin expresses that as a percentage: $24 ÷ $40 = 60%.
Why isn't COGS enough to know if I'm profitable?
Because COGS only covers product cost. Shipping, payment fees, fulfillment labor, and ad spend all come out after COGS, and together they can turn a healthy-looking 60% gross margin into a 15% margin per order. True per-order profit needs the whole chain, not just the first subtraction.
What is a good COGS percentage?
There is no universal target; it varies widely by category and business model. Instead of chasing a benchmark, track your COGS as a share of revenue over time and watch your contribution margin and break-even ROAS, since those tell you whether your cost structure actually supports profitable growth.