Pythagorean Theorem Calculator
A Pythagorean theorem calculator finds the missing side of a right triangle using a² + b² = c², such as legs 3 and 4 giving a hypotenuse of 5. This free tool also checks whether three lengths form a right triangle, measures 2D and 3D distance, lists Pythagorean triples and solves any triangle. Every result comes with a step-by-step solution, a diagram where it applies and a check of the answer, with no signup.
Calculation
Find the hypotenuse (c)
Formula
Step-by-Step Solution
Diagram
Triples found
Given
Formula
Step-by-step working
Check your answer
Final summary
What Is the Pythagorean Theorem?
The Pythagorean theorem is a fundamental equation in geometry that describes the relationship between the three sides of a right triangle. It states that the square of the hypotenuse is equal to the sum of the squares of the two shorter sides, the legs. Wolfram MathWorld's entry on the Pythagorean theorem catalogs dozens of the historical proofs of this relationship, if you want to go deeper than the summary below.
c = the hypotenuse (longest side, opposite the right angle)
Right angle = 90°, always located between sides a and b
The theorem only applies to right triangles, triangles that contain exactly one 90-degree angle. For any other triangle type (acute or obtuse), the relationship a² + b² = c² does not hold.
Key Parts of a Right Triangle
| Term | Definition |
|---|---|
| Hypotenuse (c) | The longest side of a right triangle, always opposite the right angle. This is what you solve for most often. |
| Legs (a and b) | The two shorter sides that form the right angle. Also called the adjacent and opposite sides. |
| Right angle | The 90-degree angle between the two legs. Usually marked with a small square in diagrams. |
| Pythagorean triple | A set of three positive integers that satisfy a² + b² = c². Classic example: 3, 4, 5. |
Algebraic Proof of the Pythagorean Theorem
The theorem can be proven algebraically by arranging four identical copies of the same right triangle (legs a and b, hypotenuse c) around a square. There are two ways to arrange them, and both lead to the same equation.
Arrangement 1: A Larger Square
Arrange the four triangles around the small square (side c) so they form one larger square with side length (a + b). The larger square's total area can be written two ways:
Also equals: the small square (c²) plus four triangles (each ½ab) (a + b)² = c² + 4(½ab) = c² + 2ab
Expanding the left side and cancelling the 2ab term from both sides:
a² + 2ab + b² = c² + 2ab a² + b² = c²
Arrangement 2: A Smaller Enclosed Square
Alternatively, arrange the same four triangles so they form a smaller enclosed square with side (b − a), inside a larger square with side c. Here, the larger square's area equals the small enclosed square plus the four triangles:
c² = b² − 2ab + a² + 2ab c² = a² + b²
Both arrangements cancel out to the same result, which is exactly why the theorem is considered proven rather than just observed, it holds for every right triangle, not just the specific examples above.
Pythagorean Theorem Formula and Variations
The same equation, a² + b² = c², can be rearranged to solve for whichever side is unknown. Use whichever version below matches what you already have.
Finding the Hypotenuse (c)
When both legs are known, solve for the hypotenuse using the standard form of the formula. Square both legs, add the results, then take the square root of the sum.
Finding a Missing Leg (a or b)
When the hypotenuse and one leg are known, rearrange the formula to isolate the missing side. Subtract the known leg squared from the hypotenuse squared, then take the square root. Both rearrangements follow directly from the original equation a² + b² = c² by moving terms to opposite sides. The calculator applies the correct rearrangement automatically based on which two sides you enter.
To find leg b: b = √(c² − a²)
How to Use This Pythagorean Theorem Calculator
- Pick a tab. Find c solves for the hypotenuse, Find a and Find b solve for a missing leg, and Right triangle? tests three lengths. The other tabs cover 2D distance, 3D distance, Pythagorean triples and any triangle.
- Choose a unit (cm, m, in or ft) and type the known sides. Decimals are accepted.
- Click Calculate or press Enter. The Step-by-Step Solution box opens directly under the inputs.
- Read the answer, the numbered steps and the diagram. For right-triangle tabs the diagram shows a square on each side, so you can see a² + b² = c² as areas.
- Use Check your answer to confirm the result, then Share result or Download PDF to save the working as a PDF.
- Click Reset to clear the inputs and start again.
The calculator accepts positive integers and decimals, and flags Pythagorean triples, sets of whole-number sides that satisfy a² + b² = c² exactly. If the hypotenuse you enter is not the longest side, it explains why no right triangle fits.
What the Step-by-Step Solution Shows
After you press Calculate, the answer box lists everything needed to follow the method and verify the result, not just the final number.
- The answer and key values: the missing side, plus the area, perimeter and both acute angles of the triangle.
- Given and formula: your inputs and the rule used, with your own numbers substituted in.
- Numbered steps: the formula rearranged, each side squared, the squares added or subtracted, and the square root taken, with a one-line reason for each step.
- Diagram: the triangle with a square on each side, drawn to scale, so the two small squares visibly add up to the large one.
- Check your answer: a reverse check that a² + b² equals c², or for the other tabs a matching test such as the Law of Sines.
- Share result and Download PDF: Share sends the answer and a link through your apps, and Download PDF gives a file for homework or printing.
Limits and Rounding
Answers are rounded to 4 decimal places, and a rounded answer is marked with the ≈ sign while an exact one uses an equals sign. The theorem only applies to right triangles, so use the Triangle solver tab for triangles without a right angle. For the 2D and 3D tabs, the numbers can be negative because only their squares are used. The Triples tab accepts an upper limit from 5 to 1000.
Worked Examples, Step by Step
Example 1: Find the Hypotenuse (the 3-4-5 Right Triangle)
This is the most well-known Pythagorean triple. Given legs a = 3 and b = 4, find the hypotenuse c.
- Write the known values: a = 3, b = 4. Finding: c (hypotenuse)
- Apply the formula: c² = a² + b²
- Substitute the values: c² = 3² + 4²
- Calculate each square: c² = 9 + 16
- Add the squares: c² = 25
- Take the square root: c = √25 = 5
Example 2: Find a Missing Leg (the 5-12-13 Triple)
Given hypotenuse c = 13 and one leg b = 5, find the missing leg a.
- Write the known values: c = 13, b = 5. Finding: leg a
- Rearrange the formula to isolate a: a² = c² − b²
- Substitute the values: a² = 13² − 5²
- Calculate each square: a² = 169 − 25
- Subtract: a² = 144
- Take the square root: a = √144 = 12
Example 3: Verify a Right Triangle (the 7-24-25 Triple)
Given three sides: a = 7, b = 24, c = 25. Is this a right triangle?
- Identify the longest side as the hypotenuse: c = 25
- Apply the converse: check if a² + b² = c²
- Calculate: 7² + 24² = 49 + 576 = 625
- Calculate c²: 25² = 625
- Compare: 625 = 625 ✓, the equation holds
Note: Multiples of any Pythagorean triple also form right triangles, e.g. 6-8-10 is 3-4-5 multiplied by 2.
When to Use the Pythagorean Theorem
The Pythagorean theorem applies in any situation that involves a right angle and two known side lengths. Its real-world applications extend far beyond the classroom:
- Construction and carpentry: checking whether a corner is a true 90-degree angle by measuring the diagonal. A room is square if its diagonal equals √(length² + width²).
- Navigation and mapping: finding the straight-line distance between two points on a grid. The distance formula in coordinate geometry is a direct extension of the Pythagorean theorem, and the Slope Calculator can compute it directly from two coordinate points.
- Screen and TV sizing: a 65-inch television means the diagonal is 65 inches. Knowing the aspect ratio (16:9), you can find the exact width and height using a² + b² = c².
- Engineering and design: calculating cable lengths, roof pitches, ramp inclines, and staircase dimensions all rely on right-triangle geometry.
- Physics and vectors: the magnitude of a vector in 2D space is the hypotenuse of a right triangle formed by its horizontal and vertical components.
Does the Pythagorean Theorem Work on All Triangles?
No, the Pythagorean theorem applies exclusively to right triangles. For acute and obtuse triangles, the relationship between sides follows a different rule:
| Triangle type | Relationship between sides a, b, c (c = longest side) |
|---|---|
| Right triangle | a² + b² = c² (Pythagorean theorem applies exactly) |
| Acute triangle | a² + b² > c² (sum of squares exceeds the longest side squared) |
| Obtuse triangle | a² + b² < c² (sum of squares is less than the longest side squared) |
These relationships are the basis of the converse of the Pythagorean theorem, you can use them to determine what type of triangle you have from side lengths alone, without measuring any angles.
The Converse of the Pythagorean Theorem
The converse states: if the square of the longest side of a triangle equals the sum of the squares of the other two sides, then the triangle is a right triangle. It works in both directions, you can use a² + b² = c² to find a missing side, or to verify whether a triangle contains a right angle.
→ find hypotenuse: c = √(a² + b²)
→ check if a² + b² = c²
True → right triangle ✓
False → acute or obtuse ✗
The Right triangle? tab in the calculator above applies the converse automatically. Enter all three side lengths in any order and it checks whether the equation holds, reporting the exact numerical difference and whether the triangle is acute or obtuse if it is not a right triangle.
Common Mistakes with the Pythagorean Theorem
- Applying the formula to a non-right triangle: a² + b² = c² only holds for right triangles. For any other triangle, use the Law of Cosines instead.
- Mixing up the hypotenuse with a leg: the hypotenuse is always the longest side and always opposite the right angle, substituting it into the wrong position in the formula gives an incorrect result.
- Forgetting to take the square root at the end: c² = 25 means c = 5, not c = 25. This is a common last-step error, especially when working quickly.
Frequently Asked Questions
- What is the Pythagorean theorem?
- The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². It is named after the ancient Greek mathematician Pythagoras, though evidence of the relationship was known in Babylonian and Indian mathematics long before his time.
- How do I do the Pythagorean theorem step by step?
- Identify which side is unknown. Label the two legs a and b and the hypotenuse c. To find c, calculate c = √(a² + b²). To find a missing leg, rearrange to a = √(c² − b²). Substitute your known values, compute the squares, add or subtract them, and take the square root of the result. The calculator above shows every step of this process automatically.
- Does the Pythagorean theorem work on all triangles?
- No. The theorem only applies to right triangles, triangles with exactly one 90-degree angle. For acute triangles, a² + b² > c². For obtuse triangles, a² + b² < c². If you need to work with non-right triangles, the Law of Cosines is the general rule that applies to all triangle types.
- What is a Pythagorean triple?
- A Pythagorean triple is a set of three positive integers that satisfy a² + b² = c² exactly, producing a right triangle with whole-number sides. The most common examples are 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Any integer multiple of a Pythagorean triple (e.g. 6-8-10 from 3-4-5) also forms a right triangle.
- What is the converse of the Pythagorean theorem?
- The converse states: if a² + b² = c² holds for the three sides of a triangle, then the triangle must be a right triangle. This allows you to verify whether any set of three side lengths produces a right angle, without measuring the angle directly. Use the Right triangle? tab in the calculator to check any set of lengths.
- How to find b in the Pythagorean theorem?
- Rearrange the formula to isolate b: b = √(c² − a²). You need the hypotenuse c and the other leg a. Square both known values, subtract a² from c², then take the square root of the result. For example, if c = 10 and a = 6: b = √(100 − 36) = √64 = 8.
- Is the Pythagorean theorem only for right triangles?
- Yes. The equation a² + b² = c² is only valid when the angle between legs a and b is exactly 90 degrees. The hypotenuse is always the side opposite this right angle and is always the longest side. For triangles without a right angle, use the Law of Cosines: c² = a² + b² − 2ab·cos(C).
- When was the Pythagorean theorem discovered?
- The relationship was known in ancient Babylon and India before 500 BCE, but Pythagoras of Samos (c. 570–495 BCE) is credited with the first recorded mathematical proof. The theorem bears his name due to his school's formal proof and the prominence of Greek mathematics in Western history. It remains one of the most proved theorems in mathematics, with over 370 known proofs.