Formula Guide

Gross Margin Formula: The Complete
Profit Margin Guide

Master the gross margin formula with step-by-step examples, margin vs markup conversions, and pricing strategies.

The Gross Margin Formula

Gross Margin = ((Revenue - COGS) ÷ Revenue) × 100

Also written as: (Gross Profit ÷ Revenue) × 100

Revenue

The total selling price of goods sold. Also called sales or net sales.

COGS

Cost of Goods Sold—all direct costs to produce or acquire the products sold.

Result

A percentage showing what portion of revenue is gross profit.

Quick Example

You sell a product for $80 and it costs you $32 (including all COGS).

Gross Margin = (($80 - $32) ÷ $80) × 100 = 60%

60% of each sale is gross profit; 40% goes to cover product costs.

Calculate Margins Automatically

StoreRadar calculates gross margin for every product in your WooCommerce store—no spreadsheets required.

Start Free Trial

Gross Margin Formula Variations

Different ways to calculate and express profit margins

Gross Margin (Percentage)
Formula
((Revenue - COGS) ÷ Revenue) × 100
Example
(($100 - $60) ÷ $100) × 100 = 40%
Use Case
Compare profitability across products and time periods

The standard margin formula. Express as a percentage for easy comparison.

Gross Profit (Dollar Amount)
Formula
Revenue - COGS
Example
$100 - $60 = $40
Use Case
Understand absolute profit per unit or total

The dollar amount before margin percentage is calculated.

Markup Percentage
Formula
((Price - Cost) ÷ Cost) × 100
Example
(($100 - $60) ÷ $60) × 100 = 66.7%
Use Case
Set prices based on cost

How much you add to cost. Always higher than margin for same profit.

Margin from Markup
Formula
Markup ÷ (1 + Markup)
Example
0.667 ÷ 1.667 = 40%
Use Case
Convert markup to margin

Useful when you know markup and need margin.

Markup from Margin
Formula
Margin ÷ (1 - Margin)
Example
0.40 ÷ 0.60 = 66.7%
Use Case
Convert margin to markup

Useful when you know margin and need to calculate prices.

Contribution Margin
Formula
((Revenue - Variable Costs) ÷ Revenue) × 100
Example
(($100 - $65) ÷ $100) × 100 = 35%
Use Case
Include all variable costs, not just COGS

Includes shipping, payment fees, and other per-order costs.

Margin vs Markup Conversion Table

They're not the same—here's how they relate

Margin

Profit as a % of selling price

Margin = Profit ÷ Price

"I sell for $100, cost is $60, margin is 40%"
$40 ÷ $100 = 40%

Markup

Profit as a % of cost

Markup = Profit ÷ Cost

"I pay $60, add $40, markup is 66.7%"
$40 ÷ $60 = 66.7%

Margin Markup Price from $100 Cost
20% 25% $100 cost → $125 price
25% 33.3% $100 cost → $133.33 price
30% 42.9% $100 cost → $142.86 price
33.3% 50% $100 cost → $150 price
40% 66.7% $100 cost → $166.67 price
50% 100% $100 cost → $200 price
60% 150% $100 cost → $250 price
70% 233% $100 cost → $333.33 price

Key Insight: 50% Margin = 100% Markup

At 50% margin, you double your cost (100% markup). This is often the break-even point for many retail businesses after accounting for operating expenses and advertising costs.

Worked Examples

Step-by-step margin calculations

1

Basic Gross Margin Calculation

Scenario

You sell a product for $79.99. Your wholesale cost is $32, and packaging costs $3 per unit.

Step-by-Step Solution
  1. 1 Calculate COGS: $32 + $3 = $35
  2. 2 Calculate Gross Profit: $79.99 - $35 = $44.99
  3. 3 Calculate Gross Margin: ($44.99 ÷ $79.99) × 100
  4. 4 Gross Margin = 56.2%
Result

Your gross margin is 56.2% per unit.

Interpretation

This is a healthy margin for ecommerce. You keep $44.99 from each $79.99 sale before operating expenses.

