Gross Margin Calculator
Work out real margins per product and customer, including the costs people forget.
Version 1.0.0 · Updated Aug 4, 2026
Overview
Key benefits
- No installation and no account required
- Runs entirely in your browser
- Your data stays on your computer
- Print-friendly reports
How it works
- 1Download the HTML file
- 2Open it in your browser
- 3Enter your information
- 4Save the project file locally
How to use Gross Margin Calculator
The complete in-tool guidance, reproduced here so you can read it before you download.
What this tool does
CM8-09 works out the true gross margin of a product or job — not just price minus material, but price minus everything that varies with each unit sold: material, labour, subcontract work, freight both ways, packaging, scrap, commissions and payment fees. It then rolls your whole product list into a blended portfolio view, floats the worst margins to the top, and tells you the break-even point for your fixed costs.
Everything runs inside this single HTML file. No installation, no account, no network requests — your prices, costs and volumes never leave your computer.
Margin vs markup — they are not the same number
This is the most expensive confusion in small-business pricing. Both describe the same profit, but against different bases:
Gross margin % = (Price − Cost) / Price × 100 ← profit over PRICE Markup % = (Price − Cost) / Cost × 100 ← profit over COST
Example: cost 100, price 150. The markup is 50 %, but the margin is only 33.3 %. If your accountant says “we need 40 % margin” and you apply a 40 % markup, you actually earn a 28.6 % margin — an 11-point shortfall on every sale.
- Markup applied to cost — Resulting margin
- +25 % — 20.0 %
- +33 % — 25.0 %
- +50 % — 33.3 %
- +100 % — 50.0 %
- +150 % — 60.0 %
Rule of thumb: margin is always the smaller number. To convert: margin = markup / (1 + markup) and markup = margin / (1 − margin) (as decimals).
The costs people forget
Most “40 % margin” products are really 25 % products once the quiet costs are counted. The line builder puts them front and centre:
- Freight in — inbound shipping is part of material cost (accountants call it “landed cost”). A 5 % freight bill on materials silently eats margin.
- Freight out — “free shipping” is never free; if you absorb it, it is a variable selling cost of every unit.
- Packaging — cartons, void fill, labels, pallets, strapping.
- Scrap & rework — if 5 % of production is scrapped or reworked, every good unit carries that cost. The tool uplifts material, inbound freight, labour and subcontract cost by your allowance.
- Commissions — sales rep, marketplace or platform fees taken as a percentage of the selling price.
- Payment fees — card processing typically takes 1.5–3.5 % of the sale.
- Outsourced operations — plating, painting, heat treating, assembly done by others; easy to omit when quoting from a bill of materials.
- Other direct costs — amortised tooling, consumables, licence royalties, warranty reserves.
The cost model, exactly
Labour = hours × rate Production base = material + freight in + labour + outsourced Scrap uplift = production base × scrap % Total direct cost = production base + scrap uplift + packaging + other Gross margin = price − total direct cost Variable selling = commission%·price + fee%·price + freight out Contribution = gross margin − variable selling
Why two profit lines? Gross margin is the classic accounting measure — price less cost of goods. Contribution goes one step further and removes the costs that only occur because a sale happened (commission, card fee, outbound freight). Contribution is the number that pays your fixed costs, so it drives the break-even helper.
Scrap deliberately does not uplift packaging or outbound freight: scrapped units are (usually) never packed or shipped. If your process scraps packed goods, fold that into the allowance percentage.
Target pricing: divide, never multiply
To hit a target margin, the required price is:
Price = Cost / (1 − target margin) ← gross basis Price = (Cost + freight out) / (1 − target − commission% − fee%) ← contribution basis
Multiplying cost by (1 + target) gives a markup, not a margin, and undershoots every time. The solver in the Line Builder does the division for you and offers both bases; the contribution basis is the honest one when commissions and fees scale with price (raising the price also raises those costs, and the divisor accounts for that).
Worked example. Direct cost 170.00, freight out 6.00, commission 5 %, card fee 2 %, target 30 %. Gross basis: 170 / 0.70 = 242.86. Contribution basis: 176 / (1 − 0.30 − 0.05 − 0.02) = 176 / 0.63 = 279.37. At 242.86 your contribution would only be about 20.5 % — the fees ate the difference.
Portfolio & break-even
- Volumes: enter expected units per period (month, quarter — your choice, just be consistent). Edit them directly in the table.
- Blended margin is total margin ÷ total revenue — a revenue-weighted average, so one high-volume low-margin line can drag the whole book down.
- Worst-first sorting puts the lines that need repricing at the top. Lines below your flag threshold are marked LOW; negative-margin lines are marked LOSS in both text and colour.
- Break-even: with fixed costs F and blended contribution ratio r, break-even revenue = F / r. Break-even units divide F by the average contribution per unit at the current mix — both are only valid while the mix holds.
Saving your work
- Autosave: your lines, editor inputs and settings are kept in this browser's local storage automatically (see the indicator in the top bar) and restored the next time you open the file.
- Save project (.json): a complete portable snapshot — move it between machines or keep it with the job file.
- Export CSV: every input and computed column, ready for a spreadsheet or ERP import.
- Print report: a clean portfolio sheet via your browser's print dialog (save as PDF works too).
- Currency is a label only — changing it never converts values.
Scope & limits
- This is a direct-cost (variable-cost) margin tool. It does not allocate overhead into unit cost; overhead belongs in the fixed-cost line of the break-even helper. That is deliberate — absorption costing hides which products actually contribute.
- Taxes (sales tax, VAT/GST) are excluded: enter tax-exclusive prices and costs.
- Volume discounts, tiered commissions and stepped fixed costs are not modelled — duplicate a line per tier if you need that.
- All results are estimates from your inputs. Verify against your accounts before committing prices.
Disclaimer
Verify important calculations independently. Tools are provided for informational and planning purposes and do not replace professional engineering, accounting, legal, tax or safety advice.