Pythagorean Theorem Calculator

The Pythagorean theorem states that in a right triangle, a squared plus b squared equals c squared (a² + b² = c²), where c is the hypotenuse and a and b are the two legs. Select which side to solve for, enter the two known sides, and this calculator returns the missing side along with the triangle's area and perimeter.

Quick Answer

A right triangle with legs of 3 and 4 has a hypotenuse of 5, an area of 6 square units, and a perimeter of 12 units.

Common Examples

Input Result
a = 3, b = 4, solve for c c = 5, Area: 6, Perimeter: 12
a = 5, b = 12, solve for c c = 13, Area: 30, Perimeter: 30
b = 8, c = 17, solve for a a = 15, Area: 60, Perimeter: 40
a = 7, c = 25, solve for b b = 24, Area: 84, Perimeter: 56

How It Works

The Formula

The Pythagorean theorem is one of the most fundamental relationships in geometry:

a² + b² = c²

Where:

  • a and b are the lengths of the two legs (the sides that form the right angle)
  • c is the length of the hypotenuse (the side opposite the right angle, always the longest side)

This formula can be rearranged to solve for any of the three sides:

Solve for c: c = sqrt(a² + b²)

Solve for a: a = sqrt(c² - b²)

Solve for b: b = sqrt(c² - a²)

When solving for a leg, the hypotenuse (c) must be longer than the other leg. Otherwise, the expression under the square root would be negative, which has no real solution.

Triangle Area: For a right triangle, the two legs serve as base and height, so Area = (a x b) / 2.

Triangle Perimeter: The perimeter is simply the sum of all three sides: P = a + b + c.

Pythagorean Triples

Certain integer combinations satisfy the theorem exactly. The most well-known are (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any multiple of a Pythagorean triple is also a triple; for example, (6, 8, 10) = 2 x (3, 4, 5).

Worked Example

For a right triangle with legs a = 5 and b = 12: c = sqrt(5² + 12²) = sqrt(25 + 144) = sqrt(169) = 13. Area = (5 x 12) / 2 = 30 square units. Perimeter = 5 + 12 + 13 = 30 units. This is the well-known (5, 12, 13) Pythagorean triple. To find a missing leg: if b = 8 and c = 17, then a = sqrt(17² - 8²) = sqrt(289 - 64) = sqrt(225) = 15.

Related Calculators

Frequently Asked Questions

What is the Pythagorean theorem?
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides. Written as a² + b² = c², it is attributed to the ancient Greek mathematician Pythagoras, though the relationship was known to Babylonian mathematicians over a thousand years earlier.
Can the Pythagorean theorem be used on non-right triangles?
The standard formula a² + b² = c² applies only to right triangles. For non-right triangles, the Law of Cosines generalizes the relationship: c² = a² + b² - 2ab*cos(C), where C is the angle opposite side c. When C is 90 degrees, cos(C) = 0 and the formula reduces to the Pythagorean theorem.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers that satisfy the theorem exactly. Common examples include (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). Every Pythagorean triple can be generated using the formula: a = m² - n², b = 2mn, c = m² + n², where m and n are positive integers with m > n.
Where is the Pythagorean theorem used in real life?
The theorem is used in construction (ensuring walls are square, calculating diagonal measurements), navigation (finding straight-line distances), architecture, surveying, computer graphics (calculating pixel distances), and physics (vector magnitude calculations). Any situation involving right angles and distances can benefit from this formula.
What happens if c is shorter than a or b?
If the value given for the hypotenuse is shorter than one of the legs, the calculation produces a negative number under the square root, which has no real solution. This means no valid right triangle exists with those dimensions. The hypotenuse is always the longest side of a right triangle.