SoupCalc

Pythagorean Theorem Calculator for a Right Triangle

Pythagorean Theorem Calculator: enter values and calculate the result.

Use this tool to enter the required values, run the calculation, and compare the key results immediately.

What this tool calculates

The calculator finds the hypotenuse of a right triangle from the lengths of its two perpendicular legs. The hypotenuse is the side opposite the 90-degree angle and is the triangle's longest side.

Both leg inputs must be positive. Zero or negative lengths are rejected because they do not form the non-degenerate right triangle described by this tool. The calculator assumes the included angle is exactly 90 degrees; it does not infer that fact from measurements.

Inputs

Enter leg a and leg b in the same length unit. The output uses that unit. If one measurement is in metres and the other in centimetres, convert one before calculating. Do not enter the hypotenuse into a leg field and expect the tool to solve for the missing side.

Measurements carry uncertainty. A tape reading of 3.0 m is not infinitely precise, so retain sensible significant figures and avoid interpreting a long decimal as measurement certainty.

Method and formula

For a Euclidean right triangle:

a² + b² = c²

where c is the hypotenuse. Solving for c gives:

c = √(a² + b²)

The implementation evaluates the two squares and their square root using a numerically stable hypotenuse operation. Interchanging a and b does not change the result. Because both legs are positive, c is positive and larger than either leg.

Worked example

Let the perpendicular legs be 3 and 4 units.

3² + 4² = 25, because 9 + 16 = 25. Taking the positive square root gives c = √25 = 5.

The calculator therefore reports a hypotenuse of 5 units. A quick geometry check confirms 5 is longer than both 3 and 4. Entering −3 and 4 is rejected rather than silently squaring away an invalid negative length.

How to interpret the result

Use the answer as the straight-line side opposite the confirmed right angle. Common applications include a rectangular diagonal, ladder reach in an idealized layout, coordinate displacement after orthogonal components, or a squareness check using a 3–4–5 ratio.

For a rectangle with width a and height b, c is the corner-to-corner diagonal. For coordinate differences, use absolute or signed components consistently; squaring removes component signs while the final distance remains non-negative.

Accuracy and limitations

The theorem applies to right triangles in Euclidean geometry. If the included angle is not 90 degrees, use the law of cosines with the measured angle. Large geographic distances on Earth's surface require spherical or geodesic methods rather than a flat-triangle approximation.

The page does not solve for a missing leg, calculate angles or area, validate field measurements, propagate uncertainty, or convert units. Floating-point formatting can round irrational results. Safety-critical construction and surveying require calibrated instruments and applicable professional standards.

Sources

Editorial record

Author: SoupCalc Editorial Team

Last reviewed: August 14, 2026

Review scope: Positive-leg validation, Euclidean right-angle assumption, unit handling, root computation, geometry boundaries, and the 3–4–5 worked example were checked.