Right triangle calculator
Hypotenuse, leg, area and perimeter by the Pythagorean theorem.
Fill in the fields and the result will appear here automatically.
Completes a right triangle in either direction: two legs give the hypotenuse, a leg plus the hypotenuse gives the other leg. The second mode is the stricter one — the hypotenuse must be longer than the leg, otherwise the value under the root turns negative and the result stops existing. This is the calculation behind the builder’s 3-4-5 trick for checking a square corner.
How it works
Formula and logic
a² + b² = c², so c = √(a² + b²) and b = √(c² − a²). The area of a right triangle is half the product of its legs.
Example
Legs of 3 and 4 m give a hypotenuse of 5 m, an area of 6 m² and a perimeter of 12 m.
Fields and units
- Length unit — list option
- What is known — list option
- Leg a — cm
- Leg b — cm
- Hypotenuse — cm
How to use
- — Choose two legs, or one leg and the hypotenuse.
- — The legs meet at a right angle; the hypotenuse lies opposite it.
- — Use positive lengths in one unit.
- — In the inverse mode the hypotenuse must be strictly longer than the known leg.
- — Use a different calculation for a general triangle.
Method and limitations
- Calculation method
- Formula and logic
- Data or methodology source
- OpenStax: Pythagorean theorem for a right triangle
- Limitation
- A right angle is an assumption of the model; two lengths do not establish it. Zero-area cases are excluded. A rounded answer does not replace checking angles, tolerances and measurement accuracy.
FAQ
Why can the hypotenuse not equal a leg?
The hypotenuse is the longest side of a right triangle. If they were equal the other leg would be zero and the triangle would collapse into a segment.
What is the 3-4-5 rule?
A layout trick: mark 3 and 4 units along two sides, and if the diagonal measures exactly 5 the angle between them is square. It is a special case of the Pythagorean theorem.
How is the area calculated?
As half the product of the legs: they are perpendicular, so one acts as the base and the other as the height.
Can the hypotenuse be shorter than a leg?
No. Such a set does not describe a triangle, and the calculator says so rather than returning the root of a negative number.
Why do measurements matter when the hypotenuse nearly equals a leg?
The other leg is b = √((c−a)(c+a)). A small difference c−a can have a large relative measurement error. Rounding c and a to the same value creates a degenerate case; keep the original measurement precision.