Pythagorean Theorem Calculator
a squared + b squared = c squared, where c is the hypotenuse and a and b are the legs.
Choose what you are solving for
A right triangle has two short sides, the legs, meeting at the square corner, and a long side opposite it, the hypotenuse. The switch at the top decides whether you are after the hypotenuse or one of the legs, and the fields change to match.
Pick hypotenuse mode when you know both legs, which is the textbook case. Pick leg mode when you already have the hypotenuse and one leg and need the third side, which is more common in real measuring than in homework.
Reading the answer
The result is the length of the side you asked for, in whatever unit you measured the others in. There is no unit conversion happening, so feet in means feet out.
One thing the result quietly assumes is a genuine right angle. If the corner is only roughly 90 degrees, the answer will be close but not exact, and for anything load-bearing that gap can matter.
The theorem, both ways round
The theorem states that a squared plus b squared equals c squared, where c is the hypotenuse. To find the hypotenuse, add the squares of the two legs and take the square root of the total.
To find a leg instead, rearrange it. Subtract the square of the known leg from the square of the hypotenuse, then take the square root of what is left. The calculator handles whichever rearrangement your mode needs.
The 3-4-5 triangle and its relatives
Legs of 3 and 4 give a hypotenuse of 5, because 9 plus 16 is 25 and the root of 25 is 5. It is the first example everyone meets, and builders still use it to square up corners.
Switch to leg mode and the same idea runs backward. A hypotenuse of 13 with one leg of 5 leaves a missing leg of 12, since 169 minus 25 is 144 and the root of 144 is 12.
Only right triangles qualify
The theorem depends entirely on that 90 degree corner. Feed it a triangle without one and the answer is simply wrong, not just imprecise.
For triangles with no right angle, the law of cosines is the tool that fits. It generalizes the same idea but adds a term for the actual angle between the sides. This page sticks to the clean right-angle case on purpose.
Where it earns its keep
Beyond class, the theorem squares up framing and decking, finds the diagonal brace for a gate, and turns a horizontal distance and a height into the straight-line length of a ramp or rafter.
It is also the engine behind the distance between two points on a grid, which is why the slope calculator leans on the same arithmetic to report distance alongside the slope.
Pythagorean Theorem Calculator FAQ
How do I find the hypotenuse?
Square both legs, add the results and take the square root. Legs of 6 and 8 give a hypotenuse of 10.
Keep hypotenuse mode selected, enter the two legs, and the calculator returns the long side.
How do I find a missing leg?
Square the hypotenuse, subtract the square of the leg you know, and take the square root of the difference.
Switch to leg mode, enter the hypotenuse and the known leg, and the third side appears.
Does this work for any triangle?
No. The Pythagorean theorem applies only to right triangles, where one angle is exactly 90 degrees.
For triangles without a right angle, use the law of cosines instead.
What is a Pythagorean triple?
It is a set of three whole numbers that satisfy the theorem, such as 3-4-5, 5-12-13 or 8-15-17.
These make tidy right triangles with no decimals, which is why they show up so often in lessons and in framing.
Which side is the hypotenuse?
It is the longest side, always sitting opposite the right angle. The two sides that meet at the right angle are the legs.