Finance 44 tools → Date 19 tools → Health 27 tools → Everyday 23 tools → Math 19 tools → Construction 16 tools → PDF 23 tools → Education 10 tools → Conversion 7 tools → Text 12 tools → Image 8 tools → About → Contact →

Pythagorean Theorem Calculator

Runs entirely in your browser — your numbers are never sent anywhere.

Missing side
—

Detail

Step-by-step working

The most famous equation in geometry

In any right-angled triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². It is arguably the most useful single fact in all of practical geometry — the bridge between algebra and shape — and this calculator applies it in all three directions. Give it the two legs and it finds the hypotenuse; give it the hypotenuse and one leg and it finds the missing leg; and in every case it also reports the triangle's two acute angles, because once all three sides are known the shape is completely determined. Choose what to solve for, enter the two sides you know, and read the third.

The classic example earns its fame honestly: legs of 3 and 4 give a hypotenuse of exactly 5, since 9 + 16 = 25. Builders have exploited that 3-4-5 triangle for millennia — a knotted rope with those proportions checks whether a corner is truly square, a trick recorded from Egyptian surveyors to modern deck builders. Other whole-number triples exist (5-12-13, 8-15-17, and any multiple of these, such as 6-8-10), but most real triangles are not so tidy: legs of 1 and 1 give a hypotenuse of √2, the number whose irrationality reputedly scandalised the Pythagoreans themselves.

The three forms of the theorem

Finding the hypotenuse: c = √(a² + b²)  ·  Finding a leg: a = √(c² − b²),   b = √(c² − a²)

Solving for the hypotenuse adds the squares and takes the root; solving for a leg subtracts the known leg's square from the hypotenuse's square. Mixing those two up is the classic error, and the sanity check that catches it is built into the definition: the hypotenuse is always the longest side. If your found leg comes out longer than the hypotenuse you were given, a subtraction went the wrong way. This page enforces the same honesty — asked for a leg when the supposed hypotenuse is not longer than the other leg, it reports that no such right triangle exists rather than printing the square root of a negative number in disguise.

The angles come free with the sides

Because the sides fix the shape, they fix the angles too. The angle opposite side a is the arcsine of a divided by c — the ratio of the opposite side to the hypotenuse, which is exactly what sine means — and the other acute angle is simply what remains after subtracting from 90 degrees, since the three angles of any triangle sum to 180 and one of them is the right angle. In the 3-4-5 triangle those angles are about 36.87 and 53.13 degrees, a pair worth recognising. Reporting the angles alongside the sides turns this from a length tool into a complete description of the triangle, ready for use in the Slope Calculator's world of gradients and inclines or in any trigonometry that follows.

Where the theorem does real work

Distance is the theorem's day job. The straight-line gap between two points on a grid, a screen or a map is a hypotenuse whose legs are the horizontal and vertical differences — the same calculation the slope page performs. Ladders against walls, diagonal braces in gates and fences, the true size of a television (measured corner to corner, which is a hypotenuse of its width and height), the throw of a projector, and the setback of a guy rope are all one-triangle problems. In three dimensions the same idea stacks: the long diagonal of a box is found by applying the theorem twice, which is how you check whether a rigid object will fit through a doorway at an angle. Whenever a problem can be coaxed into a right triangle — and a dropped vertical line creates one almost anywhere — this theorem is the engine.

Worked example

Legs 3 and 4: c = √(9 + 16) = √25 = 5, with angles of about 36.8699° opposite the side of length 3 and 53.1301° opposite the side of length 4. Working backwards, a hypotenuse of 13 with a leg of 5 gives the other leg as √(169 − 25) = 12.

How to use this calculator

  1. Choose what to solve for: the hypotenuse c, or leg a, or leg b.
  2. Enter the two sides you know (the field for the side being solved is ignored).
  3. Read the missing side in the green panel.
  4. Check both angles and the a squared plus b squared versus c squared verification.
  5. Follow the working panel to see the addition or subtraction of squares with your numbers.

Why it is true, in one picture

Dozens of proofs exist, and the most persuasive needs no words: draw a square of side a + b, place four copies of the triangle inside it leaving a tilted square of side c in the middle, and count area two ways. The big square's area is (a + b) squared; it also equals the four triangles plus the tilted inner square, c squared plus twice a times b. Expanding the first count gives a squared plus 2ab plus b squared, the 2ab cancels, and a squared plus b squared equals c squared remains. The converse is equally useful and equally old: if a triangle's sides satisfy the equation, the angle between the two shorter sides must be a right angle — which is precisely why the 3-4-5 rope works as a square-corner checker on building sites to this day.

Frequently asked questions

Which side is the hypotenuse?
The side opposite the right angle, and always the longest side of the triangle. On this page it is labelled c. If the side you call c is not the longest, the inputs cannot form a right triangle.
How do I find a missing leg instead of the hypotenuse?
Subtract instead of adding: a leg equals the square root of the hypotenuse squared minus the other leg squared. Choose solve for a or solve for b in the selector and enter the hypotenuse and the known leg.
Does the theorem work for triangles without a right angle?
No — it is exactly equivalent to the angle being 90 degrees. For other triangles the law of cosines generalises it, adding a correction term involving the cosine of the angle; at exactly 90 degrees that term vanishes and Pythagoras remains.
Keep going

Related math calculators