How to use the Pythagorean theorem calculator
- Enter the two sides you know. For the hypotenuse, enter both legs, a and b. For a missing leg, enter the other leg and the hypotenuse c.
- Read the missing side exactly, in simplest radical form when it isn’t a whole number, and as a decimal.
- See the two acute angles, the area, perimeter and height, a drawing to scale and each step. Use the panels below to check whether three sides make a right triangle, or to find the diagonal of a box.
The Pythagorean theorem
In a right triangle, the side opposite the right angle is the hypotenuse, c, and the other two sides are the legs, a and b. The Pythagorean theorem says that the square on the hypotenuse equals the sum of the squares on the legs:
a² + b² = c²
It is one of the most useful facts in mathematics, used for distances on maps and screens, in building and surveying, and anywhere two directions meet at a right angle. The Common Core standards for grade 8 ask students to “apply the Pythagorean Theorem to determine unknown side lengths in right triangles in real-world and mathematical problems in two and three dimensions” (standard 8.G.B.7).
Finding the hypotenuse
Square the two legs, add the squares, and take the square root: c = √(a² + b²). For legs 5 and 12: 5² + 12² = 25 + 144 = 169, and √169 = 13. The hypotenuse is always the longest side, longer than either leg but shorter than the two legs added together.
Finding a missing leg
Rearrange the formula to subtract instead: a = √(c² − b²). With a hypotenuse of 10 and a leg of 6: 10² − 6² = 100 − 36 = 64, and √64 = 8. If the leg you enter is as long as the hypotenuse or longer, there is no such triangle, and the calculator says so.
Exact answers in simplest radical form
Most right triangles don’t have three whole-number sides. Legs of 1 and 1 give a hypotenuse of √2, about 1.41421. Rather than round, the calculator keeps the square root and simplifies it, taking out the largest square factor: for legs 2 and 6, c = √(4 + 36) = √40 = √(4 × 10) = 2√10, about 6.3246. The area, 6, the perimeter, 8 + 2√10, and the height to the hypotenuse, 3√10/5, are exact too.
Pythagorean triples
A Pythagorean triple is three whole numbers that fit the theorem exactly. The best known are 3, 4, 5; 5, 12, 13; 8, 15, 17; and 7, 24, 25. Multiplying a triple by any whole number gives another: 6, 8, 10 and 9, 12, 15 are both 3, 4, 5 scaled up. A triple whose numbers have no common factor is called primitive. Every primitive triple can be made from two whole numbers m and n, with m bigger than n, as m² − n², 2mn and m² + n²: m = 2 and n = 1 give 3, 4, 5. When your sides are whole numbers, the calculator names the triple and its multiple.
Checking for a right angle: the converse
The theorem also works backwards: if three sides fit a² + b² = c², the triangle has a right angle opposite the longest side. Grade 8 standard 8.G.B.6 asks students to “explain a proof of the Pythagorean Theorem and its converse.” Builders use it to square a corner: measure 3 units along one wall and 4 along the other, and if the two marks are exactly 5 units apart, the corner is a right angle. A bigger multiple, such as 6, 8 and 10, gives a more accurate check.
If the squares of the two shorter sides add up to more than the square of the longest, every angle is acute; if they add up to less, the angle opposite the longest side is obtuse. And if the two shorter sides don’t add up to more than the longest, there is no triangle at all. The check above tells you which.
Angles, area and perimeter
The two acute angles of a right triangle add up to 90°. The angle A opposite leg a is tan⁻¹(a/b), so the 3, 4, 5 triangle has angles of about 36.87° and 53.13°. Because the legs meet at a right angle, one is the base and the other the height, so the area is ab/2: 6 for a 3, 4, 5 triangle. The height from the right angle to the hypotenuse is ab/c, 12/5 = 2.4 for the same triangle.
In three dimensions
The theorem works in 3D by using it twice. The diagonal across the floor of a box is √(l² + w²); that diagonal and the height make another right triangle, so the space diagonal from one corner to the opposite corner is √(l² + w² + h²). For a 3 by 4 by 12 box, √(9 + 16 + 144) = √169 = 13. It tells you, for example, the longest pole that fits in a box or a room.
The distance between two points
On a grid, the horizontal and vertical gaps between two points are the legs of a right triangle, and the straight-line distance is its hypotenuse: d = √((x₂ − x₁)² + (y₂ − y₁)²). Standard 8.G.B.8 asks students to “apply the Pythagorean Theorem to find the distance between two points in a coordinate system.” From (1, 2) to (4, 6), the gaps are 3 and 4, so the distance is 5.
Why it works
Put four copies of the right triangle inside a square with sides a + b, each in a corner, so their hypotenuses make a smaller tilted square with side c in the middle. The big square’s area can be counted two ways: (a + b)², or the inner square plus the four triangles, c² + 4 × ab/2. Setting them equal, a² + 2ab + b² = c² + 2ab, and taking 2ab from both sides leaves a² + b² = c².
Your data stays on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
What is the Pythagorean theorem?
In a right triangle, the square of the hypotenuse, the longest side, opposite the right angle, equals the sum of the squares of the other two sides: a² + b² = c². A triangle with legs 3 and 4 has a hypotenuse of 5, because 9 + 16 = 25.
How do I find the hypotenuse?
Square both legs, add them, and take the square root: c = √(a² + b²). For legs 5 and 12, c = √(25 + 144) = √169 = 13.
How do I find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root: a = √(c² − b²). For a hypotenuse of 10 and a leg of 6, a = √(100 − 36) = √64 = 8.
Does the Pythagorean theorem work for any triangle?
No, only for right triangles. For other triangles, the squares of the two shorter sides add up to more than the square of the longest side when every angle is acute, and to less when one angle is obtuse. Use the check on this page to test three sides.
What is a Pythagorean triple?
Three whole numbers that fit a² + b² = c², such as 3, 4, 5 or 5, 12, 13. Any multiple of a triple is one too: 6, 8, 10 is 3, 4, 5 doubled.
Is anything I type saved or sent?
No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.