Pythagorean Theorem Calculator
Find the hypotenuse from the two legs of a right triangle, or the missing leg from one leg and the hypotenuse; also get the area, perimeter and height to the hypotenuse.
Things to keep in mind:
- The theorem applies only to right triangles (one 90° angle); oblique triangles need the law of cosines.
- If the hypotenuse is not longer than the known leg no triangle exists; the "valid triangle" output is 0 and the other results show 0.
- Angles are not calculated; only side lengths, area, perimeter and height are given.
Calculator
Result
Enter the values and press Calculate to see the result here.
About this tool
The Pythagorean theorem states that in a right triangle the squares of the two legs add up to the square of the hypotenuse (the longest side): a² + b² = c². This tool solves both common questions.
Formulas
- Hypotenuse: c = √(a² + b²)
- Missing leg: b = √(c² − a²) (c must be longer than a)
- Area: a × b / 2
- Perimeter: a + b + c
- Height to the hypotenuse: h = a × b / c
Example: with a = 3 and b = 4, c = √(9 + 16) = 5, the area is 6, the perimeter 12 and the height to the hypotenuse 2.4. Conversely, a = 5 and c = 13 give b = √(169 − 25) = 12 (the 5-12-13 triangle).
It is handy for ladder lengths, diagonal measurements, screen sizes, land distances and checking that corners are square on a building site. Enter every length in the same unit; the area is in that unit squared.
How to read the result: if "Valid triangle" is 1 the calculation is complete; if it is 0 (in missing-leg mode the hypotenuse is not longer than the leg entered) no triangle exists and the other results show 0. The hypotenuse is always the longest side. Area and height to the hypotenuse are read together with the perimeter in the same unit; area is in that unit squared. Because results are rounded to 4 decimals, roots such as √2 are approximate (a = 1 and b = 1 give c = 1.4142).
How to use
- Choose what to find: the hypotenuse or the missing leg.
- Enter the known sides in the same length unit (a and b, or a and c).
- Click Calculate to see the sides, area, perimeter and height.
Notes
Results are rounded HALF_UP to 4 decimals. Sides must be between 0.0001 and 1,000,000,000. Square roots are decimal approximations; integer triples such as 3-4-5 come out exact. No unit conversion is done: all sides must share one unit.
Frequently asked questions
In a right triangle the sum of the squares of the legs equals the square of the hypotenuse: a² + b² = c². The hypotenuse is the longest side, opposite the right angle.
If the square of the longest side equals the sum of the squares of the other two, the triangle is right-angled. For example 5² = 3² + 4², so 3-4-5 is a right triangle.
The area can be written two ways: a × b / 2 = c × h / 2, so h = a × b / c.
Any length unit such as metres, centimetres or inches, as long as all three sides use the same one. The area is in that unit squared.
In missing-leg mode the hypotenuse must be longer than the leg you entered. If it is equal or shorter, the sides cannot form a right triangle.
Next step
Related tools to continue your calculation.
- Calculate
Area and Perimeter Calculator (Geometric Shapes)
Calculate the area and perimeter of a square, rectangle, triangle, circle, trapezoid, parallelogram, rhombus or ellipse, with the area in square metres.
- Calculate
Exponent and Root Calculator (Power, Square Root, Cube Root, n-th Root)
Raise a number to any power (including fractional and negative exponents) and take its square root, cube root and n-th root.
- Calculate
Volume and Surface Area Calculator (Cube, Cylinder, Sphere, Cone)
Calculate the volume and surface area of a cube, cuboid, cylinder, sphere, cone, square pyramid or frustum, with the volume in m³ and litres.
- Calculate
Quadratic Equation Solver (ax² + bx + c = 0)
Solve ax² + bx + c = 0: discriminant, real or complex roots, the vertex of the parabola and the sum and product of the roots.
- Calculate
Logarithm Calculator (log, ln, log2 and Antilog)
Calculate the logarithm of a number in any base, its natural (ln), common (log10) and binary (log2) logarithm, and the antilogarithm.