Skip to content

Pythagorean Theorem Calculator

Find the hypotenuse or a missing leg, in exact radical form, and test whether a triangle is right-angled.

Your details

Unit system
Find

One of the two sides that meet at the right angle.

Results update as you type

Hypotenuse c

5 in

Exact value
5 in
Pythagorean triple?
Yes — primitive triple (3, 4, 5)
Area
6 in²
Perimeter
12 in

Step-by-step solution
  1. c² = a² + b² = 3² + 4² = 9 + 16 = 25
  2. c = √25 = 5 in

The Pythagorean theorem links the three sides of every right triangle: the square of the hypotenuse — the side opposite the right angle — equals the sum of the squares of the two legs. This calculator puts that rule to work in three ways.

  • Hypotenuse c: enter the two legs and get the longest side.
  • A leg: enter one leg and the hypotenuse and get the missing side.
  • Is it right?: enter any three lengths and find out whether they form a right triangle, using the converse of the theorem.

Besides the decimal answer, you get the exact value whenever your lengths are whole numbers (or have one decimal): 50\sqrt{50} is simplified to 525\sqrt{2}, which is what a maths teacher expects to see. The calculator also tells you whether the three sides form a Pythagorean triple such as 3-4-5 or 5-12-13, and gives the area and perimeter of the triangle.

Every length has a unit switcher (mm, cm, m, km, inches, feet, yards, miles), so you can use it for homework, a ladder against a wall, the diagonal of a screen or the squareness of a building plot. For angles, heights and the full solution of a right triangle, see the right triangle calculator.

How to use this calculator

  1. Choose what you want to find: the hypotenuse, a leg, or whether a triangle is right-angled.
  2. Enter the known lengths. You may switch units per field; the calculator converts everything before squaring.
  3. Read the result, its exact radical form and the triple check. Open the steps to see each square written out.
  4. In "Is it right?" mode the longest of the three lengths is automatically treated as the candidate hypotenuse, so the order you type them in does not matter.

The formula

For a right triangle with legs aa and bb and hypotenuse cc:

a2+b2=c2c=a2+b2b=c2−a2a^2 + b^2 = c^2 \qquad c = \sqrt{a^2 + b^2} \qquad b = \sqrt{c^2 - a^2}

This is Proposition 47 of Book I of Euclid’s Elements. Its converse (Proposition 48) is just as useful: if three lengths satisfy a2+b2=c2a^2 + b^2 = c^2, the angle opposite cc is exactly 90°. If c2<a2+b2c^2 < a^2 + b^2 that angle is acute, and if c2>a2+b2c^2 > a^2 + b^2 it is obtuse.

To simplify a square root, factor out the largest perfect square: 72=36×2=62\sqrt{72} = \sqrt{36 \times 2} = 6\sqrt{2}. Internally the missing leg is computed as (c−a)(c+a)\sqrt{(c - a)(c + a)}, which is mathematically identical but avoids rounding loss when aa is close to cc.

Worked example

Hypotenuse. Legs of 7 cm and 24 cm: c=49+576=625=25c = \sqrt{49 + 576} = \sqrt{625} = 25 cm. Since 7, 24 and 25 are whole numbers, they form a primitive Pythagorean triple.

Exact form. Legs of 5 and 5: c=50=52≈7.0711c = \sqrt{50} = 5\sqrt{2} \approx 7.0711.

A leg. A 5 m ladder stands with its foot 1.4 m from a wall. How high does it reach? b=52−1.42=25−1.96=23.04=4.8b = \sqrt{5^2 - 1.4^2} = \sqrt{25 - 1.96} = \sqrt{23.04} = 4.8 m.

Converse. Sides 6, 8 and 10: 36+64=10036 + 64 = 100, so the triangle is right-angled. Sides 5, 6 and 8: 25+36=61<6425 + 36 = 61 < 64, so it is obtuse.

Pythagorean triples

A Pythagorean triple is a set of three whole numbers that satisfy a2+b2=c2a^2 + b^2 = c^2. A triple is primitive when the three numbers share no common factor; multiplying a primitive triple by any whole number gives another triple (6-8-10 is twice 3-4-5).

Primitive triple Check
3, 4, 5 9 + 16 = 25
5, 12, 13 25 + 144 = 169
8, 15, 17 64 + 225 = 289
7, 24, 25 49 + 576 = 625
20, 21, 29 400 + 441 = 841

Every primitive triple can be generated from two coprime integers m>nm > n of opposite parity: a=m2−n2a = m^2 - n^2, b=2mnb = 2mn, c=m2+n2c = m^2 + n^2 (Euclid’s formula).

Where the hypotenuse shows up in practice

Builders use the 3-4-5 rule to set out a square corner: mark 3 units along one wall and 4 along the other; if the diagonal measures exactly 5, the corner is 90°. The same idea gives the diagonal of a screen or a room, the length of a roof rafter (see the rafter length calculator) and the straight-line distance between two points on a grid.

Frequently asked questions

What is the hypotenuse?

It is the side opposite the right angle and always the longest side of a right triangle. In the formula a² + b² = c², the hypotenuse is c.

Does the Pythagorean theorem work for any triangle?

No, only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos C, which reduces to Pythagoras when C = 90°.

How do I find a leg instead of the hypotenuse?

Subtract instead of adding: b = √(c² − a²). Choose "A leg" in the calculator. The hypotenuse must be longer than the known leg, otherwise no right triangle exists.

How can I tell if three lengths make a right triangle?

Square the longest side and compare it with the sum of the squares of the other two. Equal means a right angle; smaller means acute; larger means obtuse. The "Is it right?" mode does this for you.

Why does the calculator show 5√2 instead of 7.07?

Because 5√2 is the exact value and 7.07 is only a rounding of it. Both are shown: the exact form is what exams usually require, the decimal is what you measure with.

Sources

Last updated:

More Math calculators

People also use