Numbers math markup vs margin
Exactnumbers_math_markup_vs_marginDeterministic and authoritative — the canonical answer for this input.
Compute both markup (profit/cost) and margin (profit/price) from cost and price. These percentages are commonly confused; returning both together lets callers pick the right one deliberately.
Parameters
costnumberrequiredpricenumberrequiredCall it
curl -X POST https://api.snipget.ai/v1/numbers/math/markup-vs-margin \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"cost":80,"price":100}'Example response
{
"cost": 80,
"price": 100,
"profit": 20,
"markup_fraction": 0.25,
"markup_display": "25.00%",
"margin_fraction": 0.2,
"margin_display": "20.00%"
}FAQ
Aren't markup and margin the same thing?
No, and confusing them is one of the most common pricing mistakes. On an item that costs 80 and sells for 100, the markup is 25% (profit over cost) but the margin is only 20% (profit over price). This tool returns both, clearly labeled, plus the raw profit, so you use the right one.
Which number should I quote to a customer or in a report?
Margin is the share of the sale price you keep, and markup is how much you added on top of cost. This gives you both as fractions and as ready-to-show percentages, but it does not advise which to use, that is your business call.
What do I pass in?
Just the cost and the price as numbers. Both must be positive. The tool computes profit, markup, and margin from those two values alone.
Is the math exact?
Yes. It is a deterministic calculation, so the same cost and price always produce the same authoritative answer, no rounding surprises beyond the two-decimal display string.
What if I send a zero or negative cost?
You get a result flagged is_valid false with a why_invalid reason and confidence 0, rather than an error or a divide-by-zero crash.