Markup to margin converter
An 80 cost with a 25% markup sells for 100, which is only a 20% margin. Enter the cost and either the markup or the margin to get the selling price, the profit and the other percentage. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Cost
- 80
- Markup
- 25
- Margin
- 20
- Selling price
- 100
- Profit
- 20
- Solved
- margin
Retail teams constantly confuse markup with margin even though both describe the same markup of cost into a list price. Markup is profit as a percentage of cost; margin is profit as a percentage of selling price. A twenty-five percent markup on an eighty-dollar cost is a one-hundred-dollar sell and a twenty percent margin—not the same number, and getting them mixed up quietly erodes target gross profit. A margin of one hundred percent is rejected with invalid input because it would imply an infinite selling price.
How markup, margin, selling price, and profit are computed
The identities are the ones taught in merchandising and managerial accounting. When markup is known, selling price equals cost times one plus markup divided by one hundred, profit equals selling price minus cost, and margin equals markup divided by one hundred plus markup, then multiplied by one hundred. When margin is known, selling price equals cost divided by one minus margin over one hundred, profit equals selling price minus cost, and markup equals margin divided by one hundred minus margin, then multiplied by one hundred.
Example: cost eighty with markup twenty-five yields selling price one hundred, margin twenty, and profit twenty. Example: cost fifty with margin twenty yields selling price sixty-two point five, markup twenty-five, and profit twelve point five.
What you can do with it
Retail shelf and catalog pricing
Merchants convert a cost-plus markup target into the gross margin finance expects, and lock the resulting selling price into the catalog.
Vendor and wholesale negotiations
Buyers given a margin goal reverse it into the markup (and list price) they can defend when cost quotes change.
FAQ
What is the difference between markup and margin?
Markup is profit as a percentage of cost. Margin is profit as a percentage of selling price. A 25% markup on cost is a 20% margin on the selling price, not the same number.
How do I convert markup to margin with this calculator?
To convert the other way, send cost and margin instead.
What happens if margin is 100 percent?
A 100% margin would require an infinite selling price because the denominator (1 − margin/100) becomes zero; such requests are not charged.
Can I send both markup and margin?
No. Provide exactly one of markup or margin plus cost. Sending both or neither fails validation so the engine does not have to choose which rate is authoritative.
Is the markup to margin converter free?
The browser tool runs free on your device.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/life/markup-margin \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"cost":80,"markup":25}'const res = await fetch("https://api.kit.forhosting.com/life/markup-margin", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"cost": 80,
"markup": 25
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/life/markup-margin",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"cost": 80,
"markup": 25
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/life/markup-margin", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"cost":80,"markup":25}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"cost":80,"markup":25}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/life/markup-margin", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"cost": 80,
"markup": 25
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "life.markup_margin",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Inputs: cost plus exactly one of markup or margin
Margin is gross margin as a percent of selling price: twenty means twenty percent of the list price is profit. Cost must be strictly positive; zero or negative cost is rejected because selling-price formulas divide by cost when recovering markup. Negative markup or margin percentages are out of scope for this retail converter and fail validation. Margin must stay strictly below one hundred percent; the special case of margin equal to one hundred percent is called out in the error message because one minus margin over one hundred becomes zero and selling price is undefined. All checks run before any money math, so bad requests never produce a half-filled price row. Send a JSON body with a required positive cost and exactly one percentage field. Cost is the acquisition or production amount in any single currency you already track—aliases cost_price, cogs, wholesale, and purchase_price are accepted when your client already names the field differently. Markup is the uplift expressed as a percent of that cost: twenty-five means twenty-five percent markup, so selling price equals cost times one plus markup over one hundred. Aliases markup_percent, markup_pct, and mu map to markup; margin_percent, margin_pct, gross_margin, and ma map to margin. Provide exactly one of the two rates—both present or both missing fails with invalid_input so the engine never has to guess which number is authoritative. Extremely large costs or markups are capped so Worker isolate arithmetic stays bounded.
How markup, margin, selling price, and profit are computed
Money fields cost, selling_price, and profit are rounded half-up to two decimal places so results look like currency on a quote rather than long binary fractions. Percentage fields are rounded with a fine stable scale so goldens and SDK demos pin cleanly. The response echoes normalized cost, both percentages, selling_price, profit, a solved flag equal to margin or markup naming which rate was derived, method equal to markup_margin, and a formulas object documenting the four identities for UI tooltips. Use markup alone when buyers speak in cost-plus language; use margin alone when finance speaks in gross-margin targets; use selling_price when a storefront needs the list amount. Identical inputs always produce identical JSON because the path is pure arithmetic with no network, no random seed, and no wall clock.
API usage, pricing, retail workflows, and practical limits
Call the free in-browser markup to margin converter for shelf pricing workshops, vendor negotiations, and classroom exercises without installing a spreadsheet. Keep costs within ordinary commercial ranges; extreme values are rejected so isolate math stays bounded. The product promise is the classical single-item markup-versus-margin conversion with an explicit guard against one-hundred-percent margin—not multi-product baskets, promotional stacking, or dynamic competitor matching, which belong in specialized tools with different SEO intent. Use the prepaid API when a catalog importer, ERP connector, ecommerce rule engine, or pricing chatbot needs a stable KIT contract at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with currency converters only if you already know amounts in one currency—this capability does not convert FX, apply sales tax, or layer shipping. Authors shipping SDKs can map markup, margin, selling_price, and profit directly into pricing tables and quote builders.
Integration use cases
Pricing bots and ERP connectors
Automations call a stable prepaid endpoint instead of reimplementing markup↔margin formulas and the 100% margin guard in every language.