{
  "schemaVersion": 1,
  "slug": "pressure-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "aab256f8559da2c09eb425d2206c3b1249f1de333b6ac195d28bbd2b6f57741b",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pressure-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": "P_out = P_in × k_from ÷ k_to",
    "vars": [
      [
        "P_in",
        "Input pressure"
      ],
      [
        "k_from",
        "Factor of input unit (per Pa)"
      ],
      [
        "k_to",
        "Factor of target unit (per Pa)"
      ],
      [
        "P_out",
        "Converted pressure"
      ]
    ],
    "note": "Lookup factors in pascals: Pa = 1, kPa = 1000, MPa = 10⁶, bar = 100000, mbar = 100, psi = 6894.757293168, atm = 101325, mmHg = 133.322387415, inHg = 3386.389, kg/cm² = 98066.5."
  },
  "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": "Convert pressure via pascals; pressure is force per area.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "aab256f8559da2c09eb425d2206c3b1249f1de333b6ac195d28bbd2b6f57741b",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const units={\"pa\":\"Pa\",\"kpa\":\"kPa\",\"mpa\":\"MPa\",\"bar\":\"bar\",\"mbar\":\"mbar\",\"psi\":\"psi\",\"atm\":\"atm\",\"mmhg\":\"mmHg\",\"inhg\":\"inHg\",\"kgcm2\":\"kg/cm²\"}, factors={\"pa\":1,\"kpa\":1000,\"mpa\":1000000,\"bar\":100000,\"mbar\":100,\"psi\":6894.757293168,\"atm\":101325,\"mmhg\":133.322387415,\"inhg\":3386.389,\"kgcm2\":98066.5}; if(!Number.isFinite(value)||value<-1000000000000||value>1000000000000||!Object.prototype.hasOwnProperty.call(units,from)||!Object.prototype.hasOwnProperty.call(units,to))return {\"result\":null,\"psi\":null,\"bar\":null,\"kpa\":null,\"__error\":\"inputError\"}; const out=(function(){const F={pa:1,kpa:1000,mpa:1e6,bar:100000,mbar:100,psi:6894.757293168,atm:101325,mmhg:133.322387415,inhg:3386.389,kgcm2:98066.5}; const pa=value*F[from]; return { result: pa/F[to], psi: pa/6894.757293168, bar: pa/100000, kpa: pa/1000 };})(); if(out.__error)return {...{\"result\":null,\"psi\":null,\"bar\":null,\"kpa\":null},...out}; out.__resultUnit=units[to]; out.__unitRatio=factors[to]/factors[from]; return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1,
        "min": -1000000000000,
        "max": 1000000000000,
        "step": 0.0001,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "bar",
        "options": [
          {
            "value": "bar"
          },
          {
            "value": "pa"
          },
          {
            "value": "kpa"
          },
          {
            "value": "mpa"
          },
          {
            "value": "mbar"
          },
          {
            "value": "psi"
          },
          {
            "value": "atm"
          },
          {
            "value": "mmhg"
          },
          {
            "value": "inhg"
          },
          {
            "value": "kgcm2"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "psi",
        "options": [
          {
            "value": "psi"
          },
          {
            "value": "pa"
          },
          {
            "value": "kpa"
          },
          {
            "value": "mpa"
          },
          {
            "value": "bar"
          },
          {
            "value": "mbar"
          },
          {
            "value": "atm"
          },
          {
            "value": "mmhg"
          },
          {
            "value": "inhg"
          },
          {
            "value": "kgcm2"
          }
        ]
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "psi",
        "precision": 4,
        "unit": "psi",
        "showWhen": {
          "to": [
            "pa",
            "kpa",
            "mpa",
            "bar",
            "mbar",
            "atm",
            "mmhg",
            "inhg",
            "kgcm2"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "bar",
        "precision": 6,
        "unit": "bar",
        "showWhen": {
          "to": [
            "pa",
            "kpa",
            "mpa",
            "mbar",
            "psi",
            "atm",
            "mmhg",
            "inhg",
            "kgcm2"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "kpa",
        "precision": 4,
        "unit": "kPa",
        "showWhen": {
          "to": [
            "pa",
            "mpa",
            "bar",
            "mbar",
            "psi",
            "atm",
            "mmhg",
            "inhg",
            "kgcm2"
          ]
        },
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
