Free online formula calculators

Pythagorean Theorem Calculator

Find the missing side of a right triangle from the other two: solve for the hypotenuse c, or for leg a or b.

Pythagorean Theorem Calculator
Result
Missing side5
Workingc = √(3² + 4²) = √25
Area6
Perimeter12

Link to this calculation

Formula

a2 + b2 = c2
c = √(a2 + b2)   a = √(c2 − b2)
SymbolMeaning
a, bThe two legs (the sides that form the right angle)
cThe hypotenuse (the longest side, opposite the right angle)

How to Use This Calculator

  1. Choose the Solve for (Hypotenuse c, Leg a, Leg b).
  2. Enter the Leg a.
  3. Enter the Leg b.
  4. Enter the Hypotenuse c when Solve for is Leg a or Leg b.
  5. Press Calculate. Results also update automatically as you type.

Worked Example

Using the values pre-filled in the calculator above:

Inputs
Solve forHypotenuse c
Leg a3
Leg b4
Results
Missing side5
Workingc = √(3² + 4²) = √25
Area6
Perimeter12

About This Calculation

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. Although named after the Greek mathematician Pythagoras, the relationship was known to Babylonian and Indian mathematicians centuries earlier. It only applies to right triangles; for other triangles the law of cosines generalizes it.

Whole-number solutions are called Pythagorean triples. The best known is 3-4-5, and any multiple of it (6-8-10, 9-12-15) also works, as do 5-12-13 and 8-15-17. Builders use the 3-4-5 rule to check that a corner is square: measure 3 units along one wall and 4 along the other, and the diagonal should be exactly 5. When solving for a leg, the hypotenuse must be the longest side — if your numbers say otherwise, a measurement has been swapped or misread.

The theorem underpins the distance formula, so it is used whenever a straight-line distance is computed from horizontal and vertical offsets: screen sizes from width and height, ladder lengths against a wall, roof rafters, cable runs and navigation. For angles as well as sides, try the right triangle calculator.

Frequently Asked Questions

Does the Pythagorean theorem work for all triangles?
No, only for right triangles. For any other triangle use the law of cosines: c² = a² + b² − 2ab·cos(C), which reduces to Pythagoras when C = 90°.
How can I tell if a triangle is a right triangle?
Check whether the squares of the two shorter sides add up to the square of the longest. For 5, 12 and 13: 25 + 144 = 169 = 13², so it is a right triangle.
Why is the answer an irrational number?
Most square roots of whole numbers are irrational. With legs of 1 and 1, the hypotenuse is √2 ≈ 1.41421, which cannot be written exactly as a decimal or fraction.

Category: Math & Algebra. Found a problem with this calculator? Let us know.