Gross Margin vs Markup: Formulas and Worked Examples

Calculate gross margin and markup correctly, convert between them, and avoid pricing errors caused by confusing revenue and cost bases.

In this article

Gross Margin vs Markup: Formulas and Worked Examples

Gross margin and markup use the same gross profit but divide by different bases. Margin divides by revenue; markup divides by cost. If an item costs $60 and sells for $100, gross profit is $40, gross margin is 40%, and markup is 66.7%. They are not interchangeable.

The practical model

Treat gross margin vs markup: formulas and worked examples as a system with four review points: use the correct formulas, price from a target margin, define cost consistently, model discounts and mix. Give each point an owner, a measurable acceptance condition, and a rollback trigger. Thresholds should come from observed workloads, contracts, or risk tolerance rather than an unexplained default.

Use the correct formulas

Gross margin = (revenue − cost of goods sold) / revenue. Markup = (price − cost) / cost. To convert markup m to margin, use m / (1 + m). To convert margin g to markup, use g / (1 − g). Express rates as decimals during calculation.

Price from a target margin

For unit cost C and target margin g, price P = C / (1 − g). A $60 cost at a 40% target margin requires $100, not $84. Adding 40% to cost produces a $84 price and only 28.6% margin. This is the classic pricing mistake.

Define cost consistently

For software, cost of revenue may include hosting, third-party APIs, payment fees, customer support tied to delivery, and amortized infrastructure. Sales salaries and product development are usually operating expenses, but accounting policy and business model matter. Document inclusions before comparing periods or companies.

Model discounts and mix

A 10% discount can reduce gross profit by more than 10%. From $100 revenue and $60 cost, discounting to $90 cuts profit from $40 to $30, a 25% decline. Model product mix, usage tiers, refunds, and variable support cost rather than relying on a single list-price margin.

Common pitfalls

  • Applying a target margin as a markup.
  • Excluding variable cloud or API costs from SaaS COGS.
  • Comparing GAAP margin with a custom contribution metric.
  • Ignoring taxes or channel fees when they are borne by the seller.

A focused test plan

  1. Use the correct formulas: verify that gross margin = (revenue − cost of goods sold) / revenue. Then introduce the failure case “applying a target margin as a markup” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
  1. Price from a target margin: verify that for unit cost C and target margin g, price P = C / (1 − g). Then introduce the failure case “excluding variable cloud or api costs from saas cogs” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
  1. Define cost consistently: verify that for software, cost of revenue may include hosting, third-party APIs, payment fees, customer support tied to delivery, and amortized infrastructure. Then introduce the failure case “comparing gaap margin with a custom contribution metric” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
  1. Model discounts and mix: verify that a 10% discount can reduce gross profit by more than 10%. Then introduce the failure case “ignoring taxes or channel fees when they are borne by the seller” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.

Conclusion

Always label the numerator and denominator. Price from target margin with cost divided by one minus margin, define COGS consistently, and stress-test discounts and product mix.

Advertisement
Gross Margin vs Markup: Formulas and Worked Examples | Duck Cloud