{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://askcalculators.com/calculator/tip-calculator/schema.json",
  "title": "Tip Calculator inputs",
  "description": "Calculate gratuity, total bill, and an optional split per person.",
  "type": "object",
  "properties": {
    "bill": {
      "title": "Bill amount",
      "type": "number",
      "default": 85,
      "minimum": 0,
      "x-step": 0.01,
      "x-unit": "currency"
    },
    "tax": {
      "title": "Tax amount",
      "type": "number",
      "description": "Optional",
      "minimum": 0,
      "x-step": 0.01,
      "x-unit": "currency"
    },
    "tipPercent": {
      "title": "Tip",
      "type": "number",
      "default": 20,
      "minimum": 0,
      "maximum": 50,
      "x-step": 1,
      "multipleOf": 1,
      "x-unit": "percent",
      "x-control": "slider-number"
    },
    "splitBill": {
      "title": "Split the bill",
      "type": "boolean",
      "default": true
    },
    "people": {
      "title": "Number of people",
      "type": "number",
      "default": 2,
      "minimum": 1,
      "maximum": 100,
      "x-step": 1,
      "multipleOf": 1,
      "x-showWhen": {
        "field": "splitBill",
        "equals": true
      }
    }
  },
  "required": [
    "bill",
    "tipPercent"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "splitBill": {
            "const": true
          }
        },
        "required": [
          "splitBill"
        ]
      },
      "then": {
        "required": [
          "people"
        ]
      }
    }
  ],
  "additionalProperties": false,
  "x-askcalculators": {
    "version": "1.0.0",
    "calculatorUrl": "https://askcalculators.com/calculator/tip-calculator/",
    "queryExample": "https://askcalculators.com/calculator/tip-calculator/?bill=85&tipPercent=20&splitBill=1&people=2",
    "migrationStatus": "new",
    "reviewStatus": "pending",
    "pageStatus": "live",
    "workStatus": "pending",
    "formula": {
      "expression": "Tip = bill × tip rate; total = bill + tax + tip",
      "note": "The tip is calculated from the bill amount before the optional tax amount."
    },
    "quality": {
      "availability": "live",
      "technicalReviewRecord": "/reviews/tip-calculator.json",
      "qualifiedReview": "pending",
      "qualifiedReviewer": null,
      "qualifiedReviewDate": null,
      "formulaVersion": "1.0.0",
      "referenceCoverage": "references-pending",
      "releaseTestScope": "Catalog and regression checks are not a professional formula audit; consult release evidence.",
      "historicalMetadataDate": "2026-08-18",
      "historicalMetadataNotice": "The imported date is not evidence of a completed human review."
    },
    "outputs": {
      "perPerson": {
        "title": "Per person",
        "type": "number",
        "x-format": "currency",
        "x-primary": true
      },
      "tipAmount": {
        "title": "Tip amount",
        "type": "number",
        "x-format": "currency"
      },
      "totalBill": {
        "title": "Total bill",
        "type": "number",
        "x-format": "currency"
      },
      "tipPerPerson": {
        "title": "Tip per person",
        "type": "number",
        "x-format": "currency"
      }
    }
  }
}
