Pythagorean Theorem Calculator
Solve a right triangle with a² + b² = c². Enter any two of legs a, b and hypotenuse c to find the third side, plus area and perimeter. Try it free.
Enter values to calculate.
Trust summary CVP VERIFIED · production STALE · CVP protocol 1.0.0-proposed · Engineering assurance
- Input interpretation
- Enter values to calculate.
- Result
- —
- Assurance
- Engineering
- Declared partition coverage
- PASS · 5/5 declared partitions (solve-c, solve-b, solve-a, verify, invalid-domain) · Matrix
- Numerical scope
- 93 independent full result packs across4operations and extreme scales; no exhaustive-domain claim
- Known limitations
- Positive sides; solve a|b|c or verify
- Core CVP does not include live graph, viewport, or pointer interaction.
- Model
- Missing side of a right triangle from any two of a, b, c (solve_for), or verification of a²+b²=c² when all three are given; also area and perimeter.
- Scope
- Right triangle; positive side lengths.
- Verification
- Engine tested · Source checked · v1.1.6 · CVP VERIFIED · production STALE · CVP protocol 1.0.0-proposed · Engineering assurance· View Manifest · CVP overview · Specification
- Versions
- Calculation 1.1.6 · CVP protocol 1.0.0-proposed · Evidence 2026-10-28.meta-metrics-v2
- Verification revision
- 2026-10-28.meta-metrics-v2 · 2/2 property · digest 4e661f033102
- Legacy regression
- 16/16 tests · Production surface contract 6/6
- Trust layers
- Verification VERIFIED · Production STALE · Overall CVP state: VERIFIED_STALE under CVP 1.0.0-proposed
- CVP status
- STALE · attestation snapshot core b4e2795757fd ≠ live cvp_core_sha256 4e661f033102 (2026-10-28.meta-metrics-v2)
- Reference
- O1 model · O2 expected_values · O2 numerical_behavior
- Interfaces
- PASS · UI (SSR) / REST / MCP
- Supplemental domain review
- Not performed
- Named expert review
- Not performed
- CVP suite
- 93/93 golden · 10/10 CVP boundary · 12/12 invalid · 2/2 property · 2/2 metamorphic · 4/4 cross-interface · 6/6 CVP contract · Manifest
- Sources
- Euclid, Elements, Book I, Proposition 47
- Right-triangle area
- Evidence
- 6 legacy golden · 10 legacy boundary · legacy regression suite · 93/93 oracle-backed golden · 12/12 invalid · Artifact integrity PASS
- Semantic contract
- PASS
Full verification
Formulas
Core equations used by this calculator.
How to use
Choose solve or verify
Solve hypotenuse c (default), leg a, or leg b — or switch to Verify when you already have all three sides.
Enter the known sides
The solved field is calculated. Share URLs record solve_for=a|b|c, or mode=verify with a, b, and c.
Read side, area, and perimeter
The result shows the unknown (or a ✓ when verifying), plus area ab/2 and perimeter. Exact radicals are provided only for safe integer radicands; other results are binary64 approximations.
Example calculations
Common configurations with formula and result.
Classic 3-4-5
Legs 3 and 4
Find a leg
b = 4, c = 5
Verify 3-4-5
All three sides
Legs 7 and 9
Hypotenuse
Common Pythagorean triples
Common values at a glance.
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 6 | 8 | 10 |
| 7 | 24 | 25 |
| 8 | 15 | 17 |
| 9 | 12 | 15 |
| 9 | 40 | 41 |
| 20 | 21 | 29 |
Pythagorean Theorem calculator specification
Version 1.1.6 · Engine tested
- Engine tested 16/16 tests · Production surface contract 6/6
- Named expert review Not performed
- Calculation version 1.1.6
- Definition
- For a right triangle with legs a and b and hypotenuse c (opposite the right angle), the Pythagorean theorem states a² + b² = c². Enter any two side lengths to solve for the third; enter all three to verify. The tool also reports area ab/2 and perimeter.
- What it calculates
- Missing side of a right triangle from any two of a, b, c (solve_for), or verification of a²+b²=c² when all three are given; also area and perimeter.
- Inputs
- Leg a (optional)
- Leg b (optional)
- Hypotenuse c (optional)
- solve_for: a | b | c. If omitted, inferred from which sides are present.
- mode=verify to check all three sides
- Outputs
- The missing side length, or a verify result
- Area A = ab/2 when both legs known
- Perimeter a+b+c when all sides known
- Exact radical when the radicand is not a perfect square
- Formula
a²+b²=c²; A=ab/2; P=a+b+c- Assumptions
- Right triangle; positive side lengths.
- c > a and c > b when solving for a leg.
- Exactly two fields are inputs when solving. Explicit solve_for selects the output. If all three are supplied without solve_for, they are verified rather than overwritten.
- Interactive evaluation, shared URLs, and REST use the same engine, solve_for contract, and error codes.
- Share URL is canonical: solve_for=a|b|c forces solve even if a leftover third side is present; mode=verify is required to stay in Verify after a tab change.
- Units
- Any consistent length unit; area in squared units
- Boundary conditions
- Need exactly two known sides to solve the third, or all three to verify
- Invalid solve_for → INVALID_SOLVE_FOR
- Fewer than two inputs → MISSING_REQUIRED_INPUT
- Non-positive side → SIDE_NOT_POSITIVE
- c ≤ a or c ≤ b when solving a leg → HYPOTENUSE_TOO_SHORT
- All three without solve_for that do not satisfy Pythagoras → status invalid (not overwritten)
- Numerical precision
- Computation uses IEEE-754 binary64 (JavaScript Number).
- Displayed results use up to 12 significant digits; trailing zeros are stripped. Scientific notation is used when |value| ≥ 1e12 or 0 < |value| < 1e-6.
- Verify requires nondegenerate triangle geometry and |a²+b²-c²|/c² <= 1e-6, evaluated with scaled squares. Diagnostic rounding near the threshold can differ by 2e-15. This is not proof of exact equality.
- Interactive evaluation, shared URLs, and REST use the same formulas, solve_for contract, and error codes.
- Example
- a=3, b=4 → c=5
- Validation cases
8 published on this page · 16/16 tests · Production surface contract 6/6 · View evidence
- a=3, b=4 → c=5
- solve_for=c, a=3, b=4 → c=5
- a=5, c=13 → b=12
- a=7, b=9 → c=√130 ≈ 11.4018
- mode=verify, a=3, b=4, c=5 → valid
- a=3, b=4, c=5 (no solve_for) → verify valid (not solve-for-c)
- mode=verify, a=3, b=4, c=6 → invalid (9+16 ≠ 36)
- b=4, c=4, solve a → error HYPOTENUSE_TOO_SHORT
- Sources
- Euclid, Elements, Book I, Proposition 47 — In right-angled triangles the square on the side subtending the right angle is equal to the squares on the sides containing the right angle · accessed 2026-08-28Supports: Classical statement of the Pythagorean theorem used as the geometric identity a² + b² = c².
- Right-triangle area — A = ab/2Supports: Area of a right triangle is half the product of the legs that form the right angle. Perimeter is the sum of the three sides.
- Euclid, Elements, Book I, Proposition 47 — In right-angled triangles the square on the side subtending the right angle is equal to the squares on the sides containing the right angle · accessed 2026-08-28
- Calculation version
- 1.1.6
Background
Interpretation and common distinctions.
What does this pythagorean theorem calculator compute?
For a right triangle with legs a and b and hypotenuse c (opposite the right angle), the Pythagorean theorem states a² + b² = c². Enter any two side lengths to solve for the third; enter all three to verify. The tool also reports area ab/2 and perimeter.
The published formula or method is a²+b²=c²; A=ab/2; P=a+b+c. The following references support the stated mathematics or method:
- Euclid — Elements, Book I, Proposition 47: The Pythagorean theorem for a right triangle.
Which inputs and limits should you check?
Follow the input domain, units, branch or solve direction, and rounding policy in the specification. Preserve exact outputs and any additional candidates or warnings.
The worked example uses Legs 3 and 4 with c = √(9+16). Compare it with the Example calculations and the complete result for the same inputs.
How can you verify and cite this result?
CalculatorX is responsible for this page. The mathematical references above explain the model; implementation checks and their scope are documented separately in the math.pythagorean v1.1.6 Evidence and capability contract. Read the displayed verification and production state together with the specification's numerical limits.
Use the clean calculator URL to cite the tool. A shared input link identifies a particular calculation. Content updates, numerical verification, and domain reviews have separate dates and scopes.
What is the Pythagorean theorem?
For a right triangle (one angle = 90°), if a and b are the legs and c is the hypotenuse (opposite the right angle):
a² + b² = c²
The square on the hypotenuse equals the sum of the squares on the other two sides.
Pythagorean triples
Integer solutions such as 3,4,5, 5,12,13, 8,15,17, and their multiples (6,8,10, …).
Inputs accept positive finite JSON numbers or strict decimal strings of at most 512 characters, including scientific notation. Nonzero decimal text that converts to zero is rejected. Matching aliases are accepted; conflicting aliases and unknown fields reject. Empty fields are absent; null and nonnumeric types reject. All supplied side tokens validate, even when solve_for selects a supplied output. mode=verify cannot be combined with solve_for.
The diagram is schematic and is not to scale. Full binary64 values, input parameters, diagnostic and range statuses are available in CSV/JSON and REST/MCP. Invalid verification does not establish a right angle; ab/2 is not reported as its area. Positive derived values outside binary64 range are null with explicit range status.
Typing calculates locally. Shared URLs, REST and MCP send inputs to the server and may enter server or analytics logs; browser history may retain links and calculations. Logging retention and processing regions are not asserted here.
Near a flat triangle, a small perturbation to c or the known leg can strongly change the missing leg. Decimal inputs first round to binary64; c must remain strictly larger after rounding. A tolerance match is not an exact or symbolic proof.
Related tools
Other calculators in this family: Annulus Calculator, Arc Calculator, Circle Calculator, Conic Section Calculator, Ellipse Calculator, Hyperbola Calculator, Irregular Polygon Calculator, Parabola Calculator . Explore all Geometry.
Frequently asked questions
Key distinctions behind the calculation.
What is the Pythagorean theorem?
In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c².
Which side is the hypotenuse?
The side opposite the right angle — always the longest side, labeled c here.
How do I find the hypotenuse?
Choose Hypotenuse c (solve_for=c). Then c = √(a² + b²) when you know both legs.
How do I find a missing leg?
a = √(c² − b²) or b = √(c² − a²). The hypotenuse must be longer than the known leg. Share URLs use solve_for=a or solve_for=b.
What happens if I enter all three sides?
The calculator verifies a² + b² = c² instead of overwriting a side. Use mode=verify in the share URL. A match shows ✓ Consistent within tolerance. Failed verification has no right-angle diagram or right-triangle area.
What is a Pythagorean triple?
Three positive integers a, b, c that satisfy a² + b² = c², such as 3, 4, 5.
Does this work for non-right triangles?
No. For other triangles use the law of cosines (which reduces to Pythagoras when the included angle is 90°).
How do I find the area and perimeter?
For a right triangle, A = ab/2 using the two legs that form the right angle. Perimeter is P = a + b + c once all three sides are known.