# Margin calculator > How much margin do you make on a sale? See the profit margin, markup and profit from cost and selling price. Work out profit margin and markup from a unit's cost and selling price, with or without VAT. See the profit per sale and the price without VAT. - Page: https://how.box/margin/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/margin/?currency={currency}&c={c}&p={p}&v={v}&m={m}&t={t} - `currency` (AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UYW, UZS, VES, VND, VUV, WST, XAF, XCD, XCG, XDR, XOF, XPF, XSU, YER, ZAR, ZMW, ZWG or ZWL): Currency the amounts are in (ISO 4217); no conversion. Example: `EUR`. - `c` (number 0.01 to 1e9): Unit cost excluding VAT. Example: `60`. - `p` (number 0.01 to 1e9): Selling price including the VAT in v (mode margin). Example: `100`. - `v` (number 0 to 100): VAT percent included in the price. Example: `0`. - `m` (margin or price): What to find: margin (default) or price. Example: `price`. - `t` (number 0 to 100): Target margin percent (mode price). Example: `40`. Example answer: https://how.box/margin/?currency=EUR&c=60&p=100&v=0&m=price&t=40 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `margin_calculate`: Profit margin and markup of one unit from its cost (excluding VAT) and selling price (including vat_percent VAT; 0 when the price is net), both in the same currency. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"margin_calculate","arguments":{"currency":"EUR","cost":60,"price":100,"vat_percent":0,"mode":"price","target_margin_percent":40}}}` - GET: https://how.box/mcp/run/margin_calculate?currency=EUR&cost=60&price=100&vat_percent=0&mode=price&target_margin_percent=40 ## How it works Margin and markup both compare your profit with a price, but with different prices. Margin divides the profit by the selling price, markup divides it by the cost. That is why the same sale always has a bigger markup than margin. With a cost C and a selling price P without VAT, the profit is P − C, the margin is (P − C) ÷ P × 100 and the markup is (P − C) ÷ C × 100. A price that includes VAT is first divided by (1 + VAT rate), because VAT goes to the state, not to you. The definitions follow OpenStax, Contemporary Mathematics, section 6.2. This is the gross margin of one unit. Overheads, discounts, shipping and income tax are not included. A negative result means you sell at a loss. ## FAQ **What is the difference between margin and markup?** Margin is profit as a share of the selling price, markup is profit as a share of the cost. A €40 profit on a €100 price is a 40% margin, but a 66.7% markup on the €60 cost. **Should I enter prices with or without VAT?** Enter the cost without VAT. For the selling price, enter what the customer pays and the VAT rate it includes, or the net price with VAT at 0%. **Can the margin be over 100%?** No. Margin stays below 100% because the profit is always less than the price. Markup has no upper limit: selling at three times the cost is a 200% markup. **How do I turn a markup into a margin?** Margin = markup ÷ (100 + markup) × 100. A 50% markup is a 33.3% margin. **Can the result show a loss?** Yes. If the selling price without VAT is below cost, profit, margin and markup are negative. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)