Blog

Profit Margin Calculation for Shopify: Step-by-Step Guide

Profit Margin Calculation for Shopify: Step-by-Step Guide

Periwinkle blue calculator sticker with a small stack of coins beside it

Jesús Avendaño

·

Your Shopify dashboard says sales are up. Your bank balance says otherwise. A bestseller looks healthy at a 60% gross margin, but once you subtract the shipping you absorbed, payment fees, Meta spend, and last month's returns, each order may be barely covering its costs.

That's not a sales problem. It's a profit margin calculation problem, and it's usually caused by using one margin to answer every question. The number that tells you whether your pricing works won't tell you whether the next ad campaign pays, and neither will tell you what you keep at month end. You need four margins, each matched to a decision, and you need them calculated on the same clean revenue figure every time.

Profit Margin Formulas and What Each One Answers

Every version uses the same structure, profit divided by net revenue, multiplied by 100. What changes is which costs you've subtracted before you divide. The U.S. Securities and Exchange Commission guide to financial statements explains that gross profit is called "gross" because some expenses have not yet been deducted, while operating profit is reached after operating expenses are removed.

Profit Margin Formulas and the Decision Each Answers

Margin

Formula

Costs included

Decision it answers

Gross margin

(Net revenue − COGS) ÷ net revenue × 100

Product cost only

Are my pricing and sourcing sound?

Contribution margin

(Net revenue − variable costs) ÷ net revenue × 100

COGS, shipping, payment and platform fees, ad spend, expected returns

Does each extra order make money?

Operating margin

Operating income ÷ revenue × 100

Contribution costs plus fixed overhead such as payroll, software and rent

Is the operating model efficient?

Net margin

Net profit ÷ revenue × 100

All costs, plus interest and income taxes

How much do I keep from each dollar?

Say a store records $1,000,000 in net sales and $600,000 in product costs. Gross profit is $400,000, a 40% gross margin. Subtract $250,000 of operating expenses and operating profit falls to $150,000, or 15%. After $50,000 of interest and taxes, net profit is $100,000, a 10% net margin.

Nothing changed except the costs you chose to include. That's why a store can show a 60% gross margin on a product page and still keep only 15% after ads and fees. Both numbers can be correct. They're answering different questions.

Practical rule: Pick the margin that matches the decision in front of you, then open the spreadsheet.

Use gross margin for pricing and sourcing calls. Use contribution margin before you scale a campaign, run a discount, or add free shipping, because it's the only one that reflects what the next order costs you. Use operating margin to judge whether payroll, software, and rent fit the model, and net margin for the final share of each dollar you keep.

In every version, start from net revenue after discounts and refunds. If that denominator is inflated, every margin built on it is inflated too.

Which Costs Belong in Each Margin

Shipping and fees are the rows merchants miss most. They don't belong in gross margin, so they get forgotten entirely, even though they rise with every single order and belong squarely in contribution margin. You can estimate the platform side quickly with a Shopify fee calculator before you rebuild your whole spreadsheet.

Where Each Cost Belongs in the Margin Calculation

Cost

Gross margin

Contribution margin

Net margin

Product cost (COGS)

Yes

Yes

Yes

Shipping the store pays

No

Yes

Yes

Payment processing and Shopify plan fees

No

Yes

Yes

Ad spend from Meta and Google

No

Yes, when attributable

Yes

Expected return and refund losses

No

Yes

Yes

Discounts and refunds

Reduce net revenue

Reduce net revenue

Reduce net revenue

Payroll, software, rent and warehouse overhead

No

No

Yes

Interest and income taxes

No

No

Yes

Product cost is the only line that hits every margin, because you can't sell what you didn't buy or make. Ad spend is trickier. Put it in contribution margin when you can credibly tie it to a sale, a campaign, or a product. If attribution is shaky, keep it at store level for the month rather than forcing it onto individual orders and pretending the allocation is precise. Either way, it always lands in net margin.

Expected returns reduce contribution because a return isn't just lost revenue. It's reverse shipping, inspection, repackaging, and sometimes a product you can't resell at full price. Discounts and refunds work differently. They aren't a cost line at all. They shrink net revenue before any margin is calculated.

The Xero guide to profit margin follows the same sequence, from revenue down through COGS, then operating expenses, then interest and taxes. I'd also keep a metric dictionary that records whether each cost is COGS, a variable selling expense, an operating expense, or a below-the-line item. Build it before you compare products or campaigns, because inconsistent mapping is what makes one month look better than the last when nothing improved.

Two guards keep the numbers honest. First, keep the same period for profit and revenue. Monthly profit divided by annual revenue gives you a percentage with no meaning. Second, run this test on any cost you're unsure about.

If the cost grows with each order, it belongs in contribution. If you'd still pay it in a month with zero sales, it's fixed overhead.

How to Calculate Gross Margin Step by Step

Gross margin is the starting layer, and it's worth doing cleanly because every other margin builds on it. The Corporate Finance Institute profit margin guide defines it as (revenue − COGS) ÷ revenue × 100, the share of revenue left after direct production or purchasing costs.

The Six Steps

  1. Pull net revenue for the period. Start with gross sales, then subtract discounts, refunds, and cancelled orders. Using gross sales here is the most common slip, and it inflates the margin before you've done any real math.

  2. Total COGS for units sold. Count the product cost of what customers bought, not what you purchased from your supplier. During a big restock month, units bought can be double units sold, and your margin will look artificially terrible.

  3. Subtract COGS from net revenue. That difference is gross profit, the dollars available to cover everything else.

  4. Divide gross profit by net revenue. This gives you a decimal that works across products of very different prices.

  5. Multiply by 100. Now you've got the percentage you can compare month to month.

  6. Confirm both figures cover the same dates. Revenue from one period against COGS from another is a quiet way to manufacture a trend that doesn't exist.

A Worked Example With 100 Units

Say 100 units sell for $25 each, so net revenue is $2,500. Product cost is $10 per unit, so COGS is $1,000. Gross profit is $1,500, and gross margin is 60%.

Read that as dollars, not just a percentage. You're keeping $0.60 from each sales dollar before payroll, rent, software, shipping, fees, or ads. A smaller check works the same way. With $1,000 in sales and $600 in COGS, gross profit is $400 and gross margin is 40%, or $0.40 per dollar.

Now repeat the calculation per product, not just for the store. A blended 55% can hide a hero SKU at 70% carrying a weak one at 25% that you're still sending ad traffic to. I'd sort products by revenue, calculate gross margin for the top ten, and look hard at anything where a recent discount or supplier price rise has eaten the cushion.

Gross margin earns its keep on pricing, sourcing, discounts, and product mix. It doesn't tell you whether the business made money, because it deliberately leaves out the costs of getting and fulfilling the order. That's the next layer down, and it's where most of the leakage hides.

One Store's Path From Revenue to Net Margin

A single percentage rarely tells you where to act. A waterfall does. It shows each cost taking its bite in order, so you can see which gap is pricing, which is acquisition, and which is overhead.

Say a store ends the month with $100,000 in net revenue after discounts and refunds. The table below traces that revenue down through each cost stage to net profit.

Illustrative Store Waterfall From Net Revenue to Net Margin

Line item

Amount

Share of net revenue

Net revenue after discounts and refunds

$100,000

100%

Cost of goods sold

$32,000

32%

Gross profit

$68,000

68%

Shipping paid by the store

$9,000

9%

Payment and Shopify fees

$3,000

3%

Ad spend

$22,000

22%

Contribution margin

$34,000

34%

Payroll, software and rent

$18,000

18%

Operating income

$16,000

16%

Interest and income taxes

$1,000

1%

Net profit

$15,000

15%

Start at the top. $32,000 of COGS leaves $68,000 of gross profit, a 68% gross margin that looks comfortable. Pricing and sourcing aren't the problem here.

Then the order-level costs arrive. $9,000 of shipping and $3,000 of fees take 12 points. $22,000 of ad spend takes 22 more. Contribution lands at $34,000, or 34%. That 34-point drop from gross to contribution is the story of this store, and ad spend is more than half of it. If you're tracking the endpoint, our net profit metric definition sets out what belongs above that final line.

The largest gap in the waterfall is your first fix. Here it's campaign level, not a price change.

Raising prices to fix an acquisition problem usually costs you conversion without fixing the inefficient campaign. The better first move is to split that $22,000 by campaign and product, find where contribution per order goes negative, and cut or restructure there. Below contribution, $18,000 of payroll, software, and rent leaves $16,000 of operating income, or 16%. After $1,000 of interest and taxes, net profit is $15,000, a 15% net margin, or $0.15 kept from each dollar.

How That 34% Compares

Context helps, as long as you don't turn it into a target. The ecomcfo ecommerce benchmark reports median 2025 contribution margins of 29.7% for brands below $10 million in revenue, 27.3% for brands between $10 million and $50 million, and 13.0% for brands above $50 million, all after advertising, merchant fees, fulfillment, and returns.

Two things stand out. First, this store's 34% sits above those medians, which suggests its order economics are comparatively sound. Second, the largest brands show the lowest median, which is a useful warning that scale doesn't automatically improve contribution. Acquisition, fulfillment complexity, and reverse logistics can absorb more revenue as you grow, even when your purchasing power improves.

Don't overread it, though. A store above the median can still lose money on one product line, one discount code, or one campaign, because a benchmark is a blended average and your losses live in the segments. Build this same waterfall for your last full month using actuals, then rebuild it for your top products and your biggest campaign. Where the drop is steepest is where you work first.

Break-Even and Maximum CAC From Contribution Margin

A $60 order with $36 in variable costs contributes $24 before fixed costs and advertising. That's a 40% contribution margin, calculated as (selling price − variable cost per unit) ÷ selling price. The $36 includes product cost, payment processing, per-order fulfillment, the shipping subsidy, and expected return losses.

Now include all monthly fixed costs, including manufacturing and facility allocations. With $24,000 in fixed costs, break-even revenue is $24,000 ÷ 0.40 = $60,000. At a $60 average order value, that means 1,000 orders to cover variable and fixed costs. The U.S. Small Business Administration's break-even guidance covers the same analysis for finding the point where sales cover total costs.

