Pythagorean Theorem Calculator
Find the hypotenuse or a missing leg with a² + b² = c², see the exact radical form and steps, or check whether three sides make a right triangle.
What is a pythagorean theorem calculator?
The Pythagorean theorem says that in a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². The legs a and b are the two sides that form the right angle, and the hypotenuse c is the side opposite it, which is always the longest side.
This Pythagorean theorem calculator solves for whichever side you leave blank. Enter two legs to find the hypotenuse, or the hypotenuse and one leg to find the other leg. It returns the Missing side as a decimal, the Exact form as a simplified square root (such as c = 8√2) or an exact decimal (such as c = 2.5) when there is one, the Perimeter, the Area, the two acute angles (Angle A and Angle B) and a Step-by-step line that shows the arithmetic.
If you fill in all three sides, it works the other way and checks the triangle instead. It treats the longest side as c, whichever box you type it in, and compares a² + b² with c²: equal means a right triangle, larger means an acute triangle and smaller means an obtuse one. That is the converse of the theorem. If the two shorter sides add up to no more than the longest, it reports that the lengths cannot form a triangle at all.
The theorem and its converse are part of the Common Core Grade 8 geometry standards, which ask students to explain a proof of both (8.G.B.6), to find unknown side lengths in right triangles (8.G.B.7) and to find the distance between two points in a coordinate system (8.G.B.8). Use the calculator to check homework, but work a few problems by hand as well.
Formula
Rearranging a² + b² = c² gives one formula for each side:
- Hypotenuse: c = √(a² + b²)
- Leg a: a = √(c² − b²)
- Leg b: b = √(c² − a²)
To find a leg, the hypotenuse must be longer than the leg you entered. If it is not, there is no right triangle with those sides, and the step line says "c must be greater than each leg".
Once all three sides are known, the calculator also finds:
- Angle A (opposite a) = arctan(a ÷ b), and Angle B (opposite b) = arctan(b ÷ a). Together they always add up to 90°.
- Area = ½ × a × b, because the two legs are a base and its height.
- Perimeter = a + b + c.
Exact form
When the number under the square root is a whole number, the calculator takes out every square factor: √128 = √(64 × 2) = 8√2, and √56 = √(4 × 14) = 2√14. If the number is a perfect square, the exact form is a whole number, such as c = 5. If the squares add up to a decimal, the exact form appears only when the root comes out as a short exact decimal: legs of 1.5 and 2 give 6.25, so the exact form is c = 2.5. Legs of 1.5 and 2.5 give 8.5, whose square root never ends, so the exact form shows a dash.
Checking three sides: the converse
With all three sides entered, the calculator compares a² + b² with c²:
| Comparison | Result | What it means |
|---|---|---|
| a² + b² = c² | Right triangle | The angle opposite c is 90° |
| a² + b² > c² | Acute triangle (not right) | Every angle is less than 90° |
| a² + b² < c² | Obtuse triangle (not right) | The largest angle is more than 90° |
The test only makes sense when c is the longest side, so the calculator sorts the three lengths first and uses the longest as c, whichever box it is in. It also checks that the lengths can form a triangle, which needs the two shorter sides to add up to more than the longest. For 1, 2 and 10, 1 + 2 = 3 is not more than 10, so the result is Not a triangle.
When all three sides are whole numbers, the check is exact: 1, 1000 and 1000 gives 1,000,001 against 1,000,000, so the result is Acute triangle (not right). When any side is a decimal, equality is tested to within one part in a million, so a hypotenuse rounded to six decimal places still counts: 1, 1 and 1.414214 (√2 rounded) gives 2 against 2.000001, and the step line says "equal to within one part in a million".
Worked example
Example 1: the hypotenuse from two legs
A right triangle has legs a = 5 and b = 7. Leave c blank.
- Square and add the legs: 5² + 7² = 25 + 49 = 74.
- Take the square root: c = √74 ≈ 8.602325. 74 = 2 × 37 has no square factor, so the Exact form is c = √74.
- Perimeter = 5 + 7 + 8.602325 = 20.602325. Area = ½ × 5 × 7 = 17.5.
- Angle A = arctan(5 ÷ 7) ≈ 35.5377° and Angle B ≈ 54.4623°, which add up to 90°.
The step line reads c² = a² + b² = 5² + 7² = 25 + 49 = 74 → c = √74 = 8.602325.
Example 2: a missing leg (how high does a ladder reach?)
A 12-foot ladder stands with its foot 3 feet from a wall. The ladder is the hypotenuse (c = 12), the distance along the ground is one leg (b = 3), and the height it reaches on the wall is the missing leg a.
- a² = c² − b² = 12² − 3² = 144 − 9 = 135.
- a = √135 ≈ 11.61895 feet. Because 135 = 9 × 15, the exact form is a = 3√15.
- Angle A, opposite the wall side, is the angle between the ladder and the ground: about 75.5225°. Angle B, between the ladder and the wall, is about 14.4775°.
A common mistake here is adding the squares: √(144 + 9) ≈ 12.37 would be longer than the ladder itself.
Example 3: is it a right triangle?
Fill in all three boxes in any order; the calculator uses the longest side as c.
- 20, 21, 29: 20² + 21² = 400 + 441 = 841 and 29² = 841. The result is Right triangle, and the step line ends "equal, so the angle opposite 29 is 90°". The calculator then also gives the area, 210, and the angles, about 43.6028° and 46.3972°.
- 6, 8, 9: 6² + 8² = 100, but 9² = 81. Because 100 > 81, the result is Acute triangle (not right), and the step line ends "so every angle is less than 90°".
- 3, 4, 6: 3² + 4² = 25, but 6² = 36. Because 25 < 36, the result is Obtuse triangle (not right), and the step line ends "so the largest angle is more than 90°".
- 13, 5, 12: typed in that order, the calculator still takes 13 as the hypotenuse: 5² + 12² = 169 = 13², a Right triangle.
For a triangle that is not right, the calculator shows only the perimeter; the area and angle formulas above apply to right triangles only.
How to use this calculator
- Decide which sides you know. The hypotenuse is the side across from the right angle; the other two are the legs.
- Enter the two known sides and leave the unknown box empty. The calculator needs exactly two sides to solve, or all three to check.
- Use the same unit for every side (all inches or all meters). The answer is in that unit, and the area is in square units.
- Read the Missing side, shown to six decimal places, and the Exact form if your answer must be in radical form.
- Compare the Step-by-step line with your own working.
- To check a triangle, enter all three sides in any order, and read the result together with the step line.
Common mistakes
- Entering the hypotenuse as a leg when solving. To find a missing side, c must be the hypotenuse. Entering a = 13 and c = 5 gives "The hypotenuse must be the longest side".
- Adding instead of subtracting for a leg. A leg is always shorter than the hypotenuse.
- Rounding too far in a check. With a decimal side, the test allows a difference of one part in a million, so 1, 1 and 1.414214 counts as a right triangle, but 1, 1 and 1.4142 gives 1.4142² = 1.999962 and the result Acute triangle (not right). Keep six decimal places, or use exact lengths.
- Mixing units, such as feet for one leg and inches for the other.
What the tool does not do
- For a triangle that is not right, it gives only the type and the perimeter, not the area or the angles. The law of cosines (see the FAQs) finds those.
- It solves right triangles from sides only. It does not take an angle as input.
- Side lengths must be greater than 0.
Related reading: three proofs of a² + b² = c², Pythagorean triples and simplified radicals. To simplify any square root, use the square root calculator; for the distance between two points, use the distance formula calculator.
Sources
- Common Core State Standards Initiative — Grade 8: Geometry (8.G.B.6, 8.G.B.7, 8.G.B.8)
Frequently asked questions
Which side is the hypotenuse?
The hypotenuse is the side opposite the right angle, and it is always the longest side of a right triangle. The two sides that meet at the right angle are the legs. Which leg you call a and which you call b does not matter for the missing side, but it does decide which angle is Angle A: Angle A is always the angle opposite side a.
Does the Pythagorean theorem work for triangles that are not right triangles?
Not as a² + b² = c². For any triangle, the law of cosines, c² = a² + b² − 2ab·cos C, relates the sides to the angle C opposite c. When C is 90°, cos C = 0 and it reduces to the Pythagorean theorem. This calculator does not use the law of cosines, but with all three sides entered it tells you whether the largest angle is right, acute or obtuse.
What is a Pythagorean triple?
Three whole numbers that fit a² + b² = c², such as 3, 4, 5; 5, 12, 13; 8, 15, 17; 7, 24, 25; and 20, 21, 29. Any multiple of a triple is also a triple: 6, 8, 10 and 9, 12, 15 come from 3, 4, 5. When the two sides you enter belong to a triple, the Exact form is a whole number, for example c = 25 for legs 7 and 24.
Why does the exact form show a dash?
The exact form appears when the number under the square root is a whole number (c = √74, a = 3√15) or when the root is a short exact decimal (legs 1.5 and 2 give c = 2.5). Otherwise it is a dash: legs 1.5 and 2.5 give 8.5 under the root, and √8.5 never ends. For a radical answer, scale the sides to whole numbers first (1.5 and 2.5 become 3 and 5, giving c = √34), then divide by the same factor: c = √34 ÷ 2. The exact form is also a dash when you check three sides.
My triangle should be a right triangle. Why does the calculator say it is not?
Usually because a side is rounded too far. A right triangle with legs 1 and 1 has a hypotenuse of √2, an irrational number. With a decimal side, the check allows a difference of one part in a million (whole-number sides are compared exactly), so 1.414214 (six decimal places) still gives Right triangle, but 1.4142 gives c² = 1.999962 against 2, and the result is Acute triangle (not right). Measured lengths are never exact either. If a² + b² and c² differ by much less than your measuring error, treat the corner as square for practical purposes.
Can I use it for a three-dimensional problem, like the diagonal of a box?
Yes, by using it twice. For a box 3 by 4 by 12, first find the diagonal of the 3-by-4 base: legs 3 and 4 give 5. Then use that diagonal and the height as legs: 5 and 12 give 13, the diagonal through the box. This is the same as √(3² + 4² + 12²) = 13.
How is this related to the distance formula?
They are the same idea. The distance between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical differences, so d = √(Δx² + Δy²). The distance formula calculator works directly from coordinates and gives the exact form too.