{
  "id": "markup",
  "version": "77e56f96c14e",
  "status": "published",
  "name": "Markup Calculator",
  "question": "What is my markup and margin?",
  "summary": "Computes the selling price, profit, markup and profit margin from any two of the cost, the revenue, the profit and a markup or margin percent.",
  "category": "math",
  "subcategory": "percentages",
  "url": "https://www.acalculator.org/math/markup-calculator",
  "markdown": "https://www.acalculator.org/math/markup-calculator.md",
  "kind": "formulas",
  "method": "P = R − C; markup M = P ÷ C × 100, so R = C × (1 + M ÷ 100); margin G = P ÷ R × 100, so C = R × (1 − G ÷ 100). C is the cost, R the revenue (selling price), P the profit.",
  "assumptions": [
    "Markup is the profit as a percent of the cost; margin is the profit as a percent of the selling price.",
    "The cost and the selling price are more than 0. A loss gives a negative profit, markup and margin.",
    "Limits hold for typed and worked-out values alike: cost and revenue above 0 and at most 1 trillion, profit within ± 1 trillion, percent −99% or more. An answer outside a limit is no answer.",
    "A margin of 100% or more has no answer, because the cost would be 0 or less.",
    "Arithmetic is exact on the typed decimals; money shows to the cent, halves away from 0 (420.175 shows as $420.18)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "cost": {
        "title": "Cost",
        "description": "What the item costs you to buy or make.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "rate": {
        "title": "Percent",
        "description": "The markup (profit ÷ cost × 100) or the margin (profit ÷ revenue × 100), as chosen above. Negative for a loss.",
        "type": "number",
        "x-unit": "percent"
      },
      "revenue": {
        "title": "Revenue",
        "description": "The selling price.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "profit": {
        "title": "Profit",
        "description": "The selling price minus the cost. Negative for a loss.",
        "type": "number",
        "x-unit": "USD",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      },
      "basis": {
        "title": "The percent is",
        "description": "Whether the percent is a markup (profit as a percent of the cost) or a margin (of the price).",
        "type": "string",
        "enum": [
          "markup",
          "margin"
        ]
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "cost",
      "rate",
      "revenue",
      "profit"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "cost": {
      "label": "Cost",
      "description": "What the item costs you to buy or make.",
      "format": "money"
    },
    "rate": {
      "label": "Percent",
      "description": "The markup (profit ÷ cost × 100) or the margin (profit ÷ revenue × 100), as chosen above. Negative for a loss.",
      "format": "percent"
    },
    "revenue": {
      "label": "Revenue",
      "description": "The selling price.",
      "format": "money"
    },
    "profit": {
      "label": "Profit",
      "description": "The selling price minus the cost. Negative for a loss.",
      "format": "money"
    },
    "markup": {
      "label": "Markup",
      "description": "The profit as a percent of the cost: P ÷ C × 100.",
      "format": "percent"
    },
    "margin": {
      "label": "Margin",
      "description": "The profit as a percent of the revenue (gross margin): P ÷ R × 100.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "basis": "markup",
      "cost": 100,
      "rate": 25
    },
    "outputs": {
      "revenue": 125,
      "profit": 25,
      "markup": 25,
      "margin": 20
    },
    "text": "A cost of $100.00 sells for $125.00: a profit of $25.00, a 25% markup and a 20% margin."
  },
  "examples": [
    {
      "given": {
        "basis": "markup",
        "cost": 100,
        "rate": 25
      },
      "expect": {
        "revenue": 125,
        "profit": 25,
        "markup": 25,
        "margin": 20
      },
      "source": "hand calculation in content.mdx: 100 × 1.25 = 125; 125 − 100 = 25; 25 ÷ 125 × 100 = 20%; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    },
    {
      "given": {
        "basis": "margin",
        "cost": 50,
        "rate": 20
      },
      "expect": {
        "revenue": 62.5,
        "profit": 12.5,
        "markup": 25
      },
      "source": "hand calculation in content.mdx: 50 ÷ (1 − 0.2) = 62.5; 12.5 ÷ 50 × 100 = 25%; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    },
    {
      "given": {
        "basis": "markup",
        "revenue": 200,
        "profit": 50
      },
      "expect": {
        "cost": 150,
        "rate": 33.33333333333333,
        "margin": 25
      },
      "source": "hand calculation in content.mdx: 200 − 50 = 150; 50 ÷ 150 × 100 = 33.33%; 50 ÷ 200 × 100 = 25%; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    },
    {
      "given": {
        "basis": "markup",
        "cost": 40,
        "revenue": 60
      },
      "expect": {
        "profit": 20,
        "rate": 50,
        "margin": 33.33333333333333
      },
      "source": "old page FAQ: a $40 cost sold for $60 is a 50% markup; hand calculation in content.mdx; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    },
    {
      "given": {
        "basis": "markup",
        "revenue": 80,
        "rate": 60
      },
      "expect": {
        "cost": 50,
        "profit": 30
      },
      "source": "old page FAQ: $80 ÷ (1 + 60 ÷ 100) = $50; hand calculation in content.mdx; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    },
    {
      "given": {
        "basis": "margin",
        "profit": 30,
        "rate": 25
      },
      "expect": {
        "revenue": 120,
        "cost": 90,
        "markup": 33.33333333333333
      },
      "source": "hand calculation in content.mdx: 30 ÷ 0.25 = 120; 120 − 30 = 90; 30 ÷ 90 × 100 = 33.33%; OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
    }
  ],
  "sources": [
    "OpenStax, Prealgebra 2e, §6.3 Solve Sales Tax, Commission, and Discount Applications (discount and mark-up). https://openstax.org/books/prealgebra-2e/pages/6-3-solve-sales-tax-commission-and-discount-applications"
  ],
  "related": [
    "discount",
    "percentage"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "A margin of 100% or more names the rule."
    },
    {
      "date": "2026-09-28",
      "note": "Exact decimal arithmetic, so 420.175 shows as $420.18; the revenue chart uses each percent at this cost."
    },
    {
      "date": "2026-09-29",
      "note": "The percent has no −99% floor, so a margin below −99% has an answer; a markup of −100% or less gives a message (muse review)."
    },
    {
      "date": "2026-09-29",
      "note": "Worked examples name a published reference for their rule."
    }
  ]
}
