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

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:

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

ProductPriceCost of goodsGross profitGross margin
Candle$28$9$1967.9%
Running shoes$120$72$4840%
Phone charger$25$18$728%

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

MarginWhat it subtracts from revenueWhat it shows
Gross marginCost of goods soldHow profitable the products themselves are
Operating marginCost of goods sold plus running costs such as staff, rent, software and marketingHow profitable the business operations are
Net marginAll costs, including interest and taxesWhat 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

  1. Raise prices on products that sell without help. Products that sell steadily at full price can often take a small increase without losing buyers.
  2. Lower your cost of goods. Order in larger quantities, compare suppliers, or simplify packaging.
  3. Change the mix. Promote high-margin products more, and use low-margin ones as entry points rather than as the main thing you push.
  4. 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.
  5. 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.
  6. 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.