{
  "id": "uncertainty",
  "version": "c090ce8abfb7",
  "status": "published",
  "name": "Uncertainty Calculator",
  "question": "How do I calculate uncertainty?",
  "summary": "Propagates measurement uncertainty through A + B, A − B, A × B, A ÷ B or a power by NIST TN 1297, or finds the standard uncertainty of the mean of repeated readings, with the expanded uncertainty for a coverage factor k.",
  "category": "physics",
  "url": "https://www.acalculator.org/physics/uncertainty-calculator",
  "markdown": "https://www.acalculator.org/physics/uncertainty-calculator.md",
  "kind": "function",
  "method": "u² = u(A)² + u(B)² for A ± B; u² = (B u(A))² + (A u(B))² for A × B; u² = (u(A) ÷ B)² + (A u(B) ÷ B²)² for A ÷ B; u = |n Aⁿ⁻¹| u(A) for Aⁿ; for n readings u = s ÷ √n; U = k × u.",
  "assumptions": [
    "A and B are independent (uncorrelated), so the covariance term of the law of propagation is 0.",
    "The law of propagation is first order: it treats the result as linear in A and B near the measured values.",
    "Uncertainties are standard uncertainties (one standard deviation); the expanded uncertainty is k times the combined one."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "Uncertainty of",
        "description": "A result worked out from two measured values, or the mean of repeated readings of one quantity.",
        "type": "string",
        "enum": [
          "combine",
          "repeat"
        ]
      },
      "a": {
        "title": "Value A",
        "description": "The first measured value.",
        "type": "number",
        "minimum": -1000000000000000,
        "maximum": 1000000000000000
      },
      "ua": {
        "title": "Uncertainty of A (±)",
        "description": "The standard uncertainty of A, 0 or more.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000000
      },
      "b": {
        "title": "Value B",
        "description": "The second measured value.",
        "type": "number",
        "minimum": -1000000000000000,
        "maximum": 1000000000000000
      },
      "ub": {
        "title": "Uncertainty of B (±)",
        "description": "The standard uncertainty of B, 0 or more.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000000
      },
      "op": {
        "title": "Result",
        "description": "How the result is worked out from A and B.",
        "type": "string",
        "enum": [
          "add",
          "sub",
          "mul",
          "div",
          "pow"
        ]
      },
      "n": {
        "title": "Exponent n",
        "description": "The power A is raised to, such as 2 for a square or 0.5 for a square root.",
        "type": "number",
        "minimum": -100,
        "maximum": 100
      },
      "x": {
        "title": "Readings",
        "description": "Two or more readings of the same quantity, separated by commas, spaces or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "k": {
        "title": "Coverage factor k",
        "description": "The multiplier for the expanded uncertainty: k = 2 gives about 95% confidence, k = 3 more than 99%.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 10
      }
    }
  },
  "outputs": {
    "value": {
      "label": "Result (or mean)",
      "description": "The value worked out from A and B, or the mean of the readings.",
      "format": "number"
    },
    "u": {
      "label": "Combined standard uncertainty u",
      "description": "The standard uncertainty of the result, u_c.",
      "format": "number"
    },
    "big": {
      "label": "Expanded uncertainty U",
      "description": "k × u: the ± to quote for the chosen coverage.",
      "format": "number"
    },
    "rel": {
      "label": "Relative uncertainty (%)",
      "description": "u ÷ |result| × 100.",
      "format": "number"
    },
    "low": {
      "label": "Lower end (result − U)",
      "description": "The result minus the expanded uncertainty.",
      "format": "number"
    },
    "high": {
      "label": "Upper end (result + U)",
      "description": "The result plus the expanded uncertainty.",
      "format": "number"
    },
    "sd": {
      "label": "Standard deviation of the readings, s",
      "description": "√[Σ(x − mean)² ÷ (n − 1)].",
      "format": "number"
    },
    "count": {
      "label": "Number of readings",
      "description": "How many readings were typed.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "combine",
      "a": 12.3,
      "ua": 0.2,
      "b": 4.5,
      "ub": 0.1,
      "op": "mul",
      "n": 2,
      "x": "9.81, 9.79, 9.83, 9.80, 9.82",
      "k": 2
    },
    "outputs": {
      "value": 55.35,
      "u": 1.5241062955056646,
      "big": 3.048212591011329,
      "rel": 2.753579576342664,
      "low": 52.30178740898867,
      "high": 58.39821259101133
    },
    "text": "The result is 55.35 with a standard uncertainty of 1.52411 and an expanded uncertainty of ±3.04821 (k = 2)."
  },
  "examples": [
    {
      "given": {
        "mode": "combine",
        "op": "mul",
        "a": 12.3,
        "ua": 0.2,
        "b": 4.5,
        "ub": 0.1,
        "k": 2
      },
      "expect": {
        "value": 55.35,
        "u": 1.5241062955056646,
        "big": 3.048212591011329,
        "rel": 2.753579576342664
      },
      "source": "NIST Technical Note 1297 (1994), Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results, Appendix A (law of propagation of uncertainty, Eq. A-3; mean and standard deviation of the mean, Eqs. A-4 and A-5) and §6 (U = k u_c; k = 2 gives about 95%), https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-appen-law-propagation-uncertainty (retrieved 2026-10-18); NIST, Constants, Units and Uncertainty, Combining uncertainty components (uncorrelated inputs: Y = a₁X₁ + a₂X₂ gives u_c² = a₁²u²(x₁) + a₂²u²(x₂); Y = A X₁^p₁ X₂^p₂ combines relative uncertainties the same way), https://physics.nist.gov/cuu/Uncertainty/combination.html (retrieved 2026-10-18); hand calculation in content.mdx: √((4.5 × 0.2)² + (12.3 × 0.1)²) = √2.3229"
    },
    {
      "given": {
        "mode": "combine",
        "op": "add",
        "a": 10,
        "ua": 0.3,
        "b": 5,
        "ub": 0.4,
        "k": 2
      },
      "expect": {
        "value": 15,
        "u": 0.5,
        "big": 1,
        "low": 14,
        "high": 16
      },
      "source": "NIST, Constants, Units and Uncertainty, Combining uncertainty components (uncorrelated inputs: Y = a₁X₁ + a₂X₂ gives u_c² = a₁²u²(x₁) + a₂²u²(x₂); Y = A X₁^p₁ X₂^p₂ combines relative uncertainties the same way), https://physics.nist.gov/cuu/Uncertainty/combination.html (retrieved 2026-10-18); hand calculation in content.mdx: √(0.3² + 0.4²) = 0.5"
    },
    {
      "given": {
        "mode": "combine",
        "op": "div",
        "a": 100,
        "ua": 2,
        "b": 4,
        "ub": 0.1,
        "k": 2
      },
      "expect": {
        "value": 25,
        "u": 0.8003905296791061,
        "rel": 3.2015621187164243
      },
      "source": "NIST Technical Note 1297 (1994), Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results, Appendix A (law of propagation of uncertainty, Eq. A-3; mean and standard deviation of the mean, Eqs. A-4 and A-5) and §6 (U = k u_c; k = 2 gives about 95%), https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-appen-law-propagation-uncertainty (retrieved 2026-10-18); hand calculation in content.mdx: √((2 ÷ 4)² + (100 × 0.1 ÷ 16)²) = √0.640625"
    },
    {
      "given": {
        "mode": "combine",
        "op": "pow",
        "a": 2,
        "ua": 0.1,
        "n": 3,
        "k": 2
      },
      "expect": {
        "value": 8,
        "u": 1.2,
        "big": 2.4,
        "rel": 15
      },
      "source": "NIST Technical Note 1297 (1994), Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results, Appendix A (law of propagation of uncertainty, Eq. A-3; mean and standard deviation of the mean, Eqs. A-4 and A-5) and §6 (U = k u_c; k = 2 gives about 95%), https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-appen-law-propagation-uncertainty (retrieved 2026-10-18); NIST, Constants, Units and Uncertainty, Combining uncertainty components (uncorrelated inputs: Y = a₁X₁ + a₂X₂ gives u_c² = a₁²u²(x₁) + a₂²u²(x₂); Y = A X₁^p₁ X₂^p₂ combines relative uncertainties the same way), https://physics.nist.gov/cuu/Uncertainty/combination.html (retrieved 2026-10-18); hand calculation in content.mdx: |3 × 2²| × 0.1 = 1.2"
    },
    {
      "given": {
        "mode": "combine",
        "op": "pow",
        "a": 9,
        "ua": 0.3,
        "n": 0.5,
        "k": 2
      },
      "expect": {
        "value": 3,
        "u": 0.05,
        "rel": 1.6666666666666667
      },
      "source": "NIST, Constants, Units and Uncertainty, Combining uncertainty components (uncorrelated inputs: Y = a₁X₁ + a₂X₂ gives u_c² = a₁²u²(x₁) + a₂²u²(x₂); Y = A X₁^p₁ X₂^p₂ combines relative uncertainties the same way), https://physics.nist.gov/cuu/Uncertainty/combination.html (retrieved 2026-10-18); hand calculation in content.mdx: relative 0.5 × 0.3 ÷ 9 = 1/60"
    },
    {
      "given": {
        "mode": "repeat",
        "x": [
          9.81,
          9.79,
          9.83,
          9.8,
          9.82
        ],
        "k": 2
      },
      "expect": {
        "value": 9.81,
        "sd": 0.015811388300841896,
        "u": 0.007071067811865475,
        "big": 0.01414213562373095,
        "count": 5
      },
      "source": "NIST Technical Note 1297 (1994), Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results, Appendix A (law of propagation of uncertainty, Eq. A-3; mean and standard deviation of the mean, Eqs. A-4 and A-5) and §6 (U = k u_c; k = 2 gives about 95%), https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-appen-law-propagation-uncertainty (retrieved 2026-10-18); hand calculation in content.mdx: s² = 0.001 ÷ 4; u = √(0.00025 ÷ 5)"
    }
  ],
  "sources": [
    "NIST Technical Note 1297 (1994 edition), Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results (B. N. Taylor and C. E. Kuyatt), Appendix A: Law of Propagation of Uncertainty (Eq. A-3: u_c²(y) = Σ (∂f/∂x_i)² u²(x_i) + 2 Σ Σ (∂f/∂x_i)(∂f/∂x_j) u(x_i, x_j); Eqs. A-4 and A-5: mean of n observations and its standard deviation). https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-appen-law-propagation-uncertainty (retrieved 2026-10-18)",
    "NIST Technical Note 1297, Section 6: Expanded Uncertainty (U = k u_c(y); k = 2 at NIST by convention, about 95 percent; k = 3, more than 99 percent). https://www.nist.gov/physical-measurement-laboratory/nist-tn-1297-6-expanded-uncertainty (retrieved 2026-10-18)",
    "NIST, Constants, Units and Uncertainty, Combining uncertainty components: with uncorrelated inputs the covariance term vanishes; for Y = a₁X₁ + … + a_NX_N, u_c² = a₁²u²(x₁) + … ; for a product of powers the relative uncertainties combine the same way. https://physics.nist.gov/cuu/Uncertainty/combination.html (retrieved 2026-10-18)"
  ],
  "related": [
    "standard-deviation",
    "standard-error",
    "confidence-interval",
    "percent-error",
    "significant-figures"
  ],
  "changelog": []
}
