What this calculator does
Find the missing side of a right triangle when you know the other two sides. A right triangle has one square corner, a 90° angle. The two sides that make that corner are called the legs. The long side across from it is the hypotenuse. They always follow one rule, so any two sides are enough to find the third.
Choose whether you want the hypotenuse or a leg, then enter the two sides you know. You get the missing length as a decimal. For whole-number sides, you also get the exact answer with a square root, such as 5√2. The calculator also gives the area, the perimeter, both angles and the height to the hypotenuse. It tells you when the sides are a Pythagorean triple: three whole numbers that fit the rule. A third option checks whether three sides make a right triangle. If they don't, it says whether the biggest angle is narrower or wider than a square corner. Every line of the math is shown.
Where it's used
Why this math matters outside the classroom:
- Ladder placement. A 4 m ladder standing 1 m out from a wall reaches √(16 − 1), about 3.87 m, up the wall.
- Screen sizes. A TV screen 48 in wide and 27 in tall measures about 55 in on the diagonal, the size stores advertise.
- Squaring a corner. Builders check a corner is square by marking 3 ft along one wall and 4 ft along the other, then confirming the diagonal is 5 ft.
- Shortcuts. Walking diagonally across a 120 m by 50 m park covers 130 m instead of 170 m around the edge.
- Ramp length. A ramp that rises 0.5 m over a 6 m run needs a sloped surface about 6.02 m long.
Grade level and standards: Grade 8; Common Core State Standards for Mathematics 8.G.B.7. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Pick what you want to find. Choose the hypotenuse if you know both legs. Choose a missing leg if you know one leg and the hypotenuse. Or check three sides you already have.
- Enter the sides you know. Any length unit works, as long as every side uses the same one.
- Read the missing side and its exact form. Below it are the area, perimeter, angles and height. In check mode, read the yes-or-no answer and the comparison of squares.
- Open the steps to see the rule rearranged, your numbers put in and the square root taken.
What the inputs mean
- Leg a
- Either of the two shorter sides that meet at the square corner. It doesn't matter which leg you call a.
- Hypotenuse c
- The hypotenuse is always the longest side. If the number you enter isn't longer than the leg, no right triangle can exist, and the calculator will tell you. In check mode you can enter the three sides in any order. The longest one is treated as the possible hypotenuse.
Formula and method
c² = a² + b² c = √(a² + b²) b = √(c² − a²) = √((c − a)(c + a)) area = a × b ÷ 2, perimeter = a + b + c height to the hypotenuse = a × b ÷ c right triangle if a² + b² = c² (acute if greater, obtuse if less)
In the formulas, a and b are the two legs and c is the hypotenuse. A small ² means "times itself", so 5² is 25, and √ means square root. The first line is the rule itself: the two legs squared add up to the hypotenuse squared. Taking the square root of both sides gives the hypotenuse.
To find a missing leg, subtract a² from c² and take the square root. Behind the scenes, the calculator uses the form (c − a)(c + a). It gives the same answer, but stays accurate when the leg is almost as long as the hypotenuse.
The two legs meet at a square corner, so one can be the base and the other the height. That's why the area is half of a × b. The angle across from leg a comes from the tangent button on a calculator (written arctan or tan⁻¹), using a ÷ b. The two smaller angles always add up to 90°.
The rule also works backwards. If the two shorter sides squared add up to the longest side squared, the triangle has a square corner. If the sum is bigger, the largest angle is acute, meaning less than 90°. If it's smaller, that angle is obtuse, meaning more than 90°. The largest angle itself comes from a related rule called the law of cosines.
Worked example
A 13-foot ladder leans against a wall, with its foot 5 feet from the wall. How high up the wall does it reach?
- The ladder is the hypotenuse (c = 13). The distance along the ground is one leg (a = 5). Find the other leg.
- b² = c² − a² = 13² − 5² = 169 − 25 = 144.
- b = √144 = 12 feet.
- The triangle under the ladder has an area of 5 × 12 ÷ 2 = 30 square feet. Its perimeter is 5 + 12 + 13 = 30 feet.
Result: The ladder reaches 12 feet up the wall. Because 5, 12 and 13 are all whole numbers, they form a Pythagorean triple. The angle at the wall is about 22.6199°, and the angle at the ground is about 67.3801°.
Understanding the result
The hypotenuse is always longer than either leg, but shorter than the two legs added together. If an answer falls outside that range, check that the hypotenuse is in the right box.
Whole-number answers like 3-4-5 or 5-12-13 are Pythagorean triples. Most sides give lengths with endless decimals, so the decimal is rounded to the precision you choose. The exact square-root form, such as √2 for legs of 1 and 1, is the form most homework asks for.
Assumptions and limitations
- The triangle has an exact 90° angle between legs a and b.
- All sides use the same unit. The area is in that unit squared, such as square feet.
- This tool needs two sides. If you know a side and an angle instead, you need trigonometry (sine, cosine or tangent), not this rule alone.
- The exact square-root form is only shown when the sides you know are whole numbers.
- The right-triangle check allows for tiny rounding differences. So measured sides that are very close to a square corner, but not exact, may still be called acute or obtuse.
Frequently asked questions
Which side is the hypotenuse?
It's the side straight across from the square corner, and it's always the longest of the three. The two sides that form the square corner are the legs.
Why do I get an error when the leg equals the hypotenuse?
To find the other leg, the calculator works out √(c² − a²). If a equals c, that comes out to zero. If a is bigger, the number under the square root is negative. Neither one makes a real triangle, so the calculator asks you to check your sides.
Does the theorem work for triangles without a right angle?
No. For other triangles, a wider rule called the law of cosines takes its place. It says c² = a² + b² − 2ab·cos(C), where C is the angle across from side c. When C is 90°, its cosine is zero, and the rule shrinks back to the Pythagorean theorem.
Can I use it to find the distance between two points?
Yes. How far apart the points are across and up-and-down are the two legs. The straight-line distance between them is the hypotenuse. The slope calculator does this for you from coordinates.
How do I check if three sides make a right triangle?
Square the two shorter sides, add them, and compare with the longest side squared. For 5, 12 and 13: 25 + 144 = 169 = 13², so it's a right triangle. For 4, 5 and 6: 16 + 25 = 41, which is more than 36. So that triangle is acute instead.
How do I give the answer in simplest radical form?
"Radical form" means leaving the square root in the answer. To simplify it, pull out any perfect square, like 4, 9 or 25. Legs of 5 and 5 give c = √50 = √(25 × 2) = 5√2. If no perfect square other than 1 divides the number, as with √5, it's already as simple as it gets.
What are some common Pythagorean triples?
3-4-5, 5-12-13, 8-15-17 and 7-24-25 are the smallest ones. Any multiple of a triple is also a triple, so 6-8-10 and 9-12-15 work too. Builders use 3-4-5 to check that corners are square.
How this calculator is checked
Method: Pythagorean theorem and its converse (Euclid, Elements I.47–48); right-triangle area, altitude and arctangent angle definitions; law of cosines for the largest angle. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Pythagorean Theorem Calculator on your own website or blog for free. Paste this code where you want it to appear: