How to calculate gross profit margin (with examples)

|
business finance pricing

Gross profit margin is the percentage of revenue left after subtracting the direct cost of producing what you sold. The formula is straightforward:

\[\text{Gross Margin \%} = \frac{\text{Revenue} - \text{COGS}}{\text{Revenue}} \times 100\]

A retailer that sold $50,000 of inventory it had paid $20,000 for has a gross margin of ($50,000 - $20,000) / $50,000 = 60%. That 60% is the share of every dollar of revenue available to cover overhead, marketing, and profit.

What counts as COGS

Cost of goods sold (COGS) includes only the direct costs tied to producing or acquiring what was sold. The standard buckets:

  • Materials and inventory. Raw materials for a manufacturer, finished goods for a retailer, ingredients for a restaurant.
  • Direct labor. Wages for workers who physically produce the product or deliver the per-unit service. A baker’s hourly wage. Not the office manager’s salary.
  • Direct production overhead. Factory utilities, equipment depreciation directly tied to production. Not corporate office rent.
  • Shipping and freight in. Cost to receive raw materials. Outbound shipping is sometimes included, sometimes treated as a selling expense; consistency matters more than which choice.

What is not COGS:

  • Marketing, sales salaries, customer support
  • Office rent, executive salaries, accounting fees
  • Software, subscriptions, general overhead
  • Interest, taxes, depreciation of non-production assets

These all sit below the gross profit line on an income statement. They reduce net profit but not gross profit.

Worked example: a retail business

A clothing boutique runs the following month:

Item Amount
Total sales revenue $80,000
Inventory cost of items sold $32,000
Inbound shipping on inventory $2,500
Sales tax collected (passes through) $5,600 (excluded)

COGS for the month: $32,000 + $2,500 = $34,500

Revenue (excluding pass-through sales tax): $80,000

\[\text{Gross Margin \%} = \frac{80,000 - 34,500}{80,000} \times 100 = 56.9\%\]

The boutique has $45,500 of gross profit to fund rent, staff, marketing, and any take-home profit.

Worked example: a SaaS business

Software companies have lower COGS as a percentage of revenue because the marginal cost of an additional customer is mostly server resources. A SaaS with $500,000 in monthly recurring revenue might look like:

Item Amount
MRR $500,000
Cloud hosting and infrastructure $40,000
Customer support team (delivery side) $35,000
Payment processing fees $15,000
Third-party APIs passed to customers $10,000

COGS: $100,000

\[\text{Gross Margin \%} = \frac{500,000 - 100,000}{500,000} \times 100 = 80\%\]

An 80% gross margin is typical for a healthy SaaS business. Companies above 75% have room to invest aggressively in growth. Below 60%, the unit economics start to look more like a service business than software.

Per-unit gross margin

For products sold individually, gross margin can be calculated per unit:

\[\text{Unit Gross Margin \%} = \frac{\text{Selling Price} - \text{Unit Cost}}{\text{Selling Price}} \times 100\]

Per-unit margin is useful for product-level pricing decisions. A coffee shop comparing two menu items:

Item Price COGS Margin
Latte $5.00 $1.20 76%
Pastry $3.50 $1.80 49%

The latte produces both more dollars of profit ($3.80 vs. $1.70) and a higher percentage. Promoting the latte makes the business more money in two ways at once.

Common mistakes

Including overhead in COGS. Office rent, marketing, and salaries unrelated to production belong below the gross profit line. Mixing them in artificially lowers gross margin and obscures pricing problems.

Forgetting payment processing fees. Stripe and PayPal take roughly 3% of every credit card transaction. On a 30% gross margin product, that 3% is a tenth of total margin.

Mixing margin and markup. A product with a 50% markup over cost has a 33% margin, not 50%. Use the margin and markup conversion table to translate between the two.

Calculating margin on revenue including refunds and discounts. Use net revenue (after refunds and discounts) as the denominator. Otherwise margin looks higher than it actually is.

Counting revenue you have not collected. Gross margin should be calculated on revenue actually earned, not just billed. For subscription businesses with high churn or refund rates, the difference matters.

Industry benchmarks

Gross margin varies enormously by industry. Rough ranges:

Industry Typical gross margin
Software (SaaS) 70-85%
Software (per-license) 80-95%
Professional services 30-50%
Restaurants 60-70%
Specialty retail 40-60%
Grocery 20-30%
Manufacturing 25-45%
Construction 15-30%

These ranges are not targets. They are descriptive averages. A grocery store with a 25% gross margin can be highly profitable; a SaaS with a 25% gross margin is in trouble. The right target depends on what overhead structure your industry requires.

Improving gross margin

Three levers move gross margin: raising prices, lowering costs, or shifting product mix toward higher-margin items.

Raising prices is usually the largest available lever. A 5% price increase on a product with a 50% gross margin moves the margin to 52.4%, a 5 percentage point improvement in absolute gross profit per sale.

Lowering costs through better supplier terms, bulk purchasing, or operational efficiency. The impact compounds: a 10% reduction in COGS on a 60% margin product moves the margin to 64%.

Mix shift by promoting higher-margin items. The latte vs. pastry example earlier: shifting one pastry sale to a latte sale adds $2.10 of gross profit per substitution.

Use the profit margin calculator and gross margin calculator to model price and cost changes before making them.