Hypotenuse Calculator
A right triangle with legs of 3 and 4 has a hypotenuse of 5. This hypotenuse calculator solves the longest side of any right triangle using the Pythagorean theorem, which states that the square of the hypotenuse equals the sum of the squares of the two legs. Enter the lengths of the two shorter sides, called the legs, and the tool returns the hypotenuse c from the formula c equals the square root of a squared plus b squared. You can also flip the problem around. If you already know the hypotenuse and one leg, switch to the second mode and the calculator solves for the missing leg using b equals the square root of c squared minus a squared. Every result is rounded to four decimal places, and in leg-to-hypotenuse mode the tool also reports the interior angle opposite the first leg so you can check the shape of your triangle at a glance.
Quick answer
The hypotenuse is the longest side of a right triangle and always sits directly across from the 90 degree angle.
What this tells you
- •The hypotenuse is the longest side of a right triangle and always sits directly across from the 90 degree angle.
- •The core formula is c = sqrt(a squared + b squared), where a and b are the two legs and c is the hypotenuse.
- •In leg-and-hypotenuse mode the tool rearranges the same equation to b = sqrt(c squared - a squared) to find a missing leg.
- •Finding a missing leg requires the hypotenuse to be strictly longer than the known leg, because a leg can never be longer than the side opposite the right angle.
- •All three side lengths must be positive numbers, since a triangle side cannot have zero or negative length.
- •Results are rounded to four decimal places, which keeps clean values like 5 exact while still handling irrational answers such as 7.0711.
How to Use
- 11. Choose your mode. Use From two legs when you know both short sides, or use From hypotenuse and one leg when you know the longest side and one other side.
- 22. In From two legs mode, enter the length of leg a and the length of leg b in their fields. Order does not matter for the hypotenuse.
- 33. In From hypotenuse and one leg mode, enter the hypotenuse c and the one leg a you already know. Make sure c is larger than a.
- 44. Press Calculate to read the answer. The primary result is the hypotenuse or the missing leg depending on your mode.
- 55. Check the secondary values for the known sides and, in leg mode, the angle opposite leg a, which helps you confirm the triangle matches the shape you expect.
How It Works
Formula
c = sqrt(a² + b²) and b = sqrt(c² - a²)The Pythagorean theorem links the three sides of any right triangle. The hypotenuse c, the side opposite the right angle, satisfies c squared equals a squared plus b squared, where a and b are the two legs that meet at the right angle. To find the hypotenuse you square both legs, add them, and take the square root of the total. To find a missing leg you rearrange the same equation into b squared equals c squared minus a squared, then take the square root. That rearranged form only produces a real answer when the hypotenuse is longer than the known leg, because a negative number under the square root has no real value and would describe an impossible triangle. This calculator enforces that rule by requiring c to be greater than a in leg-solving mode.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Classic 3-4-5 triangle
Squaring the legs gives 9 and 16, and their sum is 25. The square root of 25 is exactly 5, which is why the 3-4-5 triangle is the most familiar right triangle in geometry and a common check for a square corner in construction.
Both legs equal (an isosceles right triangle)
When both legs are 5, the sum of squares is 50 and the hypotenuse is the square root of 50, about 7.0711. Because the legs are equal, the two non-right angles are each 45 degrees, so the tool reports 45 degrees for the angle opposite leg a.
Solving for a missing leg
Here the hypotenuse is 13 and one leg is 5. Squaring gives 169 and 25, and their difference is 144. The square root of 144 is 12, recovering the well known 5-12-13 right triangle.
A real-world diagonal
A rectangular garden bed that is 6 feet by 8 feet has a diagonal of 10 feet, since 36 plus 64 equals 100 and the square root of 100 is 10. This is how the hypotenuse formula measures straight-line distances across rectangles.
Common Pythagorean Triples
Whole-number right triangles where the hypotenuse comes out exact.
| Leg a | Leg b | Hypotenuse c | Notes |
|---|---|---|---|
| 3 | 4 | 5 | The best known triple |
| 5 | 12 | 13 | A steeper triangle |
| 6 | 8 | 10 | A doubled 3-4-5 |
| 8 | 15 | 17 | A common exam triple |
| 9 | 12 | 15 | A tripled 3-4-5 |
| 7 | 24 | 25 | A long, narrow triple |
A Pythagorean triple is a set of three whole numbers that fit c squared equals a squared plus b squared. Most triangles do not have whole-number hypotenuses, so expect decimal answers in general.
Why the hypotenuse is always the longest side
In a right triangle the hypotenuse sits opposite the 90 degree angle, and the largest angle in any triangle always faces the longest side. Since the right angle is the biggest of the three angles in a right triangle, the side facing it, the hypotenuse, has to be the longest. The two legs meet at the right angle and are always shorter than c.
The Pythagorean theorem makes this concrete. Because c squared equals a squared plus b squared, and both a squared and b squared are positive, c squared is strictly larger than either leg squared. Taking square roots preserves that order, so c is larger than both a and b. This is exactly why the leg-solving mode of this calculator rejects any case where the entered hypotenuse is not greater than the known leg.
The hypotenuse formula also powers the distance formula in coordinate geometry. The straight-line distance between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps between the points. That connection means the same calculation you use for a triangle side also measures diagonals of screens, room layouts, and map coordinates.
Common mistakes
- Adding the legs before squaring them. The formula squares each leg first, then adds. Adding 3 and 4 to get 7 and squaring that gives 49, not the correct 25.
- Forgetting to take the final square root. The sum of squares gives c squared, not c. You must take the square root of that total to get the actual hypotenuse length.
- Treating a non-right triangle as a right triangle. The Pythagorean theorem only applies when one angle is exactly 90 degrees. For other triangles you need the law of cosines instead.
- Entering a hypotenuse that is shorter than the known leg in leg-solving mode. A leg can never be longer than the hypotenuse, so this describes an impossible triangle and the tool returns no result.
- Mixing up which side is the hypotenuse. The hypotenuse is always opposite the right angle and is never one of the two sides that form the right angle.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="hypotenuse-calculator" async></script>Preview the embed at /embed/hypotenuse-calculator/.