Gross Margin Formula for Ecommerce: How to Calculate It After Every Channel Fee

Of every dollar of gross profit a typical US general retailer makes, about 83 cents is gone before the owners see any of it. NYU Stern professor Aswath Damodaran's margin data by industry sector (January 2026) puts general retail at a 33.18% gross margin and a 5.61% net margin. Specialty retail runs 35.30% gross and 5.19% net. Rent, staff, software, interest and tax eat the rest.
Gross margin is the share of each sale you keep after paying for the product itself. The formula is (net revenue − cost of goods sold) ÷ net revenue × 100. Cost of goods sold, or COGS, is what it cost you to buy the product and get it into your warehouse. For a product that sells for $40 and costs $12.60 to land, that's ($40 − $12.60) ÷ $40 = 68.5%. The SEC's beginner's guide to financial statements defines it the same way: gross profit, or gross margin, is what's left after you subtract the cost of sales from net revenue.
If you sell on several channels, that 68.5% is identical everywhere, but the money you keep is not. Once marketplace commissions, card processing and shipping come out, the same $40 sale leaves you anywhere from $13.50 to $18.04. This guide shows you how to calculate gross margin, then how to build a channel-adjusted version that tells you where each product earns the most, with one product worked through Shopify, Amazon, Walmart and eBay.
What's in this guide
- The gross margin formula, line by line
- Gross vs contribution vs net margin
- Where marketplace fees sit (and why it matters)
- The channel fees that belong in the calculation
- Worked example: one $40 SKU on four channels
- From gross to contribution: the ranking flips
- Net profit margin: the number that pays you
- Six mistakes that inflate ecommerce margins
- How to build a channel-adjusted margin sheet
- What to do this week
The gross margin formula, line by line
You will see it written two ways, and they are the same calculation. In plain English: take what the product cost you away from what you sold it for, then show what's left as a share of the sale.
Gross profit = Net revenue − Cost of goods sold (COGS) Gross margin (%) = Gross profit ÷ Net revenue × 100 Example: Net revenue = $40.00 COGS (landed) = $12.60 Gross profit = $27.40 Gross margin = 27.40 ÷ 40.00 = 68.5%
"Gross margin" and "gross profit margin" mean the same percentage. The formula is simple; the arguments are about what goes into each line.
What counts as net revenue
Net revenue is what customers paid for the product after refunds, discounts and allowances (credits you give a buyer, such as a partial refund for a scuffed box). For an ecommerce seller that means:
- Include: item price, shipping charged to the buyer, gift-wrap or handling fees you collect.
- Subtract: refunds on returned orders, discount codes, promotional credits you fund.
- Exclude: sales tax. You collect it for the state (or the marketplace collects it and pays the state); it was never your revenue.
If you give away shipping, the shipping line is zero and the label shows up as a cost instead. That's why "free shipping" SKUs (a SKU is one product you track on its own, like a 12 oz candle in one scent) often look better on a product-only gross margin than they are.
What counts as cost of goods sold
COGS is what it cost to get the product sitting on your shelf, ready to sell. The IRS's Publication 334 section on cost of goods sold calculates it as beginning inventory plus purchases, minus ending inventory, and lists freight-in (the cost of shipping stock to you) and containers among the costs that belong in inventory. For a typical brand buying finished goods, that means:
- Unit purchase price from the supplier
- Inbound freight to your warehouse or 3PL (an outside warehouse that stores and ships for you)
- Import duties, tariffs and the customs broker's fee for clearing goods
- Product packaging that ships with the item (the retail box, not the shipping carton)
If you import, the duty and freight lines can move your COGS by more than any fee change. Together with the purchase price, they make up landed cost: the full cost of a unit sitting in your warehouse. Our guide to calculating landed cost for imported goods walks through each component, and the full COGS calculation guide for ecommerce covers the inventory method side.
Gross margin is not markup
Markup divides gross profit by cost; margin divides it by price. On our example SKU, $27.40 ÷ $12.60 is a 217% markup, but the gross margin is 68.5%. Pricing off "a 60% margin" when you meant a 60% markup leaves you at about a 37.5% margin (a $12.60 cost marked up 60% sells for $20.16), which is a very different business.
Gross vs contribution vs net margin
Most margin confusion comes from people quoting different layers of the same income statement, the report that runs from sales at the top to profit at the bottom. These are the layers that matter, from the top down:
| Margin | Formula | What it subtracts | What it answers |
|---|---|---|---|
| Gross margin | (Revenue − COGS) ÷ Revenue | Product cost, freight-in, duties | Is the product priced well against what it costs to buy? |
| Channel-adjusted gross margin | (Revenue − COGS − channel fees − fulfillment) ÷ Revenue | Adds referral or payment fees, pick-and-pack, outbound label | Which channel keeps the most per order before marketing? |
| Contribution margin | (Channel-adjusted gross profit − ads − returns) ÷ Revenue | Adds advertising and a returns allowance per order | Does each extra order add money to cover overhead? |
| Net profit margin | Net income ÷ Revenue | Everything: software, salaries, rent, interest, taxes | Does the business make money at all? |
The retail figures at the top of this guide show how far apart the layers sit. A 33.18% gross margin becoming a 5.61% net margin means most of the gross profit pays for running the business.
That gap is why a 60% gross margin is not a reason to relax. It's the starting pool that every fee, label, ad and salary is paid from.
Where marketplace fees sit (and why it matters)
Accounting doesn't give you one fixed line for channel costs. Each company sets a policy and discloses it, and the choice changes the gross margin you report.
Amazon is a useful example because its policy is spelled out in the Amazon 2025 annual report (Form 10-K). Its cost of sales "primarily consists of the purchase price of consumer products, inbound and outbound shipping costs." Payment processing, by contrast, sits in "Fulfillment," an operating expense line (a running cost of the business rather than a cost of the product), alongside the cost of running fulfillment centers. Two companies with identical economics can report different gross margins depending on whether shipping and processing land above or below the gross profit line.
For a seller, this leads to one practical rule: keep two gross margins.
- Accounting gross margin follows whatever policy your accountant uses for your tax return and financial statements. Keep it consistent from year to year.
- Channel-adjusted gross margin is a management number. It subtracts every per-order cost a channel imposes, so you can compare Shopify, Amazon, Walmart and eBay on the same basis.
The first keeps your books clean. The second is the one you set prices and choose channels with.
The channel fees that belong in the calculation
These are the per-order fees for a home and kitchen item on each channel, as published by the platforms in September 2026. Check the linked pages before you rely on them, because fee schedules change.
| Channel | Per-order fee | Fixed fee | Source |
|---|---|---|---|
| Shopify (own store) | Card processing: 2.5% to 2.9% + 30¢ online, depending on plan | Monthly plan fee | Shopify's 2026 guide to card processing fees |
| Amazon (Professional, seller-fulfilled) | 15% referral fee (Amazon's commission on each sale) for Home and Kitchen, $0.30 minimum | $39.99/month | Amazon's seller pricing and referral fee page |
| Walmart Marketplace | 15% referral fee for Home, Kitchen, Decor and Garden | None | Walmart Marketplace's pricing page |
| eBay (no store) | 13.6% of the total sale + $0.40 per order over $10 | None without a store | eBay's selling fees help page |
Two details that change the math. First, eBay defines the total amount of the sale as the item price, handling, shipping charged to the buyer and sales tax, so you pay a percentage on tax you never keep. Second, eBay's help page says you don't pay separate third-party payment processing fees there, while on your own Shopify store the card fee is the main per-order platform cost.
For a side-by-side of how these fees stack across more channels and categories, see our 2026 marketplace fee comparison for Amazon, eBay, Walmart and Shopify.
Worked example: one $40 SKU on four channels
Example: say you sell a ceramic pour-over coffee set in the home and kitchen category. The numbers below are hypothetical but realistic; swap in your own.
- Price: $40.00, free shipping on every channel
- COGS: $11.00 unit cost + $1.60 inbound freight and duty = $12.60 landed
- Fulfillment: you ship it yourself. $1.50 pick, pack and carton + $6.40 ground label = $7.90
- Channels: Shopify Basic with Shopify Payments (2.9% + 30¢, the top of Shopify's published range), Amazon Professional seller-fulfilled, Walmart Marketplace, eBay without a store
- Buyer: in a state with no sales tax, to keep the first pass clean
In plain English: start from the same gross profit on every channel, then take off each channel's fee and the cost of shipping the order.
SHOPIFY AMAZON WALMART EBAY Revenue 40.00 40.00 40.00 40.00 COGS (landed) -12.60 -12.60 -12.60 -12.60 = Gross profit 27.40 27.40 27.40 27.40 Gross margin 68.5% 68.5% 68.5% 68.5% Channel fee -1.46 -6.00 -6.00 -5.84 (2.9% x 40 + 0.30 | 15% x 40 | 15% x 40 | 13.6% x 40 + 0.40) Fulfillment -7.90 -7.90 -7.90 -7.90 = Channel-adj. GP 18.04 13.50 13.50 13.66 Channel-adj. margin 45.1% 33.8% 33.8% 34.2%
Same product, same price, same 68.5% gross margin. Once channel fees and fulfillment come out, Shopify keeps $4.54 more per order than Amazon or Walmart, and the marketplace orders keep about a third of the sale price.
| Channel | Channel fee | Channel-adjusted gross profit | Channel-adjusted margin | Drop from 68.5% |
|---|---|---|---|---|
| Shopify | $1.46 | $18.04 | 45.1% | −23.4 pts |
| Amazon | $6.00 | $13.50 | 33.8% | −34.7 pts |
| Walmart | $6.00 | $13.50 | 33.8% | −34.7 pts |
| eBay | $5.84 | $13.66 | 34.2% | −34.3 pts |
Variant: the buyer pays 8% sales tax on eBay
Now move the eBay buyer to a state with 8% sales tax. The order total becomes $43.20, and because eBay charges its fee on the full total, the final value fee becomes 13.6% × $43.20 = $5.88, plus $0.40, for $6.28. That's $0.44 more in fees on tax you pass straight through. Channel-adjusted gross profit falls to $13.22, or 33.1% of your $40 revenue. On 1,000 orders a month, tax-inclusive fees are worth about $440.
Variant: Amazon FBA instead of self-fulfilled
If you use Fulfillment by Amazon, replace the $7.90 fulfillment line with Amazon's FBA fulfillment fee for the item's size tier (Amazon's size-and-weight band) and price band, then add inbound shipping to Amazon and monthly storage per unit. The referral fee stays the same. Our breakdown of 2026 FBA fulfillment fees lists the tiers you'll need. Whether FBA helps or hurts margin depends on your label cost, not on the headline fee.
From gross to contribution: the ranking flips
Channel-adjusted gross margin still leaves out two costs that vary by channel: advertising and returns. Subtract them and you get contribution margin, the money each order adds toward overhead.
Returns are not a rounding error. The National Retail Federation's 2025 retail returns report estimated that 19.3% of online sales would be returned in 2025, against 15.8% across all retail. Your rate by category and channel will differ, which is why you should use your own data and not an average.
Continuing the example, assume:
- Ads per order: Shopify $8.00 (social media ads to drive traffic to your own store), Amazon $3.20 (Amazon search ads costing 8% of sales), Walmart $1.60, eBay $1.60 (a 4% promoted listing rate)
- Returns allowance: 6% return rate × $15 average loss per return = $0.90 per order, the same on every channel for simplicity
| Channel | Channel-adjusted gross profit | Ads | Returns | Contribution | Contribution margin |
|---|---|---|---|---|---|
| Shopify | $18.04 | −$8.00 | −$0.90 | $9.14 | 22.9% |
| Amazon | $13.50 | −$3.20 | −$0.90 | $9.40 | 23.5% |
| Walmart | $13.50 | −$1.60 | −$0.90 | $11.00 | 27.5% |
| eBay | $13.66 | −$1.60 | −$0.90 | $11.16 | 27.9% |
The channel that looked best at gross level is now last. Your own store has the cheapest fees, but you pay for every visitor. Marketplaces charge more per order and bring more of the traffic with them. Neither is "the profitable channel" in general; the answer depends on your ad cost per order, and it changes SKU by SKU.
This is the core of a SKU margin map built on contribution profit: rank every SKU-channel pair by contribution, not gross margin, and you'll often find a few combinations losing money on every sale without anyone noticing.
Net profit margin: the number that pays you
Net profit margin is net income divided by revenue. It subtracts everything contribution margin leaves out: software subscriptions, the Amazon Professional plan, your Shopify plan, salaries, rent, insurance, interest and income tax.
In plain English: net profit margin is the share of sales left after every bill is paid.
Net profit margin (%) = Net income ÷ Net revenue × 100 Example month: Revenue (2,000 orders x $40) 80,000 Total contribution (blended 25%) 20,000 Fixed costs (tools, staff, rent) -15,000 Net income before tax 5,000 Net profit margin 6.3%
A 68.5% gross margin turned into a 6.3% net margin, which is right in line with the single-digit net margins in the retail sector data above. Fixed costs are shared across channels, so don't force them into per-order numbers for pricing decisions. Allocate them only when you're deciding whether a channel is worth keeping at all. The profit and loss (P&L) template split by channel and SKU shows one clean way to lay that out.
To see how many orders you need before fixed costs are covered, the free break-even calculator takes your contribution per order and fixed costs and returns the unit count.
Six mistakes that inflate ecommerce margins
- Using the supplier price as COGS. Freight, duty and brokerage are part of what the product cost you. Leaving them out overstates gross margin on every sale, and more so on heavy or high-tariff imports.
- Blending channels into one margin. A 40% blended margin can hide one channel at 45% and another at 20%. Calculate per channel, then per SKU.
- Ignoring fees charged on tax and shipping. eBay's fee base includes sales tax and buyer-paid shipping. If your model uses item price only, it understates fees.
- Forgetting payment processing on your own store. On Shopify it's a few percent plus 30¢ per order, and the 30¢ weighs more on cheap items. Our comparison of payment processing fees shows how the flat part changes low-priced SKUs.
- Treating a price cut as a margin cut of the same size. A 10% discount on the $40 SKU removes $4.00 of revenue, but the percentage fees shrink too, so channel-adjusted profit falls by less than $4.00. On Amazon it drops by $3.40, not $4.00. Model the whole chain.
- Mixing up margin and markup. Keep one definition in every spreadsheet. If a column says margin, it divides by price.
How to build a channel-adjusted margin sheet
You don't need special software to start. You need one row per SKU per channel, with these columns:
SKU | Channel | Price | Landed COGS | Gross profit | Gross margin %
| Referral or payment % | Fixed per-order fee | Channel fee $
| Pick/pack | Label | Channel-adj. GP | Channel-adj. margin %
| Ad cost per order | Returns allowance | Contribution $ | Contribution %
- Price and fees: pull the fees you paid from each channel's settlement report (the payout statement), not from its published price list. Settlement data catches minimums, surcharges and category mismatches.
- Landed COGS: update when a new purchase order arrives, not once a year.
- Fulfillment: use your average label cost per SKU, based on where your orders ship to, not a flat guess.
- Ads: divide channel ad spend by channel orders for the same period.
The formula is the easy part. The work is getting fees, costs and shipping for each order from four channels into one place without retyping them. Nventory pulls orders from every connected channel into one list, each tied to a SKU, which gives you the rows this sheet needs.
For quick what-if checks on a single SKU, the free ecommerce profit calculator runs price, COGS, fees and shipping and returns margin per unit.
What to do this week
- Pick your top 10 SKUs by revenue. Those are where margin errors cost the most.
- Rebuild landed COGS for each by adding freight-in, duty and broker fees from your last purchase order.
- Download one month of settlement reports from every channel and work out the fee you paid per order for each SKU.
- Calculate gross, channel-adjusted gross and contribution margin for each SKU on each channel.
- Flag any SKU-channel pair under 15% contribution margin, then reprice it, change how it ships, cut its ad spend or stop selling it there.
- Check each channel's fee page for announced changes and put the dates in your calendar, so you reprice before the fee lands.
- Book a monthly date to recalculate. Margins drift with every fee update and supplier invoice.
If your orders and fees sit in four different dashboards, connect your busiest channel on Nventory's Free plan (unlimited orders, no card) and build the margin sheet from one order list.
Frequently Asked Questions
It depends on the category and on what you put in cost of goods sold. A product-only gross margin that looks healthy can shrink by 20 to 35 points once marketplace referral fees and fulfillment come out, as our worked example shows. A more useful test is channel-adjusted gross margin: if it lands under roughly 30% on a channel, there is usually too little left to pay for ads, returns and overhead.
Yes. Both terms mean gross profit divided by net revenue, shown as a percentage. Gross profit is the dollar amount (revenue minus cost of goods sold); gross margin or gross profit margin is that dollar amount expressed as a share of revenue. Some people say "gross margin" when they mean the dollar figure, so check which one a report is using.
Not under the usual definition. Cost of goods sold covers what it cost to buy or make the product and get it to you: purchase price, freight-in, duties and packaging. Referral fees are a cost of selling on a channel. Your accountant decides how they appear in your tax books, but for pricing decisions you should subtract them in a channel-adjusted gross margin so each channel is compared fairly.
Inbound freight to your warehouse belongs in COGS as part of landed cost. Outbound shipping to customers is a policy choice: some companies, Amazon included, put it in cost of sales, while others treat it as an operating expense. For ecommerce decisions, include outbound shipping and pick-and-pack in channel-adjusted gross margin, because a free-shipping order has no margin until the label is paid for.
Gross margin divides gross profit by the selling price; markup divides it by the cost. A product that costs $12.60 and sells for $40 has a gross margin of 68.5% but a markup of about 217%. Margin can never reach 100%, while markup can go far above it, so confusing the two is one of the most common pricing mistakes.
Monthly at minimum, and any time a channel changes its fee schedule, a supplier changes a cost, or you change your shipping rates. Fees are usually announced ahead of time, so recalculate before the effective date, not after the first statement arrives. High-volume SKUs deserve a weekly look during peak season, when fees and ad costs move fastest.
Related Articles
View all
Markup vs Margin: The Mix-Up That Quietly Underprices Whole Catalogs
Markup divides profit by cost; margin divides it by price. Confuse them and a 50% target prices every SKU 25% too low. Formulas, conversion tables and fee-adjusted math.

Your CFO Does Not Need Another Report. They Need Inventory Events.
Static reports show what inventory is worth. Inventory events explain why cash, COGS, shrinkage, and margin moved.

The Margin Map: Which SKUs Actually Make Money After Every Fee
Blended margin hides cross-subsidy. A SKU margin map shows which products fund the business and which quietly drain it.