{
  "schemaVersion": 1,
  "slug": "fahrenheit-celsius-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "b761a3b222652c2384be75535e57dd52c8474f78b66d3b1bcf0a7acd24bd22b5",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/fahrenheit-celsius-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": "°C = (°F − 32) × 5 ÷ 9; °F = °C × 9 ÷ 5 + 32; K = °C + 273.15",
    "vars": [
      [
        "F",
        "Fahrenheit temperature"
      ],
      [
        "C",
        "Celsius temperature"
      ],
      [
        "K",
        "kelvin"
      ]
    ],
    "note": "Convert the input to the selected opposite scale; the input-scale output repeats the original value. Kelvin is derived from Celsius. Values below absolute zero return an error."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "NIST SP 811 — Conversion factors by quantity",
        "url": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9"
      }
    ],
    "basis": "C = (F - 32) × 5/9; K = C + 273.15.",
    "limitations": "Absolute temperatures below 0 K are rejected. These are temperatures, not temperature differences.",
    "implementationHash": "b761a3b222652c2384be75535e57dd52c8474f78b66d3b1bcf0a7acd24bd22b5",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const T={\"c\":{\"scale\":1,\"offset\":273.15},\"f\":{\"scale\":0.5555555555555556,\"offset\":255.3722222222222},\"k\":{\"scale\":1,\"offset\":0},\"r\":{\"scale\":0.5555555555555556,\"offset\":0}}, U={\"c\":\"°C\",\"f\":\"°F\",\"k\":\"K\",\"r\":\"°R\"}, L={\"f2c\":[\"f\",\"c\"],\"c2f\":[\"c\",\"f\"]};const pair=Object.prototype.hasOwnProperty.call(L,direction)?L[direction]:[from,to],source=pair[0],target=pair[1]; if(!Number.isFinite(value)||value<-1000||value>10000||!Object.prototype.hasOwnProperty.call(T,source)||!Object.prototype.hasOwnProperty.call(T,target))return {\"result\":null,\"kelvin\":null,\"feelsLike\":null,\"__error\":\"inputError\"};let kelvin=value*T[source].scale+T[source].offset; if(kelvin < -1e-9)return {\"result\":null,\"kelvin\":null,\"feelsLike\":null,\"__error\":\"invalidTemperature\"};if(kelvin<0)kelvin=0; const celsius=kelvin-273.15, out=(function(value,direction){let c = direction === 'f2c' ? (value-32)*5/9 : value; if (c < -273.15 - 1e-9) return { __error: 'invalidTemperature', result: null, kelvin: null, feelsLike: null }; if (c < -273.15) c = -273.15; return { result: direction === 'f2c' ? c : c*9/5+32, kelvin: c+273.15, feelsLike: value };})(celsius,'c2f'); if(out.__error)return {...{\"result\":null,\"kelvin\":null,\"feelsLike\":null},...out};out.result=(kelvin-T[target].offset)/T[target].scale;out.__resultUnit=U[target];out.feelsLike=value;return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 72,
        "min": -1000,
        "max": 10000,
        "step": 0.1,
        "requiredValue": true,
        "strictRange": true,
        "unitField": "from",
        "minByUnit": {
          "c": -273.15,
          "f": -459.67,
          "k": 0,
          "r": 0
        },
        "unitLabels": {
          "c": "°C",
          "f": "°F",
          "k": "K",
          "r": "°R"
        }
      },
      {
        "name": "direction",
        "type": "select",
        "default": "auto",
        "options": [
          {
            "value": "auto"
          },
          {
            "value": "f2c"
          },
          {
            "value": "c2f"
          }
        ],
        "showWhen": {
          "from": []
        }
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      },
      {
        "name": "from",
        "type": "select",
        "default": "f",
        "options": [
          {
            "value": "f"
          },
          {
            "value": "c"
          },
          {
            "value": "k"
          },
          {
            "value": "r"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "c",
        "options": [
          {
            "value": "c"
          },
          {
            "value": "f"
          },
          {
            "value": "k"
          },
          {
            "value": "r"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "kelvin",
        "precision": 2,
        "unit": "K",
        "showWhen": {
          "to": [
            "c",
            "f",
            "r"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "feelsLike",
        "precision": 2,
        "unit": "",
        "showWhen": {
          "to": []
        },
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
