Pythagorean theorem calculator — find the hypotenuse or a missing leg

Enter two sides of a right triangle and the calculator finds the third with a² + b² = c², writing out every step and drawing the triangle.

Live demo · real result from this tool
Solve for
Resultc = 5
Area
6
Perimeter
12
Angle opposite a
36.869898°
Angle opposite b
53.130102°

Working

c² = a² + b²c² = 3² + 4² = 9 + 16 = 25c = √25 = 5

Diagram (right angle at C)

Diagram (right angle at C)

Processed on your device — nothing is uploaded.

How to use the Pythagorean calculator

  1. Under Solve for, choose Hypotenuse c, Leg a or Leg b.
  2. Fill in the two boxes that remain visible. Both must be greater than zero.
  3. Read the Result, then the Area, Perimeter and the two acute angles.
  4. Follow the Working box line by line, and use the diagram to check which side is which.

What it does and when to use it

In a right triangle the two short sides are called legs and the long side is the hypotenuse. If you know any two, the third is fixed. That is handy for the length of a ladder against a wall, the diagonal of a screen or a room, the length of a roof rafter, or the straight-line distance across a field. In homework it is the first tool for “find x” questions on right triangles.

For triangles with no right angle, use the triangle solver. The same theorem gives the distance between two points on a graph, and the trigonometry calculator helps when you know an angle instead of a second side.

How it works

The theorem says a² + b² = c². Rearranging gives the three cases the tool uses:

  • Hypotenuse: c = √(a² + b²)
  • Leg a: a = √(c² − b²)
  • Leg b: b = √(c² − a²)

Once all three sides are known, the tool finds area = a × b ÷ 2 (the legs are base and height), perimeter = a + b + c, and each acute angle from the arctangent of the two legs.

Worked examples

Hypotenuse, step by step. Legs 6 and 8.

  1. Square each leg: 6² = 36 and 8² = 64.
  2. Add the squares: 36 + 64 = 100. This is c².
  3. Take the square root: √100 = 10.

The working ends with c = √100 = 10. The tool also gives area 24 and perimeter 24.

Missing leg. Leg a = 9 and hypotenuse 15. This time you subtract: b² = 15² − 9² = 225 − 81 = 144, so b = 12. The angles are 36.869898° and 53.130102°.

An answer that is not whole. Legs 5 and 7 give c² = 74 and Result: c = 8.602325267. Most right triangles look like this. Whole-number sets such as 3-4-5 and 5-12-13 are special cases called Pythagorean triples.

Limits and tips

  • Keep all sides in the same unit. The tool has no unit menu, so the answer is in whatever unit you used.
  • Results show up to 10 significant figures. Round at the end, not in the middle, to avoid small errors.
  • A side of 0 or a blank box gives a prompt instead of a result.
  • The calculation runs on your device.

Frequently asked questions

Which side is the hypotenuse?
The longest side, opposite the right angle. In the diagram the right angle is at corner C, so the hypotenuse is side c.
Why does it say the hypotenuse must be longer than either leg?
When you solve for a leg, the tool subtracts a leg squared from the hypotenuse squared. If the "hypotenuse" is not the longest side, the result would be zero or negative, so no right triangle fits.
Does it work for triangles without a right angle?
No. The theorem only holds when one angle is exactly 90°. For any other triangle, use the triangle solver, which applies the law of cosines.
How can I check whether a corner is square?
Measure 3 units along one wall and 4 along the other. If the diagonal is 5, the corner is 90°. Any multiple works too, such as 6, 8 and 10.
What are the angles shown in the result?
The two acute angles. "Angle opposite a" faces leg a and "Angle opposite b" faces leg b. They always add up to 90°.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close