HomeCalculatorsMathPythagorean Theorem Calculator
Math calculator

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.

Instant result
Result

Enter values to calculate.

Inputs
Mode
Formula
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 — ui-ssr is query-result HTML, not a live browser session.
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 — 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
  • Right-triangle area — A = ab/2
Sources
Evidence
6 legacy golden · 10 legacy boundary · legacy regression suite · 6/6 oracle-backed golden · 11/11 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.1.1 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓
Semantic contract
PASS
Full verification

Manifest identity, reference classes, interfaces, suite, and production records.

Formulas

Core equations used by this calculator.

Theorema² + b² = c²
Hypotenusec = √(a² + b²)
Leg aa = √(c² − b²)
Leg bb = √(c² − a²)
AreaA = ab / 2
PerimeterP = a + b + c
ic must be the longest side and strictly longer than each leg. Only right triangles. Positive side lengths required. solve_for selects the unknown; mode=verify checks all three sides.

How to use

1

Choose solve or verify

Solve hypotenuse c (default), leg a, or leg b — or switch to Verify when you already have all three sides.

2

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.

3

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

c = √(9+16)
5
ϟ

Find a leg

b = 4, c = 5

a = √(25−16)
3
ϟ

Verify 3-4-5

All three sides

3² + 4² = 5²
✓ valid
ϟ

Legs 7 and 9

Hypotenuse

√130
≈ 11.4018

Common Pythagorean triples

Common values at a glance.

abc
345
51213
6810
72425
81517
91215
94041
202129
i Multiples of a primitive triple also work (e.g. 6-8-10 = 2×(3-4-5)).

Pythagorean Theorem calculator specification

Version 1.1.1 · Engine tested

Calculation status

Review policy · Evidence

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-28
    Supports: Classical statement of the Pythagorean theorem used as the geometric identity a² + b² = c².
  • Right-triangle area — A = ab/2
    Supports: 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.
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, …).

Other calculators in this family: Circle, Coordinate geometry, Root, Exponent, Cos, Sin, Quadratic .

}

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.