2

Store-Wide Gross Margin

Scenario

Last month your store generated $85,000 in revenue. Total COGS was $47,600.

Step-by-Step Solution
  1. 1 Calculate Gross Profit: $85,000 - $47,600 = $37,400
  2. 2 Calculate Gross Margin: ($37,400 ÷ $85,000) × 100
  3. 3 Gross Margin = 44.0%
Result

Your store's overall gross margin is 44%.

Interpretation

44% margin is solid. You have $37,400 to cover operating expenses, marketing, and profit.

3

Converting Margin to Markup

Scenario

You want to achieve a 40% gross margin on a product that costs you $25. What price should you set?

Step-by-Step Solution
  1. 1 Convert margin to markup: 0.40 ÷ (1 - 0.40) = 0.667 (66.7%)
  2. 2 Calculate price: $25 × (1 + 0.667) = $25 × 1.667
  3. 3 Price = $41.67
  4. 4 Verify: ($41.67 - $25) ÷ $41.67 = 40% ✓
Result

Price the product at $41.67 to achieve 40% margin.

Interpretation

A 40% margin requires a 66.7% markup. Many confuse these—a 40% markup only gives you 28.6% margin.

4

Comparing Product Margins

Scenario

Compare margins across your product line to identify winners and losers.

Step-by-Step Solution
  1. 1 Product A: $120 price, $48 cost → ($72 ÷ $120) × 100 = 60%
  2. 2 Product B: $45 price, $22 cost → ($23 ÷ $45) × 100 = 51%
  3. 3 Product C: $200 price, $140 cost → ($60 ÷ $200) × 100 = 30%
  4. 4 Weighted average: (0.60×40% + 0.51×35% + 0.30×25%) = 49.4%
Result

Product A has 60% margin (best), Product C has 30% margin (lowest).

Interpretation

Product C drags down your average. Consider price increases, cost reduction, or discontinuing if volume is low.

Gross Margin Benchmarks by Business Model

What margins are typical for your type of ecommerce?

Business Model Typical Margin Notes
Dropshipping 15% - 30% Low margins, high volume model
Print on Demand 20% - 35% Production costs eat into margin
Wholesale/Reselling 30% - 50% Depends on supplier relationships
Private Label 50% - 70% Higher margins, more control
Handmade/Artisan 50% - 80% Labor intensive but high margins
Digital Products 80% - 95% Minimal COGS after creation
SaaS/Subscriptions 70% - 90% High margins, recurring revenue

Note: These are typical ranges. Your specific margin depends on product sourcing, pricing strategy, and operational efficiency.

Common Margin Calculation Mistakes

Errors that lead to incorrect pricing and profitability

Confusing Margin with Markup

Thinking a 50% markup gives you 50% margin. A 50% markup only produces a 33.3% margin.

How to Fix

Use the conversion formulas. Margin = Markup ÷ (1 + Markup). A 100% markup = 50% margin.

Forgetting Hidden COGS

Only counting wholesale cost and ignoring packaging, inbound shipping, customs, and handling.

How to Fix

Include all direct costs: product cost + inbound freight + duties + packaging + any per-unit handling.

Including Operating Expenses in COGS

Adding marketing, rent, or salaries to COGS. These belong in operating expenses, not COGS.

How to Fix

COGS = direct product costs only. Operating expenses are subtracted from gross profit to get net profit.

Using Margin to Set Prices

Trying to add margin directly to cost. If cost is $50 and you want 40% margin, you can't just add $20.

How to Fix

Price = Cost ÷ (1 - Desired Margin). For 40% margin: $50 ÷ 0.60 = $83.33

Ignoring Shipping Costs

Not accounting for shipping in margin calculations, especially for free shipping offers.

How to Fix

Calculate contribution margin including shipping costs. Free shipping reduces your effective margin.

Averaging Margins Wrong

Simple average of product margins ignores sales volume. Product with 20% margin but 80% of sales dominates.

How to Fix

Use revenue-weighted average: Σ(Margin × Revenue Share) for each product.

