On this page
Tanqory Analytics has sales by product, by channel and by country, and exports reports as CSV files for your own spreadsheets.
How to calculate gross margin
Two numbers share the name, and they answer different questions:
Gross profit = revenue − cost of goods sold
Gross margin = gross profit ÷ revenue × 100
Gross profit is in dollars: the money left to pay for everything else. Gross margin is a percentage: how much of each dollar of sales is left. Use the same period for both inputs, and count the cost of the units you sold in that period, not the cost of the stock you bought in it. A month in which you restock heavily would otherwise show a margin that has nothing to do with your prices.
| Month | Revenue | Cost of goods sold | Gross profit | Gross margin |
|---|---|---|---|---|
| April | $20,000 | $11,000 | $9,000 | 45% |
| May | $25,000 | $14,500 | $10,500 | 42% |
May left $1,500 more gross profit and a lower margin. Both readings are true. You pay rent and wages from gross profit; margin tells you whether each sale is getting thinner.
What goes into cost of goods sold
Cost of goods sold (COGS) for an online store is what it cost to get the goods you sold onto your shelf, ready to sell. Three costs belong there under almost any rule:
- Product cost. What you paid the supplier per unit, or your materials and making cost if you produce the goods.
- Inbound freight. Shipping from the supplier to your warehouse, spread over the units in the shipment.
- Duties and import fees. Customs duty and broker fees on goods you import, spread the same way.
Together these are the landed cost of a unit. Three more costs come with each sale, and stores disagree about where they go:
- Payment fees. They grow with every order, so some stores count them in COGS. Others treat them as a selling cost below gross profit.
- Packaging. The mailer, box and filler for an order. Packaging that is part of the product, such as a jar, is product cost.
- Outbound shipping. The label you pay to send the order to the buyer. If buyers pay a shipping charge, that charge is revenue; count the charge and the label together, or leave both out.
The same $40 product gives a different margin under each rule:
| What you count as cost | Cost per unit | Gross profit | Gross margin |
|---|---|---|---|
| Landed cost ($20 product, $2 freight, $2 duty) | $24.00 | $16.00 | 40% |
| Plus a $1.60 card fee | $25.60 | $14.40 | 36% |
| Plus $0.80 of packaging | $26.40 | $13.60 | 34% |
| Plus a $6.00 shipping label (free shipping) | $32.40 | $7.60 | 19% |
Nothing about the business changed between the rows. Pick one rule, write it down and keep it, so that this quarter compares with the last one and a change in the number is a change in the business. If your accountant uses a different rule for tax filings, note the difference beside your own figures.
Whatever you leave out of COGS still has to be paid. If fees, packaging and outbound shipping sit below gross profit, subtract them next: what remains is often called contribution margin, the money each order adds before fixed costs.
Margin vs markup
Markup divides the same gross profit by cost instead of by price:
Markup = gross profit ÷ cost × 100
The $40 product that costs $24 has a 40% margin and a 66.7% markup ($16 ÷ $24). The common pricing mistake is to add a percentage to cost and read it as margin. Adding 50% to a $24 cost gives a $36 price and a gross profit of $12, which is a 33.3% margin, not 50%. To price for a target margin, divide cost by one minus the margin: $24 ÷ (1 − 0.5) = $48.
To convert one into the other: margin = markup ÷ (1 + markup), and markup = margin ÷ (1 − margin).
| Gross margin | Markup | Price for a $10 cost |
|---|---|---|
| 20% | 25% | $12.50 |
| 25% | 33.3% | $13.33 |
| 30% | 42.9% | $14.29 |
| 40% | 66.7% | $16.67 |
| 50% | 100% | $20.00 |
| 60% | 150% | $25.00 |
| 75% | 300% | $40.00 |
Margin stays below the whole price unless the goods cost nothing. Markup has no ceiling.
Product margin, store margin and product mix
Each product has its own margin. The store's margin is total gross profit ÷ total revenue, which weights each product by how much of it you sold. It is not the simple average of product margins.
Take a store with two products: a $40 candle that costs $16 (60% margin) and a $100 diffuser that costs $70 (30% margin). The simple average of 60% and 30% is 45%, and it matches neither month below:
| Month | Candles sold | Diffusers sold | Revenue | Cost of goods sold | Gross profit | Gross margin |
|---|---|---|---|---|---|---|
| Month 1 | 100 | 20 | $6,000 | $3,000 | $3,000 | 50% |
| Month 2 | 50 | 40 | $6,000 | $3,600 | $2,400 | 40% |
Revenue is the same, no price or cost changed, and the store margin fell ten points because buyers moved to the lower-margin product. When your store margin moves, check the mix by product before you look for a change in price or cost.
In Tanqory, Analytics has a sales by product report that you can download as a CSV file; add your landed cost per unit in a spreadsheet to see gross profit and margin by product.
A low-margin product is not always a problem. It may bring in first-time buyers or raise average order value. Judge it by the gross profit it brings, its own and from what is bought with it, not by its percentage alone.
How discounts cut margin
A discount comes off the price, and the cost stays where it was, so all of the discount comes out of gross profit. The $40 product with a $24 landed cost:
| Discount | Price | Gross profit per unit | Gross margin | Sales needed to keep the same gross profit |
|---|---|---|---|---|
| None | $40.00 | $16.00 | 40% | 1× |
| 10% | $36.00 | $12.00 | 33.3% | 1.33× |
| 20% | $32.00 | $8.00 | 25% | 2× |
| 30% | $28.00 | $4.00 | 14.3% | 4× |
| 40% | $24.00 | $0.00 | 0% | none is enough |
A 20% discount cuts the price by a fifth and the gross profit by half. To make the same $16 from sales at $8 each, you have to sell twice as many units. A discount equal to your margin leaves nothing, and that is before any fees, packaging or shipping you keep out of COGS.
Before you set a discount code, work out the gross profit per unit at the discounted price and the extra sales it would take to match the full-price month.
Ways to raise gross margin
Each lever has a cost. Watch conversion rate and gross profit in dollars, not only the percentage, when you try one:
- Raise prices. The fastest lever, and it can cost orders. Test on a few products and compare gross profit, not just margin.
- Lower product cost. Larger orders and renegotiated terms cut the unit price. They tie up cash in stock and slow inventory turnover.
- Lower inbound freight. Slower freight and fuller shipments cost less per unit. They take longer, so you hold more stock to avoid selling out.
- Shift the mix. Feature higher-margin products on the home page, in email and in bundles. Buyers may not want them as much, and order value can fall.
- Discount narrowly. Limit discounts to products with room in their margin, set a minimum order, and cap the number of uses. A narrower offer brings fewer orders than a store-wide sale.
Questions
What is a good gross margin?
There is no single good number. Margin depends on what you sell, how you source it and which costs you count in COGS, so two stores with the same business can report different margins. We do not quote an industry average here, because published figures rarely say which costs they counted. The test that matters is whether your gross profit covers your operating costs and what you spend to win each order.
Is gross margin the same as markup?
No. Margin divides gross profit by the price; markup divides it by the cost. A product that costs $24 and sells for $40 has a 40% margin and a 66.7% markup. Adding 50% to cost gives a 33.3% margin, not 50%.
Should shipping costs be included in cost of goods sold?
Inbound freight, from your supplier to you, belongs in cost of goods sold. Outbound shipping to the buyer is a choice: some stores count it in COGS and some treat it as a selling cost. Choose one rule, use it every period, and if buyers pay a shipping charge, count that charge on the same side as the label.
What is the difference between gross margin and net margin?
Gross margin subtracts only the cost of the goods sold. Net margin subtracts every cost: fees, shipping, advertising, software, rent, wages and taxes. A store can have a healthy gross margin and still lose money if those other costs are larger than its gross profit.
Why did my gross margin fall when my prices did not change?
Check four things: the product mix, discounts, supplier cost and inbound freight or duties. If buyers moved toward lower-margin products, the store margin falls with no change to any single product. A rise in landed cost per unit has the same effect even when the shelf price stays the same.