{
  "id": "pythagorean-theorem",
  "version": "b9edb98b00b5",
  "status": "published",
  "name": "Pythagorean Theorem Calculator",
  "question": "Pythagorean theorem calculator",
  "summary": "Finds the missing side of a right triangle from the other two with the Pythagorean theorem, a² + b² = c².",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/pythagorean-theorem-calculator",
  "markdown": "https://www.acalculator.org/math/pythagorean-theorem-calculator.md",
  "kind": "formulas",
  "method": "a² + b² = c², where a and b are the legs and c is the hypotenuse of a right triangle.",
  "assumptions": [
    "The triangle has a right angle (90°) between legs a and b.",
    "All three sides are more than 0 and at most 10¹⁰⁰, in the same unit; a hypotenuse worked out above 10¹⁰⁰ has no answer.",
    "The hypotenuse must be longer than the leg you give with it."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "a": {
        "title": "Leg a",
        "description": "One of the two shorter sides, which meet at the right angle.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1e+100
      },
      "b": {
        "title": "Leg b",
        "description": "The other shorter side, which meets leg a at the right angle.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1e+100
      },
      "c": {
        "title": "Hypotenuse c",
        "description": "The longest side, opposite the right angle.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1e+100
      }
    }
  },
  "solve": {
    "fillAny": 2,
    "variables": [
      "a",
      "b",
      "c"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "a": {
      "label": "Leg a",
      "description": "One of the two shorter sides, which meet at the right angle.",
      "format": "number"
    },
    "b": {
      "label": "Leg b",
      "description": "The other shorter side, which meets leg a at the right angle.",
      "format": "number"
    },
    "c": {
      "label": "Hypotenuse c",
      "description": "The longest side, opposite the right angle.",
      "format": "number"
    },
    "a2": {
      "label": "a²",
      "description": "Leg a squared.",
      "format": "number"
    },
    "b2": {
      "label": "b²",
      "description": "Leg b squared.",
      "format": "number"
    },
    "c2": {
      "label": "c²",
      "description": "The hypotenuse squared: a² + b².",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "a": 3,
      "b": 4
    },
    "outputs": {
      "c": 5,
      "a2": 9,
      "b2": 16,
      "c2": 25
    },
    "text": "A right triangle with legs 3 and 4 has a hypotenuse of 5."
  },
  "examples": [
    {
      "given": {
        "a": 3,
        "b": 4
      },
      "expect": {
        "c": 5,
        "a2": 9,
        "b2": 16,
        "c2": 25
      },
      "source": "hand calculation in content.mdx: 9 + 16 = 25, √25 = 5"
    },
    {
      "given": {
        "a": 5,
        "c": 13
      },
      "expect": {
        "b": 12
      },
      "source": "hand calculation in content.mdx: 169 − 25 = 144, √144 = 12"
    },
    {
      "given": {
        "b": 24,
        "c": 25
      },
      "expect": {
        "a": 7
      },
      "source": "hand calculation in content.mdx: 625 − 576 = 49, √49 = 7"
    },
    {
      "given": {
        "a": 1,
        "b": 1
      },
      "expect": {
        "c": 1.4142135623730951
      },
      "source": "hand calculation in content.mdx: √(1 + 1) = √2; Python 3: math.hypot(1, 1) = 1.4142135623730951"
    },
    {
      "given": {
        "a": 2.5,
        "b": 6
      },
      "expect": {
        "c": 6.5
      },
      "source": "hand calculation in content.mdx: 6.25 + 36 = 42.25, √42.25 = 6.5"
    }
  ],
  "sources": [
    "OpenStax, Elementary Algebra 2e, section 3.4 Solve Geometry Applications: Triangles, Rectangles, and the Pythagorean Theorem: https://openstax.org/books/elementary-algebra-2e/pages/3-4-solve-geometry-applications-triangles-rectangles-and-the-pythagorean-theorem"
  ],
  "related": [
    "right-triangle",
    "law-of-cosines",
    "square-root"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "A leg as long as the hypotenuse names the rule."
    }
  ]
}
