{
  "id": "gross-margin",
  "version": "c5461827986d",
  "status": "published",
  "name": "Gross Margin Calculator",
  "question": "What is my gross margin?",
  "summary": "Computes gross profit and gross margin (gross profit as a percent of revenue) from revenue and cost of goods sold, or any two of the four.",
  "category": "finance",
  "subcategory": "business",
  "url": "https://www.acalculator.org/finance/gross-margin-calculator",
  "markdown": "https://www.acalculator.org/finance/gross-margin-calculator.md",
  "kind": "formulas",
  "method": "M = P ÷ R × 100, where P = R − C. C is the cost of goods sold, R the revenue, P the gross profit and M the gross margin.",
  "assumptions": [
    "The cost of goods sold and the revenue are more than 0.",
    "The margin is a percent of the revenue (the selling price); the markup is a percent of the cost.",
    "A loss gives a negative profit and a negative margin. Margins run from −1,000% (a cost 11 times the revenue) to just under 100%; numbers outside that range, or that need a cost or revenue of 0 or less, have no answer."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "revenue": {
        "title": "Revenue",
        "description": "Net sales: sales minus returns, allowances and discounts.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "cost": {
        "title": "Cost of goods sold",
        "description": "The direct cost of the goods or services sold (COGS, also called cost of sales).",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "margin": {
        "title": "Gross margin",
        "description": "Gross profit as a percent of revenue: gross profit ÷ revenue × 100.",
        "type": "number",
        "x-unit": "percent",
        "minimum": -1000,
        "exclusiveMaximum": 100
      },
      "profit": {
        "title": "Gross profit",
        "description": "Revenue minus the cost of goods sold. Negative for a gross loss.",
        "type": "number",
        "x-unit": "USD",
        "minimum": -1000000000000,
        "maximum": 1000000000000
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "revenue",
      "cost",
      "margin",
      "profit"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "revenue": {
      "label": "Revenue",
      "description": "Net sales: sales minus returns, allowances and discounts.",
      "format": "money"
    },
    "cost": {
      "label": "Cost of goods sold",
      "description": "The direct cost of the goods or services sold (COGS, also called cost of sales).",
      "format": "money"
    },
    "margin": {
      "label": "Gross margin",
      "description": "Gross profit as a percent of revenue: gross profit ÷ revenue × 100.",
      "format": "percent"
    },
    "profit": {
      "label": "Gross profit",
      "description": "Revenue minus the cost of goods sold. Negative for a gross loss.",
      "format": "money"
    },
    "markup": {
      "label": "Markup",
      "description": "The profit as a percent of the cost: P ÷ C × 100.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "revenue": 500000,
      "cost": 300000
    },
    "outputs": {
      "margin": 40,
      "profit": 200000,
      "markup": 66.66666666666666
    },
    "text": "Revenue of $500,000.00 with $300,000.00 cost of goods sold is a gross profit of $200,000.00, a 40% gross margin."
  },
  "examples": [
    {
      "given": {
        "revenue": 1200000,
        "cost": 780000
      },
      "expect": {
        "profit": 420000,
        "margin": 35,
        "markup": 53.84615384615385
      },
      "source": "hand calculation in content.mdx: 1,200,000 − 780,000 = 420,000; 420,000 ÷ 1,200,000 × 100 = 35%; 420,000 ÷ 780,000 × 100 = 53.85%"
    },
    {
      "given": {
        "revenue": 80000,
        "margin": 45
      },
      "expect": {
        "profit": 36000,
        "cost": 44000
      },
      "source": "hand calculation in content.mdx: 80,000 × 0.45 = 36,000; 80,000 − 36,000 = 44,000"
    },
    {
      "given": {
        "cost": 26000,
        "margin": 35
      },
      "expect": {
        "revenue": 40000,
        "profit": 14000
      },
      "source": "hand calculation in content.mdx: 26,000 ÷ (1 − 0.35) = 40,000; 40,000 − 26,000 = 14,000"
    },
    {
      "given": {
        "profit": 9000,
        "margin": 60
      },
      "expect": {
        "revenue": 15000,
        "cost": 6000,
        "markup": 150
      },
      "source": "hand calculation in content.mdx: 9,000 ÷ 0.60 = 15,000; 15,000 − 9,000 = 6,000; 9,000 ÷ 6,000 × 100 = 150%"
    }
  ],
  "sources": [
    "U.S. Securities and Exchange Commission, Beginners' Guide to Financial Statements (net revenues are sales minus returns and allowances; gross profit is net revenues minus cost of sales). https://www.sec.gov/about/reports-publications/beginners-guide-financial-statements",
    "Hand derivation of the rearrangements from gross margin = (revenue − COGS) ÷ revenue × 100 (shown in full below)."
  ],
  "related": [
    "margin",
    "markup",
    "percentage"
  ],
  "changelog": []
}
