The Pythagorean theorem links the three sides of every right triangle: the square of the hypotenuse — the side opposite the right angle — equals the sum of the squares of the two legs. This calculator puts that rule to work in three ways.
- Hypotenuse c: enter the two legs and get the longest side.
- A leg: enter one leg and the hypotenuse and get the missing side.
- Is it right?: enter any three lengths and find out whether they form a right triangle, using the converse of the theorem.
Besides the decimal answer, you get the exact value whenever your lengths are whole numbers (or have one decimal): is simplified to , which is what a maths teacher expects to see. The calculator also tells you whether the three sides form a Pythagorean triple such as 3-4-5 or 5-12-13, and gives the area and perimeter of the triangle.
Every length has a unit switcher (mm, cm, m, km, inches, feet, yards, miles), so you can use it for homework, a ladder against a wall, the diagonal of a screen or the squareness of a building plot. For angles, heights and the full solution of a right triangle, see the right triangle calculator.
How to use this calculator
- Choose what you want to find: the hypotenuse, a leg, or whether a triangle is right-angled.
- Enter the known lengths. You may switch units per field; the calculator converts everything before squaring.
- Read the result, its exact radical form and the triple check. Open the steps to see each square written out.
- In "Is it right?" mode the longest of the three lengths is automatically treated as the candidate hypotenuse, so the order you type them in does not matter.
The formula
For a right triangle with legs and and hypotenuse :
This is Proposition 47 of Book I of Euclid’s Elements. Its converse (Proposition 48) is just as useful: if three lengths satisfy , the angle opposite is exactly 90°. If that angle is acute, and if it is obtuse.
To simplify a square root, factor out the largest perfect square: . Internally the missing leg is computed as , which is mathematically identical but avoids rounding loss when is close to .
Worked example
Hypotenuse. Legs of 7 cm and 24 cm: cm. Since 7, 24 and 25 are whole numbers, they form a primitive Pythagorean triple.
Exact form. Legs of 5 and 5: .
A leg. A 5 m ladder stands with its foot 1.4 m from a wall. How high does it reach? m.
Converse. Sides 6, 8 and 10: , so the triangle is right-angled. Sides 5, 6 and 8: , so it is obtuse.
Pythagorean triples
A Pythagorean triple is a set of three whole numbers that satisfy . A triple is primitive when the three numbers share no common factor; multiplying a primitive triple by any whole number gives another triple (6-8-10 is twice 3-4-5).
| Primitive triple | Check |
|---|---|
| 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 |
Every primitive triple can be generated from two coprime integers of opposite parity: , , (Euclid’s formula).
Where the hypotenuse shows up in practice
Builders use the 3-4-5 rule to set out a square corner: mark 3 units along one wall and 4 along the other; if the diagonal measures exactly 5, the corner is 90°. The same idea gives the diagonal of a screen or a room, the length of a roof rafter (see the rafter length calculator) and the straight-line distance between two points on a grid.
Frequently asked questions
What is the hypotenuse?
It is the side opposite the right angle and always the longest side of a right triangle. In the formula a² + b² = c², the hypotenuse is c.
Does the Pythagorean theorem work for any triangle?
No, only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos C, which reduces to Pythagoras when C = 90°.
How do I find a leg instead of the hypotenuse?
Subtract instead of adding: b = √(c² − a²). Choose "A leg" in the calculator. The hypotenuse must be longer than the known leg, otherwise no right triangle exists.
How can I tell if three lengths make a right triangle?
Square the longest side and compare it with the sum of the squares of the other two. Equal means a right angle; smaller means acute; larger means obtuse. The "Is it right?" mode does this for you.
Why does the calculator show 5√2 instead of 7.07?
Because 5√2 is the exact value and 7.07 is only a rounding of it. Both are shown: the exact form is what exams usually require, the decimal is what you measure with.
Sources
- Euclid, Elements, Book I, Proposition 47 (D. E. Joyce, Clark University)
- Euclid, Elements, Book I, Proposition 48 — the converse (D. E. Joyce, Clark University)
- OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem
Last updated: