b2KIT

Gross Margin Analyzer

Analyze gross margins by product line, customer segment, or time period with contribution margin and product mix charts.

Tested tool guide Tested browser tools Checked August 16, 2026

What Gross Margin Analyzer does, with a checked example

Gross Margin Analyzer takes revenue and cost-of-goods-sold figures for each product line, customer segment, or time period and returns gross profit, gross margin percentage, and an overall figure for the whole batch, with product mix charts that show how each line's share of revenue compares with its share of profit. Add variable costs and it also reports contribution margin. The result users misread most often: the overall margin is not the average of the line margins. It is revenue-weighted, so growth in a low-margin line can drag the total down even while every line stays profitable on its own.

Worked example

A concrete input and expected output from the current implementation.

Input

Product line | Revenue | COGS
Widgets | 120000 | 72000
Gadgets | 80000 | 40000
Doohickeys | 50000 | 40000

Expected output

Per line - Widgets: gross profit $48,000, margin 40%; Gadgets: $40,000, 50%; Doohickeys: $10,000, 20%. Overall - revenue $250,000, gross profit $98,000, margin 39.2%. Mix chart - revenue shares 48% / 32% / 20%, profit shares 49% / 41% / 10%.

The overall margin is the revenue-weighted mean of the line margins (40% x 48% + 50% x 32% + 20% x 20% = 39.2%), not their simple average of 36.7%. Doohickeys earns 20% of revenue but only about 10% of gross profit, which is what the mix chart makes visible.

How the result is produced

1

Margin math per row

Each row you enter yields gross profit (revenue minus cost of goods sold) and gross margin (gross profit divided by revenue). When a row includes variable costs, the tool also reports contribution margin (revenue minus variable costs, divided by revenue). The batch total is the sum of gross profits divided by the sum of revenues - a weighted result, not an average of the row percentages.

2

Product mix and grouping

The tool builds mix charts from the same rows: each line's share of total revenue plotted against its share of total gross profit, so lines that earn less than their revenue weight stand out immediately. The same math applies within any grouping you choose - product line, customer segment, or time period - and the overall figure is recomputed for every group.

Good uses

  • Deciding which product lines to keep, reprice, or drop - the per-line margins and mix chart show which lines cover their cost of goods and which only look significant because their revenue is large.
  • Comparing customer segments before negotiating prices - a segment can look attractive by total revenue while its margin per dollar is the thinnest in the book.
  • Checking whether a quarter-over-quarter drop in overall margin is genuine cost pressure or just a mix shift toward lower-margin products.

Limits and checks

  • Gross margin is not contribution margin. With only cost of goods sold entered, you get gross margin; contribution margin needs variable costs, and quietly classifying fixed overhead as variable inflates it.
  • The overall figure is revenue-weighted, so it differs from the simple average of the line margins. That gap is the mix effect: the total can fall with no line's own margin changing, purely because low-margin sales grew.
  • Percentages hide scale. A high-margin line with tiny revenue contributes little profit, and reclassifying a cost between 'cost of goods sold' and 'operating expenses' changes the result without the business itself changing.

Common questions

Why does my overall margin not match the average of my product margins?

Because the overall margin weights each line by its revenue, not equally. If the high-margin line carries most of the revenue, the total sits closer to its margin; averaging the lines treats each as equally important, which is why the two numbers differ. The gap between them is exactly the mix effect the tool charts.

Does this include fixed costs like rent, salaries, and marketing?

No. Gross margin stops at cost of goods sold, so fixed operating costs are not in the result. Contribution margin comes closer, but only for costs you classify as variable - rent and salaries typically stay out. For the bottom line after all operating costs, you need operating margin, which this tool does not compute.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools