My Calculator

Pythagorean Theorem Calculator

Enter any two sides of a right triangle to solve for the third, with a labeled squares diagram proving a² + b² = c², plus full step-by-step working.

Enter any two sides of a right triangle — the calculator solves for hypotenuse (c) using a² + b² = c².

Leg a3
Leg b4
Hypotenuse c5
Area6
Perimeter12

Right Triangle & the Three Squares

A square is drawn on every side — the shaded areas visually prove a² + b² = c².

a = 3b = 4c = 5b² = 16a² = 9c² = 25

9 + 16 = 25 → a² + b² = c² ✓

Square on leg aSquare on leg bSquare on hypotenuse c

Step-by-Step Solution

Here's exactly how this answer was calculated, one step at a time.

  1. 1

    Start with the Pythagorean theorem

    a² + b² = c²

    In any right triangle, the square of the hypotenuse (c) equals the sum of the squares of the two legs (a and b).

  2. 2

    Substitute the two known legs

    c² = 3² + 4² = 9 + 16 = 25

    Square each leg and add the results together to get c².

  3. 3

    Take the square root to solve for c

    c = √25 = 5

    Taking the square root of c² isolates the hypotenuse, c.

  4. 4

    Calculate the triangle's area

    Area = (1/2) × a × b = 0.5 × 3 × 4 = 6

    For a right triangle, the two legs act as base and height, so the area is half their product.

  5. 5

    Calculate the perimeter

    Perimeter = a + b + c = 3 + 4 + 5 = 12

    The perimeter is simply the sum of all three side lengths.

Final Answer: a = 3, b = 4, c = 5, Area = 6, Perimeter = 12

Free Online Pythagorean Theorem Calculator

This Pythagorean theorem calculator solves for any missing side of a right triangle — the hypotenuse or either leg — the instant you enter the other two side lengths. Beyond the missing side, it also returns the triangle's area and perimeter, and shows a complete step-by-step solution so you can see exactly how a² + b² = c² was applied to your specific numbers.

Whether you're a student solving right-triangle problems for geometry or trigonometry class, a teacher building worked examples, a carpenter checking that a corner is truly square, or an engineer confirming a diagonal brace length, this Pythagorean theorem solver handles every common right-triangle scenario in one place — no manual squaring, subtracting, or square-rooting required.

The Pythagorean Theorem Formula

The Pythagorean theorem is one of the oldest and most useful results in all of geometry. It states that in any right triangle, the square of the length of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides, called the legs:

  • a² + b² = c² — the core theorem, where a and b are the legs and c is the hypotenuse
  • Solving for the hypotenuse: c = √(a² + b²)
  • Solving for leg a: a = √(c² − b²)
  • Solving for leg b: b = √(c² − a²)
  • Area of a right triangle: Area = (1/2) × a × b, since the two legs are perpendicular and act as base and height
  • Perimeter: Perimeter = a + b + c

How to Use This Pythagorean Calculator

Using the calculator takes just three steps. First, choose what you want to solve for from the dropdown — the hypotenuse, leg a, or leg b. Second, enter the two side lengths you already know into the input fields, which relabel automatically based on your selection. Third, read the results panel and the diagram: the calculator instantly shows the missing side, the area, and the perimeter, alongside a labeled diagram of squares built on each side of the triangle.

The diagram is the most important part for actually understanding the theorem, not just calculating with it. A square is drawn on each of the three sides — a, b, and c — and each square is labeled with its own area (a², b², c²). Because the shaded area of the square on leg a plus the shaded area of the square on leg b always exactly equals the shaded area of the square on the hypotenuse, you can see the theorem proven visually with your own numbers, not just read it as an abstract formula.

Worked Example

Suppose you know the two legs of a right triangle are a = 3 and b = 4, and you want the hypotenuse. Squaring and adding gives a² + b² = 9 + 16 = 25, and taking the square root gives c = √25 = 5 — the famous 3-4-5 right triangle. The area is (1/2) × 3 × 4 = 6, and the perimeter is 3 + 4 + 5 = 12.

Now suppose instead you know the hypotenuse is c = 13 and one leg is b = 5, and you need to find leg a. Rearranging the formula gives a² = c² − b² = 169 − 25 = 144, so a = √144 = 12 — the equally well-known 5-12-13 right triangle. The calculator performs this same rearrangement automatically for whichever side you choose to solve for.

Understanding the Squares Diagram

This calculator's diagram is based on one of the oldest visual proofs of the Pythagorean theorem: instead of just drawing the triangle, a square is constructed outward on every side, using that side's length as the square's edge. The yellow square sits on leg a and has area a², the blue square sits on leg b and has area b², and the green square sits on the hypotenuse and has area c². Because the theorem guarantees a² + b² = c², the combined area of the two smaller squares always exactly fills the area of the larger square on the hypotenuse — a fact you can verify directly from the numbers printed inside each square.

A small square marker at the right angle confirms which corner of the triangle is 90°, since the entire theorem only applies to right triangles. If you ever measure a triangle and the numbers don't satisfy a² + b² = c², it simply means the triangle you measured isn't a right triangle.

Common Pythagorean Triples

A Pythagorean triple is a set of three positive whole numbers that satisfy a² + b² = c² exactly, with no decimals involved. These are handy to memorize because they show up constantly in textbook problems and real-world measurements:

  • 3, 4, 5 — the smallest and most common Pythagorean triple
  • 5, 12, 13 — frequently used in construction and roofing calculations
  • 8, 15, 17 — another exact whole-number right triangle
  • 7, 24, 25 — useful for larger structural or design problems
  • Any multiple of a triple is also a triple — for example, 6, 8, 10 (which is 3-4-5 doubled)

Where the Pythagorean Theorem Is Used

The Pythagorean theorem is one of the most widely applied formulas outside the classroom, precisely because right angles and diagonal distances show up everywhere:

  • Construction workers and carpenters use the 3-4-5 rule to check that a corner or foundation is perfectly square before building further.
  • Architects and engineers use it to calculate diagonal braces, roof rafter lengths, and structural support beams.
  • Navigation, surveying, and mapping use it to find the shortest straight-line distance between two points from their horizontal and vertical separation.
  • Electricians and installers use it to calculate the shortest cable or conduit run between two points that aren't directly aligned.
  • TV, monitor, and screen sizes are measured along the diagonal, which is calculated directly from a screen's width and height using this exact theorem.

Frequently Asked Questions

What is the Pythagorean theorem formula?

The Pythagorean theorem states that a² + b² = c², where a and b are the two legs of a right triangle and c is the hypotenuse — the longest side, opposite the right angle.

How do I find a missing leg instead of the hypotenuse?

Rearrange the formula to a² = c² − b² (or b² = c² − a²), then take the square root. This calculator does that automatically when you choose 'Leg a' or 'Leg b' from the solve-for dropdown.

Does the Pythagorean theorem work for every triangle?

No — it only applies to right triangles, meaning one angle must be exactly 90°. For non-right triangles, you need the Law of Cosines instead, which is used in our Triangle Calculator.

What is a Pythagorean triple?

A Pythagorean triple is a set of three whole numbers that exactly satisfy a² + b² = c², such as 3-4-5 or 5-12-13, with no decimal rounding involved.

How is the squares diagram related to the formula?

A square is built on each side of the triangle. The theorem guarantees that the combined area of the squares on the two legs (a² + b²) always exactly equals the area of the square on the hypotenuse (c²) — the diagram shows this visually with your own entered values.