How to Improve Your Gross Margin

Strategies to increase profitability

High Impact

Negotiate Better Supplier Terms

Bulk discounts, better payment terms, or finding alternative suppliers can directly improve margins.

High Impact

Raise Prices Strategically

A 10% price increase with 5% volume loss often increases total profit. Test price elasticity.

Medium Impact

Reduce Packaging Costs

Optimize box sizes, use lighter materials, and negotiate with packaging suppliers.

Medium Impact

Optimize Shipping to Warehouse

Consolidate shipments, use freight vs express, and consider closer fulfillment locations.

Medium Impact

Cut Low-Margin Products

Discontinue or reprice products dragging down your average margin.

Medium Impact

Create Bundles

Bundle lower-margin items with high-margin products to improve overall transaction margin.

How to Track Gross Margin in WooCommerce

Three ways to monitor profit margins for your WooCommerce store

Option 1: Spreadsheets

Export WooCommerce orders and manually calculate margins in Excel or Google Sheets. Time-consuming and error-prone for large catalogs.

Pros
  • Full control
  • No additional cost
Cons
  • Manual data entry
  • No real-time updates
  • Easy to make errors

Option 2: WooCommerce Plugins

Various cost-tracking plugins can add COGS fields to products. Quality and features vary significantly between plugins.

Pros
  • Integrates with WooCommerce
  • Varies by plugin
Cons
  • Plugin quality varies
  • Limited reporting
  • May conflict with other plugins
Recommended

Option 3: StoreRadar

Import your COGS data once, and StoreRadar calculates gross margin for every product, order, and customer segment automatically with real-time updates.

Pros
  • Automatic calculation
  • Product-level margins
  • Real-time updates
  • AI insights
Cons
  • Monthly subscription

Related Ecommerce Formulas

Other metrics that depend on gross margin

Formula Calculation Relationship to Margin
Net Profit Margin ((Revenue - All Costs) ÷ Revenue) × 100 Gross margin minus operating expenses = net margin
Break-Even ROAS 1 ÷ Gross Margin Higher margin = lower ROAS needed to be profitable on ads
Contribution Margin ((Revenue - Variable Costs) ÷ Revenue) × 100 Includes per-order costs beyond COGS (shipping, fees)
Gross Profit Revenue - COGS The dollar amount used to calculate gross margin percentage
Customer Lifetime Value AOV × Margin × Purchase Frequency × Lifespan Margin directly impacts how much each customer is worth

Frequently Asked Questions

Common questions about gross margin

The gross margin formula is: Gross Margin = ((Revenue - COGS) ÷ Revenue) × 100. For example, if you sell a product for $100 and your cost of goods sold is $60, your gross margin is (($100 - $60) ÷ $100) × 100 = 40%.

Gross profit is a dollar amount (Revenue - COGS), while gross margin is a percentage ((Revenue - COGS) ÷ Revenue × 100). If you have $100,000 revenue and $60,000 COGS, your gross profit is $40,000 and your gross margin is 40%.

Margin is profit as a percentage of selling price; markup is profit as a percentage of cost. A product with 40% margin has 66.7% markup. Formula: Markup = Margin ÷ (1 - Margin). They're different ways of expressing the same profit relationship.

Healthy ecommerce gross margins typically range from 40-60%. Dropshipping often sees 15-30%, while private label products can achieve 50-70%. High margins allow more room for marketing spend and operational costs.

COGS includes all direct costs to produce or acquire products: wholesale cost, manufacturing, shipping to warehouse, packaging materials, and direct labor. It excludes indirect costs like marketing, rent, and software subscriptions.

Gross margin determines your break-even ROAS. With 40% margin, you need 2.5x ROAS to break even (1 ÷ 0.40). Higher margins mean you can be profitable at lower ROAS, giving you more flexibility to scale advertising.

Track Margins Across Every Product

StoreRadar calculates gross margin for every SKU in your catalog, so you can identify your most and least profitable products at a glance.

Start Free Trial ->

By signing up, you agree to our Terms of Service and Privacy Policy