Gross Margin: Formula, Examples and How to Improve It in an Online Store
What is gross margin?
Gross margin is the percentage of revenue left after paying for the products you sold. The formula is gross margin = (revenue - cost of goods sold) / revenue x 100. If your store sold $10,000 of products that cost you $6,000, your gross profit is $4,000 and your gross margin is 40 percent.
Gross margin is the first profit number in any business, and the one that pays for everything else: advertising, staff, software, rent. If it is too thin, no amount of sales growth fixes it, because every extra sale brings in too little to cover its share of the running costs.
Gross margin vs gross profit vs markup
- Gross profit is an amount: revenue minus cost of goods sold. In the example above, $4,000.
- Gross margin is that amount as a share of revenue: 40 percent.
- Markup divides the same profit by the cost instead of the price: $4,000 / $6,000 = 66.7 percent.
Markup always looks bigger than margin for the same product. When a supplier or a pricing tool talks about a 100 percent markup, that is a 50 percent margin.
What counts as cost of goods sold
Cost of goods sold, often shortened to COGS, is what it costs to get each product to the point of sale. For an online store it usually includes:
- The purchase price or manufacturing cost of the product.
- Inbound shipping and import duties to get it to you.
- Packaging that goes out with the product.
- For print on demand, the printer's charge per item.
Running costs such as your website, staff, marketing and rent are not part of COGS. They come out later, in operating and net margin. Stores differ on whether outgoing shipping and payment fees belong in COGS; whichever you choose, use the same rule every month so your margins can be compared.
Worked examples
| Product | Price | Cost of goods | Gross profit | Gross margin |
|---|---|---|---|---|
| Candle | $28 | $9 | $19 | 67.9% |
| Running shoes | $120 | $72 | $48 | 40% |
| Phone charger | $25 | $18 | $7 | 28% |
The candle and the charger tell very different stories. A 10 percent discount on the candle still leaves a healthy margin. The same 10 percent on the charger takes more than a third of its profit, before shipping and payment fees.
Product margin vs store margin
Your store's overall gross margin is a mix of every product you sell, weighted by how much of each you sell. If your best seller has a thin margin, your store margin will be thin even when most of your catalogue is profitable. Look at margin per product and per category, not only the store total, before you decide where to discount.
Gross margin vs operating and net margin
| Margin | What it subtracts from revenue | What it shows |
|---|---|---|
| Gross margin | Cost of goods sold | How profitable the products themselves are |
| Operating margin | Cost of goods sold plus running costs such as staff, rent, software and marketing | How profitable the business operations are |
| Net margin | All costs, including interest and taxes | What is finally left for the owners |
A healthy gross margin is the foundation: it has to be high enough to pay for everything below it. A store can have strong sales and still lose money if gross margin is too thin to cover marketing and overheads.
Tracking gross margin over time
Calculate gross margin each month, and also by product and category. Watch for changes: supplier price rises, higher shipping costs or more discounting will show up here first. A falling gross margin with rising sales is a sign that growth is being bought with discounts.
How to improve gross margin
- Raise prices on products that sell without help. Products that sell steadily at full price can often take a small increase without losing buyers.
- Lower your cost of goods. Order in larger quantities, compare suppliers, or simplify packaging.
- Change the mix. Promote high-margin products more, and use low-margin ones as entry points rather than as the main thing you push.
- Sell more per order. Bundles and quantity deals sell more units per order. When the discount is smaller than the extra profit, margin per order goes up.
- Use targeted discounts instead of sitewide sales. A sitewide 20 percent off discounts products that would have sold anyway. Deals on specific products, quantities or order values give the discount only where it brings extra sales.
- Stop discounts from stacking. Decide which offers can combine, so a sale price, a coupon and free shipping cannot all land on the same order.
Gross margin and promotions
Every promotion is paid for out of gross margin, so it is the number to check before you launch one. A simple rule: the deeper the discount, the more extra sales you need to break even. On a 40 percent margin product, a 20 percent discount needs twice the sales to earn the same gross profit. Our article on profit margin has a full table of how each discount level changes profit per sale.
GT BOGO Engine, which we make, lets WooCommerce stores enter product costs and set a margin floor, so a buy one get one, bundle or quantity deal is held back when it would take an order below the gross margin you choose.
Frequently asked questions
How do you calculate gross margin?
Subtract the cost of goods sold from revenue, divide by revenue and multiply by 100. $10,000 of sales that cost $6,000 gives a gross margin of 40 percent.
What is the difference between gross margin and gross profit?
Gross profit is the amount left after the cost of goods sold, such as $4,000. Gross margin is that amount as a percentage of revenue, such as 40 percent.
Is gross margin the same as markup?
No. Margin divides profit by the selling price, markup divides it by the cost. A 100 percent markup equals a 50 percent margin.
What is a good gross margin for ecommerce?
It depends on what you sell. Your own products and digital goods often run above 50 percent, resold brands and electronics much lower. What matters is that the margin covers shipping, fees, advertising and returns.
How do discounts affect gross margin?
A discount comes straight out of gross profit. On a product with a 40 percent margin, a 20 percent discount halves the gross profit on each sale.
What is a good gross margin for an online store?
It varies by product type. The right figure is one high enough to cover marketing, running costs and planned promotions while leaving a profit.
Does shipping count in gross margin?
Shipping you pay to deliver orders is often included in cost of goods sold for online stores. Be consistent so that months and products can be compared.