Geometry · Triangles
Pythagorean theorem calculator icon showing a right triangle with squares on its three sides

Pythagorean theorem calculator

This Pythagorean theorem calculator finds the missing side of a right triangle from a² + b² = c², either the hypotenuse from the two legs or a leg from the hypotenuse and the other leg. It also tests whether three lengths form a right triangle and finds the diagonal of a box, with exact square-root answers and every step shown.

In this Pythagorean theorem calculator the hypotenuse c is the side opposite the right angle and is always the longest side. Enter all lengths in the same unit; the default example has legs of 5 cm and 7 cm.

Pythagorean theorem calculator: find the missing side

Pick what you want to find, then enter the two sides you know.
All lengths in this calculator use this unit; areas come out in square units and volumes in cubic units.

Pythagorean theorem calculator: is it a right triangle?

Enter three side lengths in any order. The longest one is tested as the hypotenuse.
All lengths in this calculator use this unit; areas come out in square units and volumes in cubic units.

3D Pythagorean theorem calculator: diagonal of a box

The space diagonal of a rectangular box, d = √(l² + w² + h²), and the diagonals of its faces.
All lengths in this calculator use this unit; areas come out in square units and volumes in cubic units.

How to use the Pythagorean theorem calculator

Choose the length unit, then choose what you want to find. To get the hypotenuse, enter the two legs a and b. To get a missing leg, switch the mode and enter the hypotenuse c and the known leg a. The Pythagorean theorem calculator shows the answer as a decimal, as an exact square root when the sides are whole numbers (for example √74 or 6√2), the perimeter and the area, and it draws the triangle with the found side in orange. Open “Show the working” to copy the steps into your homework.

The second panel tests whether three lengths form a right triangle (and if not, whether the triangle is acute or obtuse). The third finds the diagonal of a box or room.

The Pythagorean theorem: a² + b² = c²

In a right triangle, the two sides that form the 90° angle are the legs, a and b. The side across from the right angle is the hypotenuse, c. The theorem says that the square built on the hypotenuse has the same area as the squares on the two legs together:

a² + b² = c²

Rearranged, it gives every missing side:

c = √(a² + b²) and a = √(c² − b²), b = √(c² − a²)

Add the squares when you want the hypotenuse; subtract the squares when you want a leg. Mixing these up is the most common mistake, so the Pythagorean theorem calculator asks which side you are solving for. For a classroom treatment with practice problems, see the OpenStax Prealgebra 2e section on the Pythagorean theorem. To take a square root by hand or check a radical, use the Square Root Calculator.

Worked example with the Pythagorean theorem calculator

Hypotenuse (default values). A right triangle has legs a = 5 cm and b = 7 cm. Square the legs: 5² = 25 and 7² = 49. Add them: c² = 25 + 49 = 74. Take the square root: c = √74 ≈ 8.60233 cm. Because 74 = 2 × 37 has no square factor, √74 is already in simplest form. The perimeter is 5 + 7 + 8.60233 = 20.6023 cm and the area is 5 × 7 / 2 = 17.5 cm².

Missing leg. Switch the mode of the Pythagorean theorem calculator, keep a = 5 cm and enter c = 13 cm. Then b² = 13² − 5² = 169 − 25 = 144 and b = 12 cm, exactly. The calculator notes that 5, 12, 13 is a Pythagorean triple.

Right-angle check. The second panel starts with 8, 15 and 17 inches: 8² + 15² = 64 + 225 = 289 = 17², so the triangle is right, and 8-15-17 is a primitive triple. Change 17 to 16 and it reports an acute triangle (289 is more than 256).

Box diagonal. The third panel uses a room 12 ft long, 4 ft wide and 3 ft high. The floor diagonal is √(144 + 16) = √160 ≈ 12.649 ft, and the space diagonal is √(160 + 9) = √169 = 13 ft, so a 13 ft pole just fits from a bottom corner to the opposite top corner.

Pythagorean triples to check with the Pythagorean theorem calculator

A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². Any multiple of a triple is also a triple (6-8-10 is 2 × 3-4-5). A triple is primitive when the three numbers share no common factor. Every primitive triple comes from two whole numbers m > n with no common factor, one odd and one even: a = m² − n², b = 2mn, c = m² + n² (Euclid’s formula, listed on the Wolfram MathWorld page on Pythagorean triples).

m, nTriple (a, b, c)Check: a² + b² = c²Useful multiples
2, 13, 4, 59 + 16 = 256-8-10, 9-12-15, 12-16-20
3, 25, 12, 1325 + 144 = 16910-24-26
4, 115, 8, 17225 + 64 = 28916-30-34
4, 37, 24, 2549 + 576 = 62514-48-50
5, 49, 40, 4181 + 1600 = 168118-80-82
6, 135, 12, 371225 + 144 = 136970-24-74

Most sides are not whole numbers: legs of 1 and 1 give √2 ≈ 1.41421, and legs of 1 and 2 give √5 ≈ 2.23607.

Checking for a right angle: the converse

The converse of the theorem is just as useful: if three sides satisfy a² + b² = c² with c the longest, the angle opposite c is exactly 90°. If a² + b² is larger than c² the triangle is acute; if it is smaller, the triangle is obtuse. Builders use this as the 3-4-5 rule: to square a deck frame or a wall layout, mark 3 ft along one board and 4 ft along the other; the corner is square when the diagonal between the marks is exactly 5 ft. For bigger layouts use 6-8-10 or 9-12-15; the second panel of the Pythagorean theorem calculator tells you how far off a measured diagonal is. Measurements in feet and inches are easier to handle after converting them with the Feet and Inches Calculator.

Practical uses of a Pythagorean theorem calculator

  • Ladders: a ladder reaching 12 ft up a wall with its foot 5 ft out needs to be √(144 + 25) = 13 ft long.
  • Screens: a TV sold as 55 inches is measured on the diagonal; a 16:9 screen of that size is about 47.9 by 27.0 inches.
  • Distance on a map or grid: moving 300 m east and 400 m north puts you 500 m from the start. For points given as coordinates, the Distance Calculator applies the same theorem to (x, y) pairs.

Common mistakes with the Pythagorean theorem calculator

Adding when you should subtract. If the hypotenuse is known, the missing leg is √(c² − a²), not √(c² + a²). A leg is always shorter than the hypotenuse. Calling the wrong side c. The hypotenuse is opposite the right angle, not simply “the side labeled c” in a textbook drawing. Adding before squaring. √(5 + 7) is not the same as √(5² + 7²); square each side first. Mixing units. Convert feet and inches, or meters and centimeters, to one unit first (the Length Converter helps). Using it on a triangle without a right angle. For any other triangle you need the law of cosines, which the Triangle Calculator handles.

Pythagorean theorem calculator or right triangle calculator?

Use this Pythagorean theorem calculator when you know two sides and want the third, or want to test three sides. When an angle is involved, either given or wanted, use the Right Triangle Calculator, which solves the whole triangle with sine, cosine and tangent.

Related calculators

More tools for triangles and lengths: the Right Triangle Calculator for angles, the Triangle Calculator for triangles without a right angle, and all Geometry Calculators.

Frequently asked questions

How do I find the hypotenuse of a right triangle?

Square both legs, add them, and take the square root: c = √(a² + b²). With legs of 5 and 7, c = √(25 + 49) = √74 ≈ 8.602, as the Pythagorean theorem calculator shows by default.

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse and take the square root: b = √(c² − a²). With c = 13 and a = 5, b = √(169 − 25) = 12. In the Pythagorean theorem calculator, choose “Missing leg b”.

How can I tell if three sides make a right triangle?

Square the two shorter sides and add them. If the sum equals the square of the longest side, the triangle is right; if it is bigger, the triangle is acute; if it is smaller, it is obtuse. The second panel of the Pythagorean theorem calculator does this test.

What is the 3D Pythagorean theorem?

For a rectangular box, the diagonal from one corner to the opposite corner is d = √(l² + w² + h²). It comes from using the theorem twice: once across the floor, then up the height.

Is this Pythagorean theorem calculator free?

Yes. It runs in your browser, needs no sign-up and does not store or send the values you enter.