{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"margin-markup"},"result":{"entity_type":"calculator","id":"margin-markup","calculator_id":"margin-markup","canonical_url":"https://tttkmbb.com/finance/margin-markup","name":"Margin and Markup Calculator","title":"Margin and Markup Calculator – Profit, Gross Margin and Markup from Cost and Price","category":"finance","category_name":"Finance","tool_name":"calculate_margin_markup","featured_mcp_tool":false,"description":"Computes profit, gross margin percentage and markup percentage from a unit cost and a selling price, or derives the selling price from cost plus a target margin or markup.","use_when":"You are pricing a product or service and need to convert between cost, price, margin (profit as % of price) and markup (profit as % of cost).","do_not_use_when":"You need the sales volume that covers fixed costs (use break-even) or the tax on the price (use sales-tax / vat).","inputs":[{"name":"cost","label":"Cost","type":"number","required":true,"max":1000000000000,"exclusive_min":0,"description":"Cost of goods or unit cost.","example":50},{"name":"price","label":"Selling price","type":"number","required":false,"min":0,"max":1000000000000,"description":"Selling price. Give price, margin_percent or markup_percent (in that order of precedence).","example":80},{"name":"margin_percent","label":"Target margin","type":"number","unit":"%","required":false,"min":-1000,"exclusive_max":100,"description":"Desired gross margin as percent of price; used when price is omitted.","example":37.5},{"name":"markup_percent","label":"Target markup","type":"number","unit":"%","required":false,"min":-100,"max":100000,"description":"Desired markup as percent of cost; used when price and margin_percent are omitted.","example":60}],"outputs":[{"name":"price","label":"Selling price","type":"number","decimals":2,"description":"Given or derived selling price."},{"name":"profit","label":"Gross profit","type":"number","decimals":2,"description":"price − cost."},{"name":"margin_percent","label":"Gross margin","type":"number","unit":"%","decimals":2,"description":"profit / price × 100."},{"name":"markup_percent","label":"Markup","type":"number","unit":"%","decimals":2,"description":"profit / cost × 100."},{"name":"solved_from","label":"Solved from","type":"string","decimals":4,"description":"Which input determined the price: price, margin_percent or markup_percent."}],"input_schema":{"type":"object","properties":{"cost":{"description":"Cost of goods or unit cost.","type":"number","maximum":1000000000000,"exclusiveMinimum":0,"examples":[50]},"price":{"description":"Selling price. Give price, margin_percent or markup_percent (in that order of precedence).","type":"number","minimum":0,"maximum":1000000000000,"examples":[80]},"margin_percent":{"description":"Desired gross margin as percent of price; used when price is omitted. Unit: %.","type":"number","minimum":-1000,"exclusiveMaximum":100,"examples":[37.5],"x-unit":"%"},"markup_percent":{"description":"Desired markup as percent of cost; used when price and margin_percent are omitted. Unit: %.","type":"number","minimum":-100,"maximum":100000,"examples":[60],"x-unit":"%"}},"additionalProperties":false,"required":["cost"]},"output_schema":{"type":"object","properties":{"price":{"description":"Given or derived selling price.","type":"number"},"profit":{"description":"price − cost.","type":"number"},"margin_percent":{"description":"profit / price × 100. Unit: %.","type":"number","x-unit":"%"},"markup_percent":{"description":"profit / cost × 100. Unit: %.","type":"number","x-unit":"%"},"solved_from":{"description":"Which input determined the price: price, margin_percent or markup_percent.","type":"string"}}},"formula":"profit = price − cost; margin_percent = profit / price × 100; markup_percent = profit / cost × 100; price from margin = cost / (1 − margin_percent/100); price from markup = cost × (1 + markup_percent/100)","method":"Margin and markup describe the same profit relative to different bases (price vs cost), so markup is always the larger number: margin = markup / (1 + markup) and markup = margin / (1 − margin) in fractional form.","sources":[{"name":"Investopedia – Profit Margin vs. Markup: What's the Difference?","url":"https://www.investopedia.com/ask/answers/102714/whats-difference-between-profit-margin-and-markup.asp","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Gross margin","url":"https://en.wikipedia.org/wiki/Gross_margin","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Markup (business)","url":"https://en.wikipedia.org/wiki/Markup_(business)","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"Cost 50, price 80","inputs":{"cost":50,"price":80},"expected":{"price":80,"profit":30,"margin_percent":37.5,"markup_percent":60,"solved_from":"price"},"url":"https://tttkmbb.com/api/v1/calculate/margin-markup?cost=50&price=80"},{"name":"Cost 40, target margin 25 %","inputs":{"cost":40,"margin_percent":25},"expected":{"price":53.33,"profit":13.33,"margin_percent":25,"markup_percent":33.33,"solved_from":"margin_percent"},"url":"https://tttkmbb.com/api/v1/calculate/margin-markup?cost=40&margin_percent=25"}],"faq":[{"q":"Why is a 50 % markup only a 33.3 % margin?","a":"Markup is measured on cost, margin on price. Cost 100 with 50 % markup sells for 150; the 50 profit is 33.3 % of the 150 price."},{"q":"Can margin be 100 %?","a":"No: a 100 % margin would require zero cost, so margin_percent must be below 100. Markup has no upper limit."}],"tags":["margin calculator","markup calculator","gross margin","markup vs margin","pricing","profit"],"related":[{"calculator_id":"break-even","reason":"Units needed to cover fixed costs at this contribution margin."},{"calculator_id":"vat","reason":"Add VAT on top of the net selling price."},{"calculator_id":"discount","reason":"Effect of a discount on the selling price."}],"links":{"html":"https://tttkmbb.com/finance/margin-markup","markdown":"https://tttkmbb.com/finance/margin-markup.md","json":"https://tttkmbb.com/finance/margin-markup.json","api":"https://tttkmbb.com/api/v1/calculate/margin-markup","schema":"https://tttkmbb.com/api/v1/calculators/margin-markup","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:24:45Z","next_actions":[{"tool":"run_calculator","calculator_id":"margin-markup","reason":"Run Margin and Markup Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/finance/margin-markup.md"}}