Math · FREE ONLINE TOOL

Pythagorean Theorem Calculator

Find a right triangle's hypotenuse from two perpendicular legs, or recover one leg from the hypotenuse and the other leg.

Choose known measurements

Your inputs

Right triangle with legs a and b, hypotenuse c, and a right-angle marker at C
c = √(a²+b²).Diagram is not to scale.

Enter perpendicular legs a and b in the same length unit. The calculator finds hypotenuse c, the side opposite the right angle.

Which measurements do I need?

The two entered sides must be perpendicular legs.

Calculations run in your browser. No account needed.

EXAMPLE RESULTCalculated locally
Hypotenuse
5
Clear inputs. Transparent methods.
My workspace

Calculate with your inputs to save a result or compare scenarios.

How it works

Illustration for Pythagorean Theorem Calculator: a drawing compass; a triangle and ruler.
Find hypotenusec = √(a²+b²).
A useful distinction

Scaling preserves the right-angle relationship

A 3–4–5 triangle and a 6–8–10 triangle satisfy the same relationship because every side doubles. Their areas differ by a factor of four, so doubling a diagonal does not merely double the enclosed area.

How much longer is the diagonal of a doubled rectangle?

Diagonal. A (3 m × 4 m) → 5 m. B (6 m × 8 m) → 10 m.
How much longer is the diagonal of a doubled rectangle?
Side lengthsCalculationDiagonal
A 3 m × 4 m√(3^2 + 4^2)5 m
B 6 m × 8 m√(6^2 + 8^2)10 m

Identifying the hypotenuse correctly

The Pythagorean theorem applies to a right triangle. The hypotenuse is opposite the right angle and is the longest side, so it cannot be interchanged with a leg when choosing the unknown. Use consistent length units for all sides. A valid arithmetic result does not establish that a measured triangle actually has a right angle.

Identify the right angle and the side opposite it

The Pythagorean theorem applies to a right triangle: a²+b²=c², where c is the hypotenuse opposite the 90° angle. The two remaining sides are legs. Select Find hypotenuse when both legs are known, or Find a leg when the hypotenuse and one leg are known.

All side lengths must use the same unit. Convert them first if necessary. The hypotenuse must exceed either leg; the calculator rejects a known leg that is at least as long as the hypotenuse.

Calculate a diagonal and then reverse the calculation

For perpendicular lengths 8 and 15, the diagonal is √(8²+15²)=√289=17. If the diagonal 17 and leg 8 are known instead, the other leg is √(17²−8²)=√225=15.

Forward and reverse calculations for an 8–15–17 triangle
UnknownCalculationResult
Hypotenuse√(64 + 225)17
Other leg when the known leg is 8√(289 − 64)15
Other leg when the known leg is 15√(289 − 225)8

Apply the theorem to rectangular geometry without adding lengths

The diagonal of an 8-by-15 rectangle is 17, not 23. The sum 23 follows two edges, while 17 is the straight diagonal between the opposite corners. That geometric distinction matters for screens, plans and coordinate distances.

For a three-dimensional rectangular box, combine three perpendicular dimensions: d=√(a²+b²+c²). The Coordinate Distance Calculator accepts three coordinates when that is the actual problem.

Check the right-triangle assumption before using the answer

For three measured sides, use the longest as the candidate hypotenuse and compare its square with the sum of the other squares. An exact equality characterizes a right triangle in ideal geometry; measurements may agree only within their uncertainties.

For a triangle with a different included angle, use the law of cosines rather than forcing the Pythagorean relationship. The Triangle Calculator has separate modes for known sides and angles.

Find hypotenuse: formula and assumptions

c = √(a²+b²).

The two entered sides must be perpendicular legs.

Use Find hypotenuse

Find a leg: formula and assumptions

b = √(c²−a²).

The hypotenuse must be longer than the known leg.

Use Find a leg

Worked example

Using the Find hypotenuse example:

Inputs
Leg a
3
Leg b
4
Method

c = √(a²+b²).

Result

Example result

Hypotenuse: 5

These are illustrative inputs. Change the values to explore a different scenario.

Formula references

References explain the underlying methods; they do not imply endorsement or individual professional review of Finflo.

Common questions

Can I use this formula for any triangle?

No. The equation a² + b² = c² applies when the legs meet at a right angle.

Why must the hypotenuse be longer than the known leg?

The missing leg uses the square root of c² − a². A nonpositive difference cannot form a nondegenerate right triangle.

Which side is the hypotenuse?

It is the side opposite the right angle and is the longest side of a nondegenerate right triangle.

How do I find the diagonal of a rectangle?

Use its perpendicular length and width as the two legs. For 8 and 15, the diagonal is 17 in the same length unit.

Does scaling a 3–4–5 triangle preserve its right angle?

Yes. Multiplying all three sides by the same positive factor preserves a² + b² = c². For example, 6² + 8² = 10².

See our methodology and editorial policy.