Pythagorean Theorem Calculator

This free online Pythagorean Theorem Calculator helps you find the missing side of a right triangle. Simply enter the lengths of two sides, and the tool instantly calculates the length of the third side, useful for students, engineers, and construction workers.

S. Siddiqui

Edited by

S. SiddiquiFounder & Editor-in-Chief
Sources:WikipediaWolfram AlphaUpdated May 2026

What are you solving for?

Triangle Diagram

a = 3b = 4c = 536.9°53.1°90°

Hypotenuse

5

Side a

3

Side b

4

Hypotenuse c

5

Perimeter

12

Triangle Area

6

Angle A / B

36.9° / 53.1°

a² + b² = c²

3² + 4² = 5²

9 + 16 = 25

What Is the Pythagorean Theorem Calculator?

The Pythagorean theorem is one of the most well-known results in all of mathematics. It states that in any right-angled triangle, the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. This relationship, described as a squared plus b squared equals c squared, was known to ancient Babylonian and Egyptian mathematicians and was formally proved by the Greek mathematician Pythagoras around 570 to 495 BCE.

MathIsFun has a clear visual proof that helps build intuition for why the theorem works, and Khan Academy's Pythagorean theorem unit covers both the theory and a wide range of applications. This calculator lets you plug in any two sides of a right-angled triangle and works out the third instantly.

How to Use the Pythagorean Calculator

  1. Identify which side of the right-angled triangle you are trying to find: the hypotenuse (c) or one of the two shorter sides (a or b).
  2. Enter the two known values in the corresponding fields.
  3. The missing side is calculated straight away, along with the working so you can follow the steps.
  4. All three sides are displayed together, giving you the complete triangle for reference.
  5. If you want to go further, the Area Calculator can use these values to find the triangle's area, since the two shorter sides form the base and height of a right triangle.

Formula and Methodology

The core formula is: a² + b² = c²

Where c is the hypotenuse (always the longest side, always opposite the right angle) and a and b are the two legs. Rearranging gives three working versions:

  • To find the hypotenuse: c = square root of (a² + b²)
  • To find side a: a = square root of (c² - b²)
  • To find side b: b = square root of (c² - a²)

Worked example 1: A right triangle has legs of 3 cm and 4 cm. The hypotenuse is the square root of (9 + 16) = square root of 25 = 5 cm. This is a 3-4-5 Pythagorean triple, one of the simplest and most commonly encountered.

Worked example 2: A ladder leans against a wall. The base of the ladder is 2.5 m from the wall, and the ladder reaches 6 m up the wall. The ladder's length is the square root of (6² + 2.5²) = square root of (36 + 6.25) = square root of 42.25 = 6.5 m.

Pythagorean triples are sets of three whole numbers that satisfy the theorem. The most familiar are 3-4-5, 5-12-13, 8-15-17, and 7-24-25. These are useful in construction because they produce exact right angles without needing decimal precision.

Real-World Applications

The Pythagorean theorem turns up constantly in practical work across many fields:

  • Construction: Builders use the 3-4-5 method to check that corners are perfectly square. Measuring 3 units along one wall and 4 units along the perpendicular wall, the diagonal should measure exactly 5 units if the angle is 90 degrees. Carrying out this check with larger multiples, such as 6-8-10, gives better accuracy.
  • Navigation: When a ship or aircraft travels east by a certain distance and then north by another distance, the straight-line distance from start to finish is the hypotenuse. GPS and mapping software carry out this calculation constantly, building on the same basic geometry.
  • Architecture: Rafter lengths for pitched roofs are calculated using the theorem. Given the span and the rise of the roof, the rafter length is the hypotenuse of the resulting right triangle.
  • Screen sizes: The advertised size of a screen is its diagonal measurement, which is the hypotenuse of the rectangle formed by the width and height. Knowing this, you can figure out the actual width and height if you know the aspect ratio.
  • Sports: In football and rugby, the diagonal distance across a pitch can be worked out using the theorem. A pitch that is 100 m long and 68 m wide has a diagonal of the square root of (10000 + 4624) = the square root of 14624 = approximately 120.9 m.

Key Considerations

A few points help you apply the theorem correctly and avoid common errors:

  • The theorem only applies to right-angled triangles: This is the critical constraint. If you are not certain the triangle has a 90-degree angle, you cannot use this formula. For other triangles, the law of cosines is the appropriate tool.
  • The hypotenuse is always the longest side: If your calculation produces a result for c that is shorter than either a or b, something has gone wrong. Check your input values and make sure you have correctly identified which side is the hypotenuse.
  • Units must be consistent: All three sides must use the same unit. If you enter one side in metres and another in centimetres, the result will be numerically incorrect even though the calculator cannot detect the mismatch.
  • Square roots often produce irrational numbers: Most Pythagorean calculations do not produce a neat whole number for the hypotenuse. The square root of 50, for example, is approximately 7.071. This is mathematically exact; it is simply the nature of irrational numbers.