Turning 40% Into a Spending Limit

Break-even ROAS is 1 ÷ contribution margin ratio. At 40%, that's 2.5, or $2.50 in revenue for every $1 of ad spend to cover variable costs and advertising. A campaign with a 2.0 ROAS falls short. This threshold covers the campaign's order economics, not the store's fixed costs; the store still needs enough total contribution to cover those.

Maximum first-order CAC is $24 in this example, the contribution from one order before advertising. Spending more means the first purchase loses money before it contributes to fixed costs. A higher CAC only makes sense if measured repeat purchases generate enough additional contribution. Use the contribution margin formula and inputs to check which costs belong in the order calculation.

For promotions, subtract the discount from the order's contribution. A $10 discount reduces the $24 contribution to $14, still available toward fixed costs. A $30 discount exceeds the original contribution, so the order loses money before fixed costs. Recalculate contribution by SKU, channel, and customer type when product mix shifts; a blended 40% based on last quarter's mix may not fit this month's orders.

Overstated Margins and How to Avoid Them

A product sells for $30 and costs $20 to produce. Plenty of merchants call that a 50% margin. It isn't. The Shopify guide to free shipping and conversion gives this exact case, a 33.33% gross margin, because margin divides profit by selling price. The 50% figure is markup, which divides profit by cost.

That one mix-up overstates profitability by nearly 17 points, and it's only the first of five.

Five Mistakes and a Check for Each

  • Markup confused with margin: Take your top product this week, calculate both numbers, and confirm your reports use profit divided by price. If your spreadsheet divides by cost, every margin in it is wrong.

  • List price used as revenue: Compare gross sales with net revenue for last month. The gap is discounts, refunds, and cancellations, and it's margin you never had. Always calculate from net revenue.

  • Order costs left out: List shipping, packaging, payment processing, platform fees, duties, storage, and returns, then check each one appears somewhere in your metric dictionary. Shopify's guidance also advises including store, warehouse, and marketing expenses when you assess free-shipping economics, because free shipping is only free to the customer.

  • Return timing ignored: Record an expected return reserve at order time using your historical return rate for that product, then reconcile the estimate against actual returns each month. Reporting both a realized margin and an order-level expected margin stops a high-return product from looking profitable for six weeks and then collapsing.

  • Blended averages hiding losers: Split last month's margin by product, discount code, and channel, then look at the bottom five lines. A healthy store average routinely conceals SKUs and campaigns that lose money on every order.

If a margin looks surprisingly good, assume a cost is missing before you assume you've improved.

Cross-border sellers are the most exposed, because duties, currency effects, and expensive reverse logistics sit outside product cost. Subscription brands face a timing version of the same trap, since acquisition cost lands upfront while revenue arrives over months. Products with uneven return behavior, such as sized apparel, can swing a monthly figure on their own.

None of these fixes need new software. They need a revenue figure that's net, a cost list that's complete, a reserve for returns you know are coming, and segments small enough that a loser can't hide inside an average.

Set Up a Monthly Margin Check in Your Store

A calculation you run once changes nothing. Run it on the same day each month, with the same definitions, and it becomes an early warning system for supplier price rises, discount creep, and campaigns drifting below break-even.

The Monthly Checklist

  1. Confirm cost per variant is set for every product. Enter it manually or import it from a spreadsheet, and treat any variant with a blank or stale cost as a data error, not a 100% margin. Once those costs are in place, Cifra calculates the margin on every product sold.

  2. Check that the order-level costs are switched on. Confirm shipping, payment and platform fees, and Meta and Google ad spend are all included in the calculation. One disconnected ad account inflates contribution for the whole month.

  3. Compare gross and contribution margin for your top 10 products by revenue. A wide gap between the two points to acquisition or fulfillment cost. A narrow gross margin points back to pricing or sourcing. They need different fixes.

  4. Review margin by discount code. Flag any code that pushes contribution below break-even, including codes you created for influencers or abandoned-cart flows and then forgot about. Retire or reduce those first.

  5. Save the report so next month is one click. Same layout, same definitions, same period length. Consistency is what turns a snapshot into a trend you can trust.

Before the full setup is in place, Cifra's profit margin calculator gives you a quick check on the numbers using monthly revenue and costs. Its profit view shows net profit after cost of goods, ad spend, shipping and fees, with the drivers behind the number, so you can see whether a margin change came from product cost, fees, or acquisition rather than guessing.

I'd keep the routine deliberately short. You're looking for three things: a cost that went missing, a product whose margin moved, and a code or campaign that's now below break-even. Write down one action for each, with an owner, and check next month whether it worked.

Run the calculation for your last full month this week. Then act first on the lowest-margin product in your top ten, because that's where a price change, a supplier conversation, or a paused campaign will recover the most money for the least effort.

Stop judging growth on revenue and a gross margin that leaves out the costs of getting the order. Cifra brings your Shopify sales, product costs, shipping, fees, and Meta and Google ad spend into one profit view, so you can see contribution and net margin by product, campaign, and discount code and act on the lines that are losing money.

Jesús Avendaño

·