Geometry · Formula v1.0

Pythagorean Theorem Calculator

Use the Pythagorean Theorem Calculator to calculate the hypotenuse of a right triangle from its two legs.

Only applies to right triangles: a 90° angle between the two legs. At the worked-example inputs, the hypotenuse is 5. The hypotenuse is the square root of the sum of the squares of the legs. On the example, legs of 3 and 4 give a hypotenuse of 5 and an area of 6, the classic 3-4-5 right triangle. Builders use the 3-4-5 rule to check that corners are square: measure 3 feet along one wall, 4 along the other and confirm the diagonal is 5. It also gives the straight-line distance between two points on a grid. It returns hypotenuse, triangle area.

FreeNo sign-upInputs stay in-browserCSV exportReviewed August 28, 2026
LAST REVIEWEDAugust 28, 2026Inputs stay in your browser
Live calculation

Enter your numbers

Calculated result
Hypotenuse5
Triangle area6
Sensitivity check

What if leg a changes?

-10% input4.8
0% input5
+10% input5.2

Transparent method

The formula

Hypotenuse = √(a² + b²)

Worked example

Hypotenuse5
Triangle area6

Example inputs

Leg A3
Leg B4

How to interpret the result

The theorem only holds when the angle between the two given sides is genuinely ninety degrees. Apply it to a triangle that merely looks roughly square and the hypotenuse comes out wrong, sometimes by a meaningful margin depending on how far the real angle sits from ninety.

Before you rely on it

What to check

Confirm the two known sides actually meet at a right angle, ideally measured, before running the calculation. A framing square or a measured 3-4-5 check is more reliable than eyeballing it.

The common error

Where people go wrong with pythagorean theorem calculator

Applying the theorem to any triangle with a roughly square corner. Off by even a few degrees, the result stops being the hypotenuse of anything real and becomes a number that only looks like one.

Sensitivity evidence

How leg a changes the hypotenuse

Pythagorean Theorem Calculator: hypotenuse and triangle area across a range of leg a, every other input held at the worked-example value.
Leg AHypotenuseTriangle area
2.44.74.8
2.74.85.4
3worked example56
3.35.26.6
3.65.47.2

Every input, tested

Which input moves the hypotenuse most

Pythagorean Theorem Calculator: hypotenuse with each input moved on its own, every other input held at the worked-example value.
InputTested fromToHypotenuse at each endSwing
Leg B3.64.44.7 to 5.30.639 (13%)
Leg A2.73.34.8 to 5.20.36 (7.2%)

Two variables at once

Hypotenuse by leg a and leg b

Pythagorean Theorem Calculator: hypotenuse at each combination of leg a (rows) and leg b (columns).
Leg A \ Leg B3.244.8
2.444.75.4
2.74.24.85.5
34.455.7
3.34.65.25.8
3.64.85.46

Step by step

The worked example, input by input

Worked-example inputs and the results they produce for the pythagorean theorem calculator.
InputValue used
Leg A3
Leg B4
Hypotenuse5
Triangle area6

Where the inputs come from

Enter the lengths of the two legs of a right triangle, the sides that meet at the right angle, in the same unit. The hypotenuse is the longest side, opposite the right angle. The theorem says the square of the hypotenuse equals the sum of the squares of the legs. To find a leg instead, use the right triangle calculator. Make sure the triangle really has a right angle before using the theorem.

When the result stops applying

The theorem applies only to right triangles, and for other triangles you need the law of cosines. Measurement errors show up in the result, especially for long distances. Units must match. In three dimensions, the space diagonal of a box extends the formula with a third term.

What to compare it with

Solve for angles and missing legs on the right triangle calculator, general triangles on the law of sines and triangle side pages, and distance on the distance and slope calculator. The rectangular prism page gives space diagonals, and the roof and stair tools in the carpentry category use right triangles.

People also ask

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides.

What are Pythagorean triples?

Sets of whole numbers that satisfy the theorem, such as 3-4-5, 5-12-13 and 8-15-17, useful for quick checks.

How can I check a corner is square?

Measure 3 units along one side and 4 along the other. If the distance between the marks is 5 units, the corner is a right angle.

Common geometry questions

Sources and evidence

Background reading

Guides that use this calculator

Definitions

Terms used on this page