Skip to main content
HSCalculadora

Pythagorean Theorem Calculator

Find the hypotenuse of a right triangle.

Results update as you type.

Hypotenuse (c)
—

How it works

The Pythagorean theorem is one of the most famous results in all of mathematics, describing the relationship between the three sides of a right triangle. It states that the square of the hypotenuse, the side opposite the right angle, equals the sum of the squares of the other two sides, the legs. This Pythagorean theorem calculator takes the lengths of the two legs and returns the length of the hypotenuse using the formula c equals the square root of a squared plus b squared. The theorem only applies to right triangles, those with one ninety-degree angle, but within that family it is exact and universal. The classic example is the 3-4-5 triangle: with legs of 3 and 4, the hypotenuse is the square root of 9 plus 16, which is the square root of 25, or exactly 5. Other well-known whole-number sets, called Pythagorean triples, include 5-12-13 and 8-15-17. This relationship is the foundation of the distance formula in coordinate geometry, and it appears constantly in construction, navigation, and design whenever a diagonal length must be found from horizontal and vertical measurements. Carpenters use it to check that corners are square, surveyors use it to measure across obstacles, and students meet it early in geometry. Because a length cannot be negative, this calculator requires both legs to be zero or positive.

Formula

c = √(a² + b²)

The Pythagorean theorem states that in any right triangle the square of the hypotenuse equals the sum of the squares of the two legs. Rearranging to solve for the hypotenuse, you square each leg, add those areas together, and take the square root of the total. The theorem holds only for right triangles because the ninety-degree angle is exactly what makes the squared side lengths relate this way, a fact proven geometrically by rearranging the areas of squares built on each side.

Source:Pythagorean theorem

We review all our tools from time to time to ensure accuracy.

Worked example

Side a (leg):3Side b (leg):4
c = √(3² + 4²) = √(9 + 16) = √25 = 5, the classic 3-4-5 triangle.

How to use this calculator

  1. 1

    Enter your values

    Enter side a (leg) and side b (leg).

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Hypotenuse (c) updates instantly as you type — no button to press.

Frequently asked questions

What is the Pythagorean theorem?

The Pythagorean theorem relates the three sides of a right triangle, stating that the square of the hypotenuse equals the sum of the squares of the two legs. Written as a symbol equation it is a squared plus b squared equals c squared, where c is the hypotenuse. It lets you find any one side when you know the other two, and it underpins much of geometry, trigonometry, and coordinate distance calculations.

Which side is the hypotenuse?

The hypotenuse is the longest side of a right triangle, always the one directly opposite the right angle. The other two sides, which meet at the ninety-degree corner, are called the legs. Because the hypotenuse is opposite the largest angle, it is necessarily the longest side. This calculator computes the hypotenuse from the two legs, so the answer will always be greater than either leg you enter.

Does it work for any triangle?

No, the Pythagorean theorem applies only to right triangles, those containing exactly one ninety-degree angle. For triangles without a right angle you need the law of cosines, a more general relationship that reduces to the Pythagorean theorem when the angle happens to be ninety degrees. If your triangle is not right-angled, this calculator will not give a meaningful result for a missing side.

What is a Pythagorean triple?

A Pythagorean triple is a set of three whole numbers that satisfy the theorem exactly, so the two smaller ones squared and added equal the largest one squared. The best known is 3, 4, 5, followed by 5, 12, 13 and 8, 15, 17. Any multiple of a triple, such as 6, 8, 10, is also a triple. These integer solutions are prized because they give clean right triangles without decimals.

How do I find a leg instead of the hypotenuse?

Rearrange the theorem to solve for the unknown leg: subtract the known leg squared from the hypotenuse squared, then take the square root. In symbols, a equals the square root of c squared minus b squared. This works whenever you know the hypotenuse and one leg. Just make sure the hypotenuse is the larger value, since subtracting a bigger square from a smaller one would leave a negative under the root.