Jun 21, 2026 · 7 min read

Gross Margin Calculator: Formula and Examples

Daymark Product & Data TeamAnalytics practitioners at Daymark

First-hand guidance from the Daymark team on analytics workflows, growth reporting, and the operational metrics teams use to make decisions.

Gross margin matters because revenue growth alone does not tell you how much of that revenue the business actually keeps after direct delivery costs. Two businesses can grow at the same pace and have very different underlying economics because their margins are different.

That is why gross margin is one of the most useful metrics for pricing, profitability, and unit-economics decisions. It helps teams see whether growth is becoming more valuable or just more expensive to serve. The formula is easy, but the cost definition is where most teams create confusion, so the COGS boundaries are worth real attention.

This guide explains gross margin meaning, the standard formula, what should go into COGS, and how to use the metric without confusing it with net margin or contribution margin.


What is gross margin?

Gross margin is the percentage of revenue left after subtracting cost of goods sold, or COGS.

It shows how much revenue remains to cover operating expenses such as sales, marketing, product, and general overhead after the direct cost of delivering the product or service is removed.

Gross Margin Calculator

Enter your numbers

Gross Margin

65.0%

Gross Margin

The share of revenue left after the direct cost of delivering it. What counts as COGS is where most teams disagree, so keep it consistent.

Track gross margin by product and segment

Connect revenue and cost data to see margin where the decisions actually happen, not just company-wide.

See how Daymark tracks this live →

Gross margin is useful because it helps answer:

  • whether pricing is strong enough
  • whether delivery costs are rising too quickly
  • which products or channels are truly profitable
  • how much room exists to fund acquisition and operations

For software businesses, gross margin often reflects infrastructure, support, and service-delivery efficiency. For ecommerce, it is closely tied to product cost, shipping, returns, and discounting. The business model changes the cost mix, but the economic question is the same: how much revenue is still available after direct costs are paid?

Gross margin formula

The standard formula is:

Gross Margin (%) = (Revenue − COGS) / Revenue × 100

A simple example

Say a business has:

  • $200,000 in revenue
  • $58,000 in direct delivery costs

First calculate gross profit:

Gross profit = $200,000 − $58,000 = $142,000

Then convert it to a margin percentage:

Gross margin = $142,000 / $200,000 × 100
Gross margin = 71%

That means 71% of revenue remains after direct costs.

A more useful breakdown often looks like this:

ItemAmount
Revenue$200,000
Product or inventory cost$32,000
Payment processing$6,000
Shipping / fulfillment$9,000
Support delivery tied to customers$11,000
Total COGS$58,000

That table matters because it reveals which cost component is actually pressuring margin.

What usually belongs in COGS?

COGS depends on the business model, but it often includes direct costs such as:

  • hosting and infrastructure
  • payment processing
  • fulfillment and shipping
  • support or service delivery tied directly to customers
  • production or inventory costs

Sales and marketing expense usually does not belong in COGS. Those costs sit below gross margin.

The reason this distinction matters is practical, not academic. If one team classifies a cost as COGS and another treats it as operating expense, margin trends will change even if the business itself did not.


How to calculate gross margin correctly

1. Define COGS consistently

Gross margin becomes noisy when one team includes a cost and another does not. The first rule is to keep the COGS definition stable enough that month-to-month changes are meaningful.

This often requires writing down explicit rules, especially in hybrid businesses where infrastructure, service delivery, support, and software costs can be partly direct and partly shared.

2. Segment the metric

A company-wide gross margin can hide large differences by:

  • product line
  • channel
  • customer segment
  • geography
  • store or brand

That is especially important for ecommerce and hybrid businesses where discounting, fulfillment, and returns can vary a lot by channel. A stable blended margin can still hide one product or one store getting materially less profitable.

3. Pair margin with growth metrics

Margin becomes much more useful when read next to:

Higher revenue with weaker margin is not always a better outcome. The business needs both growth and healthy economics.

This is one reason gross margin is such a powerful bridge metric. It connects the pricing side of the business to the acquisition side.

4. Watch mix shifts

Gross margin can improve because a higher-margin product mix became a larger share of revenue. That may be great, but it is different from saying every product got more efficient. Segmenting the metric helps explain what actually changed.

The same is true in reverse. Margin can fall even if delivery costs are stable if discount-heavy or lower-margin SKUs become a larger share of sales.

What is a good gross margin?

There is no single benchmark that fits every business model.

Broad patterns do exist:

  • software businesses often run higher gross margins
  • ecommerce and physical-goods businesses often run lower margins
  • services and hybrid models vary more based on delivery costs

The more useful questions are:

  • Is gross margin improving for the same product or channel?
  • Which part of COGS is changing?
  • Are discounts, returns, or fulfillment affecting margin more than expected?
  • Is the margin level high enough to support CAC and payback targets?

In other words, a “good” margin is one that supports the rest of the economic model, not one that merely looks attractive in isolation.

Gross margin vs net margin

Gross margin and net margin are related, but they are not the same:

  • Gross margin subtracts only direct delivery costs
  • Net margin subtracts all operating expenses as well

Gross margin is a cleaner metric for understanding pricing and delivery efficiency. Net margin is the broader profitability view.

This distinction is especially important when teams try to use gross margin for operating planning. It tells you how much room exists before sales, marketing, and overhead are considered. It does not tell you whether the company is fully profitable on a net basis.

What actually improves gross margin

Better pricing discipline

If pricing strengthens without a matching rise in direct costs, gross margin improves. That can happen through cleaner discounting, stronger packaging, or better willingness-to-pay capture.

Lower direct delivery costs

Better infrastructure efficiency, lower fulfillment costs, and more disciplined support models can all improve gross margin. In some businesses, the largest wins come not from raising prices but from removing cost leakage.

Better product or channel mix

If higher-margin products or channels grow faster, the blended margin can rise even if no single product changed. This is one reason mix analysis matters so much when interpreting gross margin trends.

Lower discount and return pressure

For ecommerce operators especially, discounts, refunds, and return behavior can materially change gross margin even when topline revenue looks steady. Margin often tells the truth that topline growth hides.

Common mistakes

Mixing operating expenses into COGS

This makes gross margin less comparable and less useful as a pricing and delivery metric. Sales and marketing spend usually belongs below gross margin, not inside it.

Looking only at one blended number

The average can hide that one store, product, or channel is losing margin much faster than the rest. Margin analysis gets stronger as segmentation improves.

Ignoring temporary mix effects

A promotional period or one strong product launch can change the blended margin in ways that do not last. Without context, teams may misread a temporary mix shift as a structural improvement or decline.

Using gross margin without CAC context

Margin matters most when it is connected to acquisition efficiency and payback. A business can grow revenue and even improve conversion while still weakening economically if gross margin erodes.

Frequently asked questions

What is the formula for gross margin?

Gross margin is revenue minus cost of goods sold, divided by revenue, multiplied by 100.

What should be included in COGS?

COGS usually includes direct costs required to deliver the product or service, such as hosting, fulfillment, processing, support delivery, or production costs.

What is the difference between gross margin and net margin?

Gross margin subtracts only direct delivery costs, while net margin subtracts all operating expenses as well.

Why does gross margin matter for CAC and payback?

Gross margin affects how much revenue is actually available to recover acquisition cost, which makes it a key input into LTV and CAC payback calculations.

Summary

Gross margin is useful because it shows how much of revenue is still available after direct costs are removed. It helps teams understand whether growth is truly valuable, not just larger on paper.

Used well, gross margin becomes a bridge between pricing, delivery efficiency, acquisition economics, and long-term profitability.

Keep exploring