Free Pythagorean Theorem Calculator
Solve a right triangle from any two sides using the Pythagorean theorem a² + b² = c². Enter two of the legs a, b and the hypotenuse c, and this calculator finds the missing side along with the triangle's area and perimeter.
Enter any two sides of a right triangle — leave the unknown side blank to solve it. Legs a and b are the two short sides; c is the hypotenuse.
Formula: a² + b² = c². Solve the hypotenuse with c = √(a² + b²), or a leg with a = √(c² − b²). The hypotenuse is always the longest side, so c must exceed either leg.
Quick answer
The Pythagorean theorem states that in a right triangle, a² + b² = c², where a and b are the two legs and c is the hypotenuse (the side opposite the right angle). To find the hypotenuse, compute c = √(a² + b²); to find a missing leg, compute a = √(c² − b²). For example, legs of 3 and 4 give a hypotenuse of √(9 + 16) = √25 = 5.
Formula & method
Hypotenuse
c = √(a² + b²)
- a — length of one leg (a side adjacent to the right angle)
- b — length of the other leg
- c — hypotenuse — the longest side, opposite the right angle
Use this when you know both legs. The hypotenuse is always longer than either leg.
Missing leg
a = √(c² − b²)
Use this when you know the hypotenuse c and one leg b. It only has a real solution when c > b, because the hypotenuse must be the longest side.
Area and perimeter
area = ½ · a · b · perimeter = a + b + c
The two legs are perpendicular, so they act as the base and height; area is half their product. Perimeter is the sum of all three sides.
Examples
- Input
- Leg a = 3, leg b = 4
- Result
- c = 5, area = 6, perimeter = 12
- Why
- c = √(3² + 4²) = √(9 + 16) = √25 = 5. Area = ½ · 3 · 4 = 6. Perimeter = 3 + 4 + 5 = 12. This is the classic 3-4-5 right triangle.
- Input
- Leg a = 5, leg b = 12
- Result
- c = 13, area = 30, perimeter = 30
- Why
- c = √(5² + 12²) = √(25 + 144) = √169 = 13. Area = ½ · 5 · 12 = 30. Perimeter = 5 + 12 + 13 = 30. Both legs and the hypotenuse are whole numbers, making this a Pythagorean triple.
- Input
- Hypotenuse c = 10, leg b = 6
- Result
- a = 8, area = 24, perimeter = 24
- Why
- a = √(c² − b²) = √(10² − 6²) = √(100 − 36) = √64 = 8. Area = ½ · 8 · 6 = 24. Perimeter = 8 + 6 + 10 = 24. This works because c (10) is longer than the known leg (6).
- Input
- Leg a = 1, leg b = 1
- Result
- c ≈ 1.41421
- Why
- c = √(1² + 1²) = √2 ≈ 1.41421. A right triangle with two equal legs of length 1 has a hypotenuse equal to √2 — the diagonal of a unit square.
When to use this tool
- Finding the straight-line (diagonal) distance between two points when you know the horizontal and vertical separation.
- Checking whether a corner is truly square in construction or carpentry — the 3-4-5 method confirms a right angle.
- Calculating the length of a ramp, ladder, brace, or rafter from its rise and run.
- Solving the missing side of any right triangle in geometry, trigonometry, or physics homework.
Common mistakes
- Plugging the hypotenuse into the leg formula. The hypotenuse c is always the longest side and goes alone on the right of a² + b² = c². If you treat it as a leg, you'll get a negative number under the square root.
- Forgetting to take the square root at the end. a² + b² gives c², not c — you must take √ of the sum to get the actual side length.
- Trying to solve a leg when c is not the largest side. a = √(c² − b²) only has a real answer when c > b; otherwise the triangle can't be a right triangle with c as the hypotenuse.
- Applying the theorem to a non-right triangle. a² + b² = c² holds only for triangles with a 90° angle. For other triangles, use the Law of Cosines instead.
Frequently asked questions
What is the Pythagorean theorem?
It states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse c is the side opposite the 90° angle, and a and b are the two legs that form the right angle.
How do I find the hypotenuse?
Square both legs, add them, then take the square root: c = √(a² + b²). For legs of 6 and 8, that's √(36 + 64) = √100 = 10. The hypotenuse is always the longest side of a right triangle.
How do I find a missing leg instead of the hypotenuse?
Rearrange the formula to a = √(c² − b²). Square the hypotenuse, subtract the square of the known leg, then take the square root. This only gives a real answer when the hypotenuse is longer than the known leg.
Does the Pythagorean theorem work for all triangles?
No — it applies only to right triangles, which have one 90° angle. For acute or obtuse triangles you need the Law of Cosines: c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when angle C is 90°.
What is a Pythagorean triple?
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Any whole-number multiple of a triple (like 6-8-10) is also a valid right triangle.
How do I calculate the area of a right triangle?
Because the two legs are perpendicular, they serve as the base and height, so the area is ½ · a · b. For legs of 3 and 4, the area is ½ · 3 · 4 = 6 square units. You only need the two legs — not the hypotenuse — to find the area.
Sources & references
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
- Quadratic Formula CalculatorCalculators
- Scientific CalculatorScience & Engineering
- Volume, Area & Depth CalculatorCalculators
- Force CalculatorScience & Engineering
- Kinetic Energy CalculatorScience & Engineering
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the pythagorean theorem calculator to appear: