The Pythagorean theorem is one of the most fundamental relationships in mathematics, describing the precise connection between the three sides of any right-angled triangle. Given any two sides of a right triangle, this calculator will find the third. Select which side you want to solve for, enter the two known values, and the result will be displayed with full step-by-step working.
Pythagorean Theorem Calculator
Select which side you want to find, then enter the two known sides. In a right triangle, a and b are the two legs (the sides that form the right angle), and c is the hypotenuse (the longest side, opposite the right angle).
What is the Pythagorean Theorem?
The Pythagorean theorem states that in any right-angled triangle, the square of the length of the hypotenuse is equal to the sum of the squares of the lengths of the other two sides. The hypotenuse is the side directly opposite the right angle and is always the longest side of the triangle. The two shorter sides that meet at the right angle are called the legs, commonly labeled a and b, while the hypotenuse is labeled c.
The theorem is expressed as the equation:
This means: if you square each leg and add the two results together, the total will always equal the square of the hypotenuse, for any right triangle regardless of its size or proportions.
History and Origin
Although the theorem bears the name of the ancient Greek philosopher and mathematician Pythagoras of Samos (approximately 570–495 BC), evidence of the relationship was known to mathematicians in Babylon, India, and China well before his time. Babylonian clay tablets dating to around 1800 BC demonstrate knowledge of Pythagorean triples, and the ancient Indian text the Baudhayana Sulba Sutra, written around 800 BC, contains an explicit statement of the theorem. The Pythagorean school, however, is generally credited with the first formal proof of the theorem in the Western mathematical tradition.
Over the centuries, more than 370 distinct proofs of the Pythagorean theorem have been documented. These proofs use a wide variety of techniques, including geometric dissection, algebraic manipulation, trigonometry, and even calculus. One of the most celebrated proofs was submitted by James A. Garfield in 1876, who later became the 20th President of the United States. The theorem remains one of the most proved results in all of mathematics, which is itself a testament to its fundamental importance.
Understanding the Three Sides
In a right triangle, the three sides have specific names and roles. The two legs, a and b, are the sides that form the right angle. They can be of any length relative to each other. The hypotenuse, c, is always the side opposite the 90-degree angle, and it is always the longest of the three sides. If you know any two sides of a right triangle, the theorem allows you to calculate the third.
When solving for the hypotenuse given both legs, the formula is used directly:
When solving for a missing leg given the hypotenuse and the other leg, the formula is rearranged:
b = √(c² − a²)
Pythagorean Triples
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy the theorem exactly, producing a right triangle with whole-number side lengths. The most well-known example is the 3-4-5 triangle: 3² + 4² = 9 + 16 = 25 = 5². These triples are particularly useful in construction and carpentry, where the 3-4-5 ratio is used to verify that a corner is perfectly square without the need for a protractor or angle-measuring tool.
| Leg a | Leg b | Hypotenuse c | Verification |
|---|---|---|---|
| 3 | 4 | 5 | 9 + 16 = 25 |
| 5 | 12 | 13 | 25 + 144 = 169 |
| 8 | 15 | 17 | 64 + 225 = 289 |
| 7 | 24 | 25 | 49 + 576 = 625 |
| 20 | 21 | 29 | 400 + 441 = 841 |
| 9 | 40 | 41 | 81 + 1600 = 1681 |
| 6 | 8 | 10 | 36 + 64 = 100 |
| 12 | 35 | 37 | 144 + 1225 = 1369 |
Real-World Applications
The Pythagorean theorem appears in a remarkably wide range of practical contexts. In construction and architecture, it is used to ensure walls are perfectly vertical, floors are level, and corners are exactly 90 degrees. Builders use the 3-4-5 method — measuring three units along one wall, four units along the adjacent wall, and confirming that the diagonal between those two endpoints is exactly five units — to square up a room or foundation.
In navigation, the theorem allows the calculation of the straight-line distance between two points on a flat map. If a ship travels 30 miles east and then 40 miles north, the direct distance back to its starting point is the hypotenuse of the triangle formed: √(900 + 1600) = √2500 = 50 miles.
In engineering and physics, the theorem is used to resolve forces into components, calculate resultant vectors, and determine distances in two-dimensional space. In computer graphics and game development, it is used constantly to calculate distances between points, detect collisions, and determine the length of lines on screen. In surveying and land measurement, it allows the calculation of distances that cannot be measured directly due to obstacles.
Even in everyday tasks, the theorem is quietly at work. When mounting a television on a wall and needing to run a cable diagonally across a room, calculating the cable length requires the Pythagorean theorem. When a ladder leans against a wall and you need to know how far its base must be from the wall to reach a certain height safely, the theorem provides the answer.
Important Notes
The Pythagorean theorem applies only to right-angled triangles — triangles that contain exactly one 90-degree angle. It does not apply to acute triangles (all angles less than 90 degrees) or obtuse triangles (one angle greater than 90 degrees). For those cases, the more general Law of Cosines must be used.
When solving for a leg rather than the hypotenuse, the value under the square root must be positive. This means the hypotenuse must be strictly greater than the known leg. If you enter a leg value that is equal to or greater than the hypotenuse, the triangle is geometrically impossible, and this calculator will inform you accordingly.