The same formula, two different sets of inputs. Software margin turns on cost of revenue; e-commerce margin turns on landed cost, fulfilment and returns.
Gross margin only — operating expenses such as sales, marketing, engineering and general admin sit below this line and are not included. The e-commerce mode charges fulfilment on every order because a returned order is still shipped, refunds the payment fee with the order, and recovers unit cost only on the share of returns you can resell.
Gross margin is what is left of revenue after the cost of delivering it, before any of the costs of running the company. It is the ceiling on everything else: a business with a 40% gross margin has 40 cents per dollar to pay for sales, engineering, rent and profit. For the definition, benchmarks by model and the mistakes that distort it, see gross margin and its dollar counterpart gross profit.
The formula never changes. Gross margin = (Revenue − Cost of goods sold) ÷ Revenue. What changes, completely, is what belongs in that cost line — which is why the calculator above has two modes instead of one box.
A software company's cost of revenue is what it spends to keep the product delivered to paying customers: hosting and infrastructure, the support and customer-success time that keeps them running, and third-party services the product depends on or resells.
What does not belong there is the engineering team building new features, sales, marketing or admin. Those sit below the gross margin line. Putting R&D into cost of revenue is the most common way a software company understates its own margin, usually by 10 to 20 points, and it makes every downstream comparison wrong.
For a physical product, the cost line is landed cost plus everything it takes to get the order to the customer, and then the part most calculators ignore: returns.
That last point is why a 12% return rate costs far more than 12% of margin. The calculator models it explicitly: fulfilment is charged on every order placed, and returned stock is recovered only at the resellable share you enter.
| Business | Typical gross margin | What moves it |
|---|---|---|
| SaaS | 70–85% | Hosting efficiency, support load per customer, what sits in cost of revenue |
| Marketplace | 50–70% | Take rate, payment costs, whether logistics is carried |
| E-commerce, own brand | 40–60% | Landed cost, fulfilment, return rate and resale recovery |
| E-commerce, reseller | 20–40% | Supplier terms and shipping |
| Services | 40–60% | Delivery staff utilisation |
These are ranges, not targets. The useful comparison is your own margin over time and against your own pricing, because the same 45% can be excellent for a reseller and a problem for an own-brand product.
Gross margin is only as good as the ledger underneath it. If cost of revenue is not separated from operating expenses in the chart of accounts, the number cannot be produced reliably month to month. That separation is part of how we set books up — see bookkeeping, or e-commerce bookkeeping for the inventory and fulfilment side.