{
  "schemaVersion": 1,
  "slug": "belt-size-calculator",
  "category": "fashion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "53f5e3a00773960121c2a9db84094cb8e3514e6bf57116fd55012e08d3915adf",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/belt-size-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "belt_in = round(waist_in + 2); belt_cm = belt_in × 2.54",
    "vars": [
      [
        "waist_in",
        "Waist measurement (in)"
      ],
      [
        "belt_in",
        "Estimated belt length (in)"
      ],
      [
        "belt_cm",
        "Estimated belt length (cm)"
      ]
    ],
    "note": "Centimetre waist input is divided by 2.54. Letter bands are model thresholds: XS ≤29, S ≤32, M ≤35, L ≤38, XL ≤41, XXL ≤44, otherwise XXXL. They are not brand standards."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Levi’s — Body measurement and size charts",
        "url": "https://www.levi.com/US/en_US/info/sizeguide"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "53f5e3a00773960121c2a9db84094cb8e3514e6bf57116fd55012e08d3915adf",
    "basis": "belt_in = round(waist_in + 2); belt_cm = belt_in × 2.54",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const w = unit === 'cm' ? waist/2.54 : waist; const belt = Math.round(w+2); const letter = belt <= 29 ? 'XS' : belt <= 32 ? 'S' : belt <= 35 ? 'M' : belt <= 38 ? 'L' : belt <= 41 ? 'XL' : belt <= 44 ? 'XXL' : 'XXXL'; return { beltSizeIn: belt, beltSizeCm: belt*2.54, letterSize: letter, waistIn: w };",
    "inputs": [
      {
        "name": "waist",
        "type": "number",
        "default": 32,
        "min": 15,
        "max": 60,
        "step": 0.1,
        "unitField": "unit",
        "minByUnit": {
          "in": 15,
          "cm": 38.1
        },
        "maxByUnit": {
          "in": 60,
          "cm": 152.4
        },
        "unitScales": {
          "in": 1,
          "cm": 0.39370078740157477
        }
      },
      {
        "name": "unit",
        "type": "select",
        "default": "in",
        "options": [
          {
            "value": "in"
          },
          {
            "value": "cm"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "beltSizeIn",
        "precision": 0,
        "unit": "in"
      },
      {
        "name": "beltSizeCm",
        "precision": 1,
        "unit": "cm"
      },
      {
        "name": "letterSize",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "waistIn",
        "precision": 1,
        "unit": "in"
      }
    ],
    "interpret": null
  }
}
