Pythagorean Theorem Calculator

The Pythagorean theorem is one of the most useful relationships in geometry, and it shows up constantly in math, construction, navigation, and everyday problem-solving. Whether you need to find the length of a triangle's hypotenuse or figure out a missing leg, this calculator handles the math instantly. Just plug in the values you know, and the calculator does the rest. No formulas to memorize, no algebra to wrestle with. Clean, fast, and accurate every time.

Enter Details

Leg a

Leg b

Result

c = √(a² + b²)

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Use the Pythagorean Theorem Calculator

Using the calculator is straightforward. A right triangle has three sides: two legs (usually called a and b) and a hypotenuse (c), which is always the longest side and sits opposite the right angle.

To get your answer, enter any two known side lengths into the corresponding fields and leave the unknown side blank. The calculator will solve for the missing value automatically. Make sure all measurements are in the same unit before you start, whether that's inches, feet, meters, or anything else.

  • To find the hypotenuse, enter both legs (a and b).
  • To find a missing leg, enter the hypotenuse and the other leg.

Results are displayed instantly. You can also use the calculator in reverse as many times as you need, swapping which side you're solving for.

Find the Hypotenuse

Finding the hypotenuse is the most common use of the Pythagorean theorem. If you know the lengths of both legs of a right triangle, you can calculate the hypotenuse with a single formula.

Say leg a = 3 and leg b = 4. Square both values, add them together, and take the square root of the result. That gives you a hypotenuse of 5. Simple as that.

The calculator handles this for you automatically. Enter 3 and 4, and it spits out 5. Try it with any two leg lengths and you'll get the hypotenuse rounded to as many decimal places as you need.

Find a Missing Leg of a Right Triangle

Sometimes you already know the hypotenuse and one leg, and you need to find the other leg. This comes up a lot in real-world situations, like figuring out how far something reaches horizontally when you know the diagonal distance.

The process is just a rearranged version of the standard formula. Subtract the square of the known leg from the square of the hypotenuse, then take the square root. Enter those two values into the calculator and it handles the rearrangement for you automatically.

For example, if the hypotenuse is 10 and one leg is 6, the missing leg works out to 8. The calculator confirms this in under a second.

Hypotenuse Formula

The formula for the hypotenuse is derived directly from the Pythagorean theorem:

c = √(a² + b²)

Here, a and b are the two legs, and c is the hypotenuse. You square each leg, sum those squares, then take the square root of the total. The result is always the length of the longest side of the right triangle.

This formula only works when the triangle has a 90-degree angle. If you're not working with a right triangle, you'll need a different approach (more on that in the Law of Cosines section).

Missing Side Formula

When you need to solve for a leg instead of the hypotenuse, just rearrange the formula:

a = √(c² - b²)

Or equivalently: b = √(c² - a²)

You're subtracting the square of the known leg from the square of the hypotenuse, then taking the square root. The key thing to remember is that you always subtract when solving for a leg, not add. Getting that backwards is one of the most common mistakes people make with this theorem.

Pythagorean Theorem Formula

The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. Written as an equation:

a² + b² = c²

This formula has been around for over 2,500 years and it's still one of the cornerstones of geometry. The variables are simple: a and b represent the two shorter sides (the legs), and c represents the hypotenuse.

What makes this formula so powerful is that it works in both directions. If you know all three sides of a triangle and the equation holds true, the triangle must have a right angle. If it doesn't hold, the triangle is either acute or obtuse. That makes it a useful verification tool, not just a calculation shortcut.

Pythagorean Triples

A Pythagorean triple is a set of three positive integers that satisfy the Pythagorean theorem exactly, with no rounding or decimals. These are whole-number solutions, and they're surprisingly useful in construction, carpentry, and any situation where precision matters.

The most famous example is 3-4-5: 3² + 4² = 5², or 9 + 16 = 25. Clean, exact, no calculator needed. Builders have used this triple for centuries to check whether a corner is truly square.

Multiples of any triple also form a triple. So 6-8-10, 9-12-15, and 12-16-20 all work just as well as 3-4-5. Scaling up keeps the ratio intact.

Common Pythagorean Triples

Here are some of the most frequently used Pythagorean triples:

Leg aLeg bHypotenuse c
345
51213
81517
72425
6810
91215
202129

Memorizing even a few of these can save you time. When you recognize that your side lengths match a known triple, you can skip the calculation entirely.

How to Verify a Right Triangle

If someone hands you three side lengths and asks whether they form a right triangle, the Pythagorean theorem gives you a definitive answer. Plug the values into a² + b² = c², using the longest side as c.

If the equation balances perfectly, it's a right triangle. If the left side is less than the right side (a² + b² < c²), the triangle is obtuse. If it's greater (a² + b² > c²), it's acute.

Quick example: sides of 5, 7, and 9. Is it a right triangle? 5² + 7² = 25 + 49 = 74. But 9² = 81. Since 74 < 81, this is an obtuse triangle, not a right triangle.

Right Triangle Area and Perimeter

Once you know all three sides of a right triangle, calculating the area and perimeter is easy.

Area: The two legs of a right triangle serve as the base and height, so the formula is straightforward:

Area = (1/2) × a × b

Perimeter: Just add all three sides together:

Perimeter = a + b + c

Using the classic 3-4-5 triangle as an example: the area is (1/2) × 3 × 4 = 6 square units, and the perimeter is 3 + 4 + 5 = 12 units. If you've already used the calculator to find the missing side, you have everything you need to finish both calculations right away.

Step-by-Step Pythagorean Theorem Examples

Walking through a few examples makes the process click. Here are three common scenarios:

Example 1: Find the hypotenuse
Legs: a = 6, b = 8
c² = 6² + 8² = 36 + 64 = 100
c = √100 = 10

Example 2: Find a missing leg
Hypotenuse: c = 13, one leg: a = 5
b² = 13² - 5² = 169 - 25 = 144
b = √144 = 12

Example 3: Non-integer result
Legs: a = 5, b = 7
c² = 25 + 49 = 74
c = √74 ≈ 8.60

That third example is a good reminder that most real-world triangles don't produce neat whole numbers. The calculator handles irrational results just as easily, giving you a decimal answer to whatever precision you need.

Pythagorean Theorem vs Law of Cosines

The Pythagorean theorem is powerful, but it only works for right triangles. When you're dealing with a triangle that doesn't have a 90-degree angle, you need the Law of Cosines instead.

The Law of Cosines generalizes the Pythagorean theorem to work with any triangle:

c² = a² + b² - 2ab·cos(C)

Notice what happens when angle C is exactly 90 degrees: cos(90°) = 0, so the formula simplifies to c² = a² + b². That's just the Pythagorean theorem. In other words, the Pythagorean theorem is actually a special case of the Law of Cosines.

FeaturePythagorean TheoremLaw of Cosines
Triangle typeRight triangles onlyAny triangle
Requires angle?NoYes (one angle needed)
Formula complexitySimpleMore involved
Best forFinding sides when 90° is knownOblique triangles

Stick with the Pythagorean theorem when you've confirmed a right angle. Use the Law of Cosines when you're working with any other triangle type.

Real-World Applications of the Pythagorean Theorem

The Pythagorean theorem isn't just a classroom exercise. It comes up constantly in the real world, often in ways people don't immediately recognize.

  • Construction and carpentry: Builders use the 3-4-5 rule to square up corners on foundations, walls, and framing. Getting corners perfectly square is critical to structural integrity.
  • Navigation: Pilots and sailors calculate straight-line distances between two points using coordinate geometry, which leans heavily on the Pythagorean theorem.
  • Surveying: Land surveyors measure horizontal and vertical distances to calculate actual ground distances over uneven terrain.
  • Screen sizes: TV and monitor sizes are measured diagonally. The diagonal of a screen is the hypotenuse of a right triangle formed by the width and height.
  • Architecture: Calculating roof pitches, rafter lengths, and staircase dimensions all involve right triangles.
  • Sports: Baseball diamonds are perfect squares. The distance from home plate to second base is the diagonal of that square, calculated using the Pythagorean theorem.

Any time you're working with a distance that can be broken into horizontal and vertical components, the Pythagorean theorem is probably involved. It's one of those rare mathematical tools that genuinely earns its place in everyday life.

Other Maths Calculators

Explore all