{
  "schemaVersion": 1,
  "slug": "shoe-size-calculator",
  "category": "fashion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "2a56cc81b8d98569d67272445cb18b150edf95713ce64427a7cc33486646e412",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/shoe-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": "US = 3L÷2.54 − a; UK = 3L÷2.54 − 23; EU = 1.5L + 2; JP = L",
    "vars": [
      [
        "L",
        "Foot length (cm)"
      ],
      [
        "W",
        "Foot width (cm)"
      ],
      [
        "a",
        "22 men or 21 women"
      ],
      [
        "US/UK/EU/JP",
        "Approximate size references"
      ]
    ],
    "note": "L is foot length in centimetres; a = 22 (men) or 21 (women). Width indicator uses foot width ÷ foot length with model thresholds 0.34, 0.38 and 0.42. These are approximate formulas; ISO 19407:2023 provides guideline conversion tables because systems differ."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const k = unit === 'in' ? 2.54 : 1; const L = footLength*k; const W = footWidth*k; const inch = L/2.54; const ratio = W/L; return { usSize: 3*inch - (sex === 'men' ? 22 : 21), ukSize: 3*inch - 23, euSize: 1.5*L + 2, jpSize: L, widthCode: ratio < 0.34 ? 'Narrow' : ratio < 0.38 ? 'Standard' : ratio < 0.42 ? 'Wide' : 'Extra wide' };",
    "inputs": [
      {
        "name": "unit",
        "type": "select",
        "default": "cm",
        "options": [
          {
            "value": "cm"
          },
          {
            "value": "in"
          }
        ]
      },
      {
        "name": "footLength",
        "type": "number",
        "default": 26,
        "min": 10,
        "max": 35,
        "step": 0.1,
        "unitField": "unit",
        "minByUnit": {
          "cm": 10,
          "in": 3.937
        },
        "maxByUnit": {
          "cm": 35,
          "in": 13.7795
        },
        "unitScales": {
          "cm": 1,
          "in": 2.54
        }
      },
      {
        "name": "footWidth",
        "type": "number",
        "default": 9.5,
        "min": 5,
        "max": 15,
        "step": 0.1,
        "unitField": "unit",
        "minByUnit": {
          "cm": 5,
          "in": 1.9685
        },
        "maxByUnit": {
          "cm": 15,
          "in": 5.9055
        },
        "unitScales": {
          "cm": 1,
          "in": 2.54
        }
      },
      {
        "name": "sex",
        "type": "select",
        "default": "men",
        "options": [
          {
            "value": "men"
          },
          {
            "value": "women"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "usSize",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "ukSize",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "euSize",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "jpSize",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "widthCode",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
