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.
Trust summary CVP VERIFIED · 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
- 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.1 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Engineering assurance· View Manifest · CVP overview · Specification
- Versions
- Calculation 1.1.1 · CVP protocol 1.0.0-proposed · Evidence 2026-09-16.sources-no-wolfram
- Verification revision
- 2026-09-16.sources-no-wolfram · 4/4 property · digest 73a2ec1773da
- Legacy regression
- 16/16 tests · Production surface contract 2/2
- Trust layers
- Verification VERIFIED · Production CURRENT · overall VERIFIED
- 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
- 6/6 golden · 10/10 CVP boundary · 11/11 invalid · 4/4 property · 2/2 metamorphic · 2/2 round-trip · 1/1 cross-interface · 2/2 CVP contract · Manifest
- Sources
- Euclid, Elements, Book I, Proposition 47
- Right-triangle area
- Evidence
- 6 legacy golden · 10 legacy boundary · legacy regression suite · 6/6 oracle-backed golden · 11/11 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. Steps include the exact radical when the radicand is not a perfect square.
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.1 · Engine tested
- Engine tested 16/16 tests · Production surface contract 2/2
- Named expert review Not performed
- Calculation version 1.1.1
- 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 uses relative tolerance 1e-6 on a²+b² versus c². Steps report |a²+b²−c²| and the relative error.
- 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 2/2 · 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.1
Background
Interpretation and common distinctions.
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, …).
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 ✓ Valid right triangle; a mismatch shows the two squares.
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.