Conclusion

The Pythagorean Theorem Calculator is a fast and reliable way to find any side of a right-angled triangle given the other two. From checking square corners in a construction project to figuring out distances in navigation, the applications are genuinely broad. The step-by-step working shown alongside each result helps reinforce the method so you can carry it out by hand when needed. For related geometry tools, the Area Calculator lets you use the leg lengths to calculate the triangle's area, and the Right Triangle Calculator extends to angles and all trigonometric ratios.

Last reviewed: May 31, 2026
Founder's Real-World Experience
S. Siddiqui

S. Siddiqui

Founder & Editor-in-Chief, YourToolsBase

How the 3-4-5 rule saved a shelving unit from being crooked

When I was fitting a built-in shelving unit along one wall of the home office in early 2026, I needed to check whether the corner of the room was truly square. A corner that is even two or three degrees out of true will cause shelves to look visibly crooked as they extend further from the wall. I did not have a large set square, so I used the 3-4-5 method, a direct application of the Pythagorean theorem: mark 300 mm along one wall from the corner, mark 400 mm along the adjacent wall, and measure the diagonal between those two points. If the corner is perfectly square, the diagonal must come in at exactly 500 mm.

I used this calculator to confirm the expected hypotenuse before measuring, and then ran it again with my actual measurements to check how close I was. According to Maths Is Fun's explanation of Pythagoras' theorem, this is one of the oldest practical applications of the relationship between the three sides. My diagonal came out at 508 mm, meaning the corner was off by about two degrees. I shimmed the back of the unit by 6 mm and the second check came back at 501 mm, close enough.

The shelves went in level and have stayed that way. Getting that right took ten minutes with a tape measure and this calculator. Getting it wrong would have taken a full afternoon to redo.

Corner deviation: 2 degreesCorrected with 6 mm shim501 mm after correction vs 500 mm ideal

Frequently Asked Questions

What is the Pythagorean theorem in simple terms?
In any right-angled triangle, if you square the length of each of the two shorter sides and add the results together, you always get the square of the hypotenuse (the longest side). Written as a formula: a squared plus b squared equals c squared, where c is the hypotenuse.
How do I find the hypotenuse?
Square both of the shorter sides, add the results together, and then take the square root. For a triangle with legs of 5 and 12: 25 + 144 = 169, and the square root of 169 is 13. So the hypotenuse is 13.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive whole numbers where a squared plus b squared equals c squared exactly. The simplest is 3, 4, 5. Others include 5-12-13, 8-15-17, and 7-24-25. Any multiple of a Pythagorean triple, such as 6-8-10 or 9-12-15, is also a valid triple. These are particularly useful in construction because they guarantee a perfect right angle without rounding errors.
Can I use the Pythagorean theorem for any triangle?
No. The theorem applies only to right-angled triangles, those with one angle that is exactly 90 degrees. For triangles without a right angle, you need the law of cosines: c squared = a squared + b squared - 2ab x cos(C), where C is the angle opposite side c.
How do builders use the 3-4-5 rule?
To check that a corner is square, builders measure 3 units along one wall from the corner and 4 units along the adjacent wall. If the diagonal between those two points measures exactly 5 units, the angle is 90 degrees. Using larger multiples like 6-8-10 or 9-12-15 increases accuracy over longer distances.
What does the hypotenuse measure in a square?
The diagonal of a square with side length s is s times the square root of 2, approximately 1.414s. This comes directly from the theorem: the two legs are both s, so the hypotenuse is the square root of (s squared + s squared) = the square root of 2s squared = s times the square root of 2. For a square with sides of 10 cm, the diagonal is approximately 14.14 cm.

Formula

Rate This Tool

Was this tool helpful?

Be the first to rate this tool

💡 Pro Tip

The 3-4-5 right triangle is the classic example used in construction to create perfect right angles. Multiples (6-8-10, 9-12-15) work just as well.

About the Author

S. Siddiqui

S. Siddiqui

Founder & Editor-in-Chief

LinkedIn Profile

S. Siddiqui is the founder and editor-in-chief of YourToolsBase, overseeing all content, tool accuracy, and editorial standards.

View full profile

Authoritative Sources

Formulas and data in this tool are based on guidelines from the above sources.