Sizely
Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Pythagorean theorem calculator: solve a² + b² = c² for the hypotenuse or a missing leg of a right triangle, plus its area, with worked examples.

Alize Mendez

Written by

Alize Mendez

Updated

There was an error with your calculation.

RESULT

a = 3
area A = 6

Pythagorean theorem calculator at a glance#

What is the Pythagorean theorem?#

The Pythagorean theorem states that in a right triangle, the squares of the two shorter sides add up to the square of the longest side: a² + b² = c². Here, the two shorter sides, a and b, are known as the legs, while c is the hypotenuse, which is the side opposite the 90° angle.

How do you find the missing side of a right triangle?#

To determine the hypotenuse, you should square both legs, add them together, and then take the square root: c = √(a² + b²). If you're looking to find one of the legs, subtract the square of the other leg from the square of the hypotenuse and then take the square root: a = √(c² − b²). In the calculator above, select the side you need to find, input the other two, and it will give you the missing side and the area of the triangle.

What is 3 squared plus 4 squared?#

When you calculate 3 squared plus 4 squared, you get 25, because 3² = 9, 4² = 16, and 9 + 16 = 25. The square root of 25 is 5, which means a right triangle with legs of 3 and 4 has a hypotenuse of 5. This is referred to as the 3-4-5 triangle, the example used on this page and the default setting in the calculator.

What a² + b² = c² means#

Every right triangle has a 90° angle, two legs that form this angle, and a hypotenuse opposite it. The hypotenuse is always the longest of the three sides. The theorem is a statement about areas. If you draw a square on each side of the triangle, the two squares on the legs will together have the same area as the square on the hypotenuse. According to OpenStax Prealgebra 2e, in any right triangle, the sum of the squares of the two legs equals the square of the hypotenuse.

With legs of 3 and 4, the square on the shorter leg contains 3 × 3 = 9 unit squares, while the square on the other leg contains 4 × 4 = 16. Combined, that's 25 unit squares, precisely enough to cover a 5 by 5 square on the hypotenuse.

A right triangle with legs 3 and 4 and hypotenuse 5, with a square on each side divided into unit squares: 9 on the leg of 3, 16 on the leg of 4 and 25 on the hypotenuse, so 9 + 16 = 25 and c = √25 = 5
The squares on the legs hold 9 + 16 = 25 unit squares, the same as the square on the hypotenuse.

How to find the hypotenuse#

To determine the hypotenuse, use the formula c = √(a² + b²), where a and b are the legs of the triangle, and c is the hypotenuse.

  1. Square each leg of the triangle, giving 3² = 9 and 4² = 16.
  2. Add these squares together: 9 + 16 = 25.
  3. Take the square root to find the hypotenuse: c = √25 = 5.

Most measurements in the real world don't come out as whole numbers. For instance, with legs measuring 3 and 6, we find c² = 9 + 36 = 45, and the square root of 45 is approximately 6.708. You would round this based on your specific needs. The calculator above displays the full decimal, 6.708203932499369, so you can either round it manually or use the square root calculator to view the root directly.

How to find a missing leg#

To find a missing leg, rearrange the Pythagorean theorem as needed: a = √(c² − b²) or b = √(c² − a²). Remember to subtract, not add, because the hypotenuse is always the longest side.

  1. Square both the hypotenuse and the known leg, giving 5² = 25 and 4² = 16.
  2. Subtract these values: 25 − 16 = 9.
  3. Take the square root to find the missing leg: a = √9 = 3.

The default setup of the calculator is to find a missing leg with b = 4 and c = 5. The leg you input must be shorter than c, otherwise, it won't form a right triangle, and the calculator will show an error instead of a result. For another example, with a hypotenuse of 13 and a leg of 12, the other leg can be found as √(169 − 144) = √25 = 5.

Why the theorem works#

One classic proof uses areas. Construct a large square with sides equal to a + b, specifically 3 + 4 = 7, and place four copies of the triangle within it, one in each corner. The remaining area in the center forms a square whose sides are the hypotenuse, c.

A 7 by 7 square with four 3-4-5 triangles in the corners, each with area 6, around a tilted middle square: 49 − 24 = 25, so c² = 25 and c = 5
Four triangles of area 6 leave 49 − 24 = 25 for the square on the hypotenuse.

Calculate the area in two different ways. The total area of the large square is 7 × 7 = 49. Each triangle has an area of 3 × 4 ÷ 2 = 6, so four triangles cover 24. This leaves an area of 49 − 24 = 25 for the middle square, meaning c² = 25 and c = 5. When using variables instead of numbers, the equation (a + b)² = c² + 2ab can be expanded on the left side to a² + 2ab + b², ultimately showing a² + b² = c².

Checking whether a triangle has a right angle#

The theorem can be flipped as well. If you find that the squares of the two shorter sides equal the square of the longest side, the triangle contains a right angle. Consider sides of 6, 8, and 10: 36 + 64 equals 100, which is the same as 10². So the triangle is right. On the other hand, with sides of 5, 6, and 8, 25 + 36 equals 61, which is less than 8² = 64, so there's no right angle. If the sum falls short, the angle opposite the longest side exceeds 90 degrees.

To check this using the calculator, input the two shorter sides as a and b, then calculate c. If the result matches your third side, you've got a right triangle. For triangles lacking a right angle, the triangle calculator uses the law of cosines to solve for sides and angles.

Feet and inches, and three dimensions#

Convert mixed units into a single unit before calculating squares. For instance, with legs of 3 feet 6 inches and 4 feet 8 inches, convert to 42 inches (106.68 cm) and 56 inches (142.24 cm). Then, c equals the square root of (1,764 + 3,136), which is the square root of 4,900, or 70 inches (177.8 cm) or 5 feet 10 inches.

For calculating the diagonal of a box, you apply the theorem twice. In a box measuring 3 by 4 by 12, the floor diagonal is the square root of (9 + 16) which equals 5. This diagonal, combined with the height of 12, forms another right triangle, so the space diagonal is the square root of (25 + 144), equaling the square root of 169, which is 13. The formula for this in one step is d equals the square root of (l² + w² + h²), where l, w, and h are the length, width, and height. The calculator processes one triangle at a time, so remember to run it twice.

Where the Pythagorean theorem is used#

  • To square a corner, builders measure 3 feet along one edge and 4 feet along the other. If the diagonal between these marks measures exactly 5 feet, the corner is square. This check is equally effective for larger layouts at 6, 8, and 10.
  • For screen sizes, screens are measured diagonally. A screen 48 inches wide and 27 inches tall has a diagonal of approximately 55.07 inches (139.88 cm).
  • In calculating distance on a graph, the distance between two points is the hypotenuse of a triangle with legs Δx and Δy, which is how the slope calculator determines it.
  • For angles, enter any two of the sides in the right triangle calculator to get the two acute angles.

Common a² + b² values#

The table lists pairs of legs people often look up, along with the sum of their squares and the hypotenuse. If a row features a whole-number hypotenuse, it's a Pythagorean triple.

Common a² + b² values
Legs a and Ba² + B²Hypotenuse C
3 and 49 + 16 = 255
6 and 836 + 64 = 10010
5 and 1225 + 144 = 16913
8 and 1564 + 225 = 28917
9 and 1281 + 144 = 22515
7 and 2449 + 576 = 62525
10 and 24100 + 576 = 67626
12 and 35144 + 1,225 = 1,36937
3 and 69 + 36 = 45√45 ≈ 6.708
5 and 625 + 36 = 61√61 ≈ 7.810
4 and 716 + 49 = 65√65 ≈ 8.062
8 and 1064 + 100 = 164√164 ≈ 12.806
12 and 15144 + 225 = 369√369 ≈ 19.209

Sources#

Frequently asked questions#

Does the Pythagorean theorem work for any triangle?#

No, it only applies to right triangles. For other types of triangles, the law of cosines is used: c² = a² + b² − 2ab × cos C, where C is the angle opposite side c. If C is 90°, then cos C is 0, turning the law of cosines back into the Pythagorean theorem.

Which side is c?#

Side c is the hypotenuse, which is the longest side situated opposite the right angle. The other two sides are a and b, and you can label them a or b interchangeably.

Can the hypotenuse be shorter than a leg?#

No, because c² equals a² plus a positive amount, ensuring c is always longer than either leg. If a leg appears longer than the hypotenuse, one of the sides has been mislabeled.

What is a Pythagorean triple?#

A Pythagorean triple consists of three whole numbers that satisfy a² + b² = c² perfectly, such as 3, 4, 5 or 5, 12, 13. If you multiply a triple by any whole number, you get another triple, so 6, 8, 10 and 9, 12, 15 are triples too.

Can I use decimals or fractions?#

Yes, decimals or fractions can be used as long as all sides are in the same unit. The calculator accepts positive decimals, so enter a fraction like 1/2 as 0.5. For example, with legs of 2.5 and 6, the hypotenuse calculated will be 6.5.

What is the area of the triangle?#

The calculator also provides the area, which is half the product of the legs: 3 × 4 ÷ 2 = 6 for the 3-4-5 triangle. The legs act as the base and height since they intersect at the right angle.