Skip to content

Pythagorean Theorem Calculator

Enter two sides of a right triangle and get the third — exactly, in simplest radical form, with a decimal beside it — together with the area, the perimeter, every step of a² + b² = c², and a diagram drawn to scale. You can also enter three sides and find out whether they make a right, acute or obtuse triangle. Free, no sign-up.

What do you want to do?
Side to find

Positive whole numbers, decimals or fractions such as 3/2.

Results

5

Side c

6

Area

12

Perimeter

The working

a² + b² = c²

c² = 3² + 4² = 9 + 16 = 25

c = √25 = 5

All three sides are whole numbers with no common factor, so (3, 4, 5) is a primitive Pythagorean triple.

Diagram

A right triangle drawn to scale with the right angle at the lower left, leg a along the bottom, leg b on the left and hypotenuse c opposite the right anglea = 3b = 4c = 5

How to Use the Pythagorean Theorem Calculator

  1. 1. Choose what to find. Pick the hypotenuse c or one of the legs, a or b. The two boxes that remain are the sides you know.
  2. 2. Enter the lengths. Whole numbers, decimals and fractions such as 3/2 are all kept exact. When you solve for a leg, the hypotenuse must be longer than the leg you enter.
  3. 3. Read the answer. The side appears in simplest radical form — for example 6√2 — and as a decimal, followed by the area and perimeter.
  4. 4. Follow the steps and the diagram. The substitution into a² + b² = c² is written out, and the triangle is drawn with the unknown side highlighted. To test three sides instead, switch to the check mode.

The Pythagorean Theorem

In a right triangle, the square of the hypotenuse — the side opposite the right angle — equals the sum of the squares of the two legs: a² + b² = c². Rearranged, it gives each side: c = √(a² + b²), and a = √(c² − b²) or b = √(c² − a²). The hypotenuse is always the longest side, which is why the calculator rejects a leg that is as long as c or longer.

To findFormulaCondition
Hypotenuse cc = √(a² + b²)a, b > 0
Leg aa = √(c² − b²)c > b
Leg bb = √(c² − a²)c > a

Simplest Radical Form

Most right triangles do not have whole-number sides, so the answer is a square root. To simplify it, pull out the largest square factor: √72 = √(36 × 2) = 6√2. If the number under the root has no square factor, as with 51, the radical is already in simplest form. Exact form is what a textbook or exam asks for; the decimal is what you need to measure something.

Worked Examples

  • Legs 6 and 6. c² = 36 + 36 = 72, so c = √72 = 6√2 ≈ 8.485281. The area is 18 and the perimeter is 12 + 6√2 ≈ 20.485281.
  • Leg 7, hypotenuse 10. b² = 100 − 49 = 51, so b = √51 ≈ 7.141428, which cannot be simplified.
  • Legs 3 and 4. c² = 9 + 16 = 25, so c = 5 exactly: the best-known Pythagorean triple.
  • Legs 1.5 and 2. c² = 2.25 + 4 = 6.25, so c = 2.5. These sides are the 3-4-5 triple multiplied by 1/2.

Pythagorean Triples

A Pythagorean triple is three positive whole numbers with a² + b² = c². A triple is primitive when the three numbers share no common factor; every other triple is a whole-number multiple of a primitive one. The smallest primitive triples are (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29) and (9, 40, 41). Euclid's formula generates all primitive triples: for coprime whole numbers m > n > 0 that are not both odd, a = m² − n², b = 2mn and c = m² + n². Taking m = 2 and n = 1 gives (3, 4, 5); m = 3 and n = 2 gives (5, 12, 13).

Is It a Right Triangle? The Converse

The theorem also works backwards. Square the two shorter sides and add them, then compare with the square of the longest side: if a² + b² = c², the triangle is right-angled; if a² + b² > c², the largest angle is less than 90° and the triangle is acute; if a² + b² < c², the largest angle is more than 90° and it is obtuse. Sides 4, 5 and 6 give 16 + 25 = 41 > 36, so that triangle is acute; sides 2, 3 and 4 give 4 + 9 = 13 < 16, so it is obtuse. The calculator does this comparison in exact fractions, so decimal sides such as 0.3, 0.4 and 0.5 are classified correctly with no rounding doubt. It also checks the triangle inequality first: sides 1, 2 and 3 cannot close into a triangle at all.

Frequently Asked Questions

How do you find the hypotenuse of a right triangle?
Square both legs, add the squares, and take the square root: c = √(a² + b²). For legs of 5 and 12 that is √(25 + 144) = √169 = 13. If the sum is not a perfect square, leave the answer as a simplified radical, or give a decimal.
How do you find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse and take the root: a = √(c² − b²). With c = 10 and b = 7 that is √(100 − 49) = √51 ≈ 7.14. The hypotenuse must be the larger number, otherwise no right triangle exists.
Does the Pythagorean theorem work for any triangle?
No — only for right triangles. For other triangles the law of cosines generalizes it: c² = a² + b² − 2ab cos C, which reduces to the Pythagorean theorem when C is 90° because cos 90° is 0.
What is a Pythagorean triple?
Three positive whole numbers that satisfy a² + b² = c², such as 3-4-5 or 5-12-13. Multiplying every number in a triple by the same whole number gives another triple, so 6-8-10 and 9-12-15 are multiples of 3-4-5.
Why does the calculator give a square root instead of a decimal?
A square root such as √72 is the exact length; any decimal for it is rounded. Giving 6√2 lets you keep working without accumulating rounding error, and a decimal approximation is shown beside it for measuring.
Can the legs be decimals or fractions?
Yes. Decimals and fractions are converted to exact fractions, so legs of 1.5 and 2 give a hypotenuse of exactly 5/2, and the sides are recognized as a scaled 3-4-5 triple.

Related Tools

More in Math Calculators

See all Math Calculators