Pythagorean Theorem Calculator

Find the hypotenuse of a right-angled triangle.

How it is calculated

The two shorter sides are squared, added together, and the square root gives the hypotenuse.

Formula

Hypotenuse: √(a² + b²)

What is the Pythagorean Theorem Calculator?

In a right-angled triangle, the side opposite the right angle is called the hypotenuse and is always the longest. The Pythagorean theorem links it to the other two sides: a² + b² = c². This calculator takes the two shorter sides, a and b, and returns the hypotenuse c = √(a² + b²).

It is one of the first theorems Indian students prove in Class 10, and the Baudhayana Sulba Sutra records the same relationship for building fire altars centuries before Pythagoras. In daily life it gives the length of a ladder needed to reach a window, the diagonal of a TV screen or a rectangular plot, the shortest walking distance across a park, or the length of a cable between two points at different heights. The calculator solves for the hypotenuse only; to find a missing shorter side you rearrange the formula by hand.

How to calculate it by hand

1. Make sure the triangle has a 90° angle, and identify the two sides that form it, a and b.

2. Square each of them: a² and b².

3. Add the squares: a² + b².

4. Take the square root: c = √(a² + b²).

5. If instead you know the hypotenuse c and one side a, find the other side with b = √(c² − a²).

6. Check that the hypotenuse is longer than each of the other two sides.

A proof by rearranging four triangles

Draw a large square of side a + b. Inside it, place four copies of the right triangle so that their hypotenuses form a smaller tilted square of side c. The big square's area is (a + b)² = a² + 2ab + b². It is also the tilted square plus four triangles: c² + 4 × ½ab = c² + 2ab. Setting the two equal and cancelling 2ab gives a² + b² = c². The proof works for every right triangle, whatever its size.

The converse and Pythagorean triples

The converse also holds: if three sides satisfy a² + b² = c², the triangle must be right-angled. Masons use this with a 3-4-5 rope to set out square corners. Whole-number solutions are called Pythagorean triples, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25, and any multiple of a triple is also a triple. If a² + b² is greater than c², the angle opposite c is acute; if it is less, that angle is obtuse.

Units, rounding and the distance formula

Both sides must be in the same unit, and the hypotenuse comes out in that unit. Most answers are irrational, so the calculator rounds to four decimal places. √2 for a 1-by-1 square, for instance, never terminates. The distance formula in coordinate geometry, √((x₂ − x₁)² + (y₂ − y₁)²), is the Pythagorean theorem applied to horizontal and vertical gaps. In three dimensions the idea extends to √(a² + b² + c²) for the diagonal of a box.

Worked example, step by step

Farhan needs a ladder to reach a window 12 feet up a wall, and he must place its foot 5 feet from the wall because of a flower bed.

Pythagoras theorem: a² + b² = c²

Square the two shorter sides and add: 5² + 12² = 25 + 144 = 169

Take the square root: c = √169 = 13

Area and perimeter: Area = ½ × a × b = ½ × 5 × 12 = 30 Perimeter = 5 + 12 + 13 = 30

Answer: Hypotenuse (c) 13; Area 30; Perimeter 30

Common mistakes to avoid

Using the formula on a triangle without a right angle. For other triangles use the cosine rule.

Adding the sides before squaring. √(a² + b²) is not a + b; for 3 and 4 it is 5, not 7.

Entering the hypotenuse as side a or b when you actually want a missing shorter side.

Mixing units, such as one side in metres and the other in centimetres.

Forgetting the square root at the end and reporting c² as the length.

Where it is used

Finding the length of a ladder, ramp or staircase stringer.

Working out screen sizes, which are quoted as diagonals.

Checking that the corners of a room, slab or plot are square during construction.

Measuring straight-line distance between two points on a map or grid.

Calculating cable or pipe length between points at different heights.

Frequently asked questions

Does this only work for right triangles?

Yes. The Pythagorean theorem only applies to right-angled triangles, where the two shorter sides meet at a 90° angle.

Loading Gananayantra…