{
  "id": "gross-profit",
  "version": "fbe4f93cec2d",
  "status": "published",
  "name": "Gross Profit Calculator",
  "question": "What is my gross profit?",
  "summary": "Computes gross profit from sales, returns, discounts and the cost of goods sold (typed, or from beginning inventory, purchases and ending inventory), with the gross margin and markup.",
  "category": "finance",
  "subcategory": "business",
  "url": "https://www.acalculator.org/finance/gross-profit-calculator",
  "markdown": "https://www.acalculator.org/finance/gross-profit-calculator.md",
  "kind": "function",
  "method": "Net sales = sales − returns and allowances − discounts; COGS = typed, or inventory at start + purchases − inventory at end; gross profit = net sales − COGS; gross margin = gross profit ÷ net sales × 100; markup = gross profit ÷ COGS × 100.",
  "assumptions": [
    "All amounts cover the same period (a month, quarter or year).",
    "Cost of goods sold holds only direct costs; rent, marketing and office salaries are operating expenses and are not taken off.",
    "Purchases are net of any items you took out for personal use (IRS Publication 334)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "sales": {
        "title": "Sales",
        "description": "Everything you sold in the period, before returns and discounts.",
        "type": "number",
        "x-unit": "USD",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000
      },
      "returns": {
        "title": "Returns and allowances",
        "description": "Refunds and credits you gave customers for returned or faulty goods.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "disc": {
        "title": "Sales discounts",
        "description": "Discounts you gave off the sales price, such as early-payment discounts.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "from": {
        "title": "Cost of goods sold",
        "description": "Whether you type the cost of goods sold or work it out from your inventory.",
        "type": "string",
        "enum": [
          "typed",
          "inventory"
        ]
      },
      "cogs": {
        "title": "Cost of goods sold",
        "description": "The direct cost of what you sold: goods bought for resale, materials and production labor.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "begin": {
        "title": "Inventory at start",
        "description": "The value of your stock at the start of the period.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "buy": {
        "title": "Purchases",
        "description": "What you bought for resale or production during the period, including freight in.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "end": {
        "title": "Inventory at end",
        "description": "The value of your stock left at the end of the period.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000000
      }
    }
  },
  "outputs": {
    "profit": {
      "label": "Gross profit",
      "description": "Net sales minus the cost of goods sold.",
      "format": "money"
    },
    "netSales": {
      "label": "Net sales",
      "description": "Sales minus returns and allowances and sales discounts.",
      "format": "money"
    },
    "cost": {
      "label": "Cost of goods sold",
      "description": "Typed, or inventory at start + purchases − inventory at end.",
      "format": "money"
    },
    "margin": {
      "label": "Gross margin",
      "description": "Gross profit as a percent of net sales.",
      "format": "percent"
    },
    "markup": {
      "label": "Markup",
      "description": "Gross profit as a percent of the cost of goods sold.",
      "format": "percent"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "sales": 250000,
      "returns": 5000,
      "disc": 0,
      "from": "typed",
      "cogs": 145000,
      "begin": 40000,
      "buy": 150000,
      "end": 45000
    },
    "outputs": {
      "profit": 100000,
      "netSales": 245000,
      "cost": 145000,
      "margin": 40.816326530612244,
      "markup": 68.96551724137932
    },
    "text": "Net sales of $245,000.00 less $145,000.00 cost of goods sold is a gross profit of $100,000.00, a 40.82% gross margin."
  },
  "examples": [
    {
      "given": {
        "sales": 1200000,
        "returns": 0,
        "disc": 0,
        "from": "typed",
        "cogs": 780000
      },
      "expect": {
        "profit": 420000,
        "margin": 35,
        "markup": 53.84615384615385
      },
      "source": "U.S. Securities and Exchange Commission, Beginners' Guide to Financial Statements (gross profit is net revenues minus cost of sales). https://www.sec.gov/about/reports-publications/beginners-guide-financial-statements; hand calculation in content.mdx: 1,200,000 − 780,000 = 420,000; 420,000 ÷ 1,200,000 = 35%"
    },
    {
      "given": {
        "sales": 250000,
        "returns": 5000,
        "disc": 0,
        "from": "inventory",
        "begin": 40000,
        "buy": 150000,
        "end": 45000
      },
      "expect": {
        "netSales": 245000,
        "cost": 145000,
        "profit": 100000,
        "margin": 40.816326530612244
      },
      "source": "IRS Publication 334 (2025), Tax Guide for Small Business, chapter 6, Cost of Goods Sold (inventory at beginning of year + purchases − inventory at end of year). https://www.irs.gov/publications/p334; hand calculation in content.mdx: 40,000 + 150,000 − 45,000 = 145,000; 250,000 − 5,000 − 145,000 = 100,000"
    },
    {
      "given": {
        "sales": 100.1,
        "returns": 0.05,
        "disc": 0,
        "from": "typed",
        "cogs": 50.05
      },
      "expect": {
        "profit": 50,
        "netSales": 100.05
      },
      "source": "U.S. Securities and Exchange Commission, Beginners' Guide to Financial Statements (net revenues are sales minus returns and allowances). https://www.sec.gov/about/reports-publications/beginners-guide-financial-statements; hand calculation in content.mdx: 100.10 − 0.05 − 50.05 = 50.00"
    },
    {
      "given": {
        "sales": 10000,
        "returns": 0,
        "disc": 500,
        "from": "typed",
        "cogs": 11000
      },
      "expect": {
        "profit": -1500,
        "margin": -15.789473684210526
      },
      "source": "U.S. Securities and Exchange Commission, Beginners' Guide to Financial Statements. https://www.sec.gov/about/reports-publications/beginners-guide-financial-statements; hand calculation in content.mdx: 10,000 − 500 − 11,000 = −1,500; −1,500 ÷ 9,500 = −15.79%"
    }
  ],
  "sources": [
    "U.S. Securities and Exchange Commission, Beginners' Guide to Financial Statements (net revenues = gross revenues − returns and allowances; gross profit = net revenues − cost of sales). https://www.sec.gov/about/reports-publications/beginners-guide-financial-statements (retrieved 2026-10-01)",
    "IRS Publication 334 (2025), Tax Guide for Small Business, chapter 6, Figuring Gross Profit: Cost of Goods Sold (inventory at beginning of year + purchases less items withdrawn for personal use + labor, materials and other costs − inventory at end of year). https://www.irs.gov/publications/p334 (retrieved 2026-10-01)"
  ],
  "related": [
    "gross-margin",
    "profit",
    "margin"
  ],
  "changelog": []
}
