How the calculator works
The Pythagorean theorem relates the three sides of a right triangle, which has one angle of 90°. Side a and side b are the legs that meet at that angle. The hypotenuse, c, is opposite the right angle and is the longest side.
Enter the two side lengths you know, and the solver works out the missing side. Use a and b when you need the hypotenuse, or c and one leg when you need the other leg. The result label identifies the side found, and the note underneath identifies the two values used.
The triangle diagram labels a, b and c, with the calculation shown beneath it. The result box also gives the area, perimeter, two acute angles and height to the hypotenuse. A Pythagorean triple row appears when all three side values are whole numbers within the calculator's numerical tolerance.
The Pythagorean theorem formulas
Add the squared legs to find the hypotenuse. Subtract the known leg's square from the hypotenuse's square to find the other leg. Use the positive square root for a length.
For example, if c = 13 and b = 12, the missing leg is a = √(169 − 144) = √25 = 5. The subtraction order matters: the hypotenuse's square goes first. Adding these two squares would answer a different question by treating both known sides as legs.
Worked example with the default inputs
The calculator opens with a = 3, b = 4 and cm selected. Squaring the legs gives 9 and 16. Their sum is 25, so the hypotenuse is √25 = 5 cm. The working beneath the diagram follows these same steps.
The area is 3 × 4 ÷ 2 = 6 cm², and the perimeter is 3 + 4 + 5 = 12 cm. The height to the hypotenuse is 3 × 4 ÷ 5 = 2.4 cm. These results use the completed triangle, including the side the solver found.
Understanding the other results
The legs provide a perpendicular base and height, so the area is half their product. The height-to-hypotenuse formula follows by writing that same area as ab ÷ 2 and c × h ÷ 2, then equating the two expressions. This height meets c at a right angle; it is not the length of either leg.
Evaluate arctan in degrees. Tangent is opposite divided by adjacent, and the two acute angles of a right triangle add to 90°.
Lengths, area and perimeter are displayed to at most four decimal places; angles are displayed to two. The calculator uses the underlying values for subsequent calculations, so rounding the displayed missing side does not become an extra input error in the other results.
The working can also show a simplified exact square root when the number under the root is a whole number and simplification is useful. For a = b = 4 cm, it shows √32 = 4√2 ≈ 5.6569 cm. The radical is exact, while the displayed decimal is rounded.
Pythagorean triples
A Pythagorean triple consists of three positive whole numbers that satisfy a² + b² = c². The default sides, 3, 4 and 5, form one because 9 + 16 = 25.
| Side a | Side b | Hypotenuse c | 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 |
| 9 | 40 | 41 | 81 + 1,600 = 1,681 |
Multiplying every side of a triple by the same positive whole number produces another triple. Doubling 3, 4, 5 gives 6, 8, 10. The calculator's triple row tests the unrounded side values, not just whether their displayed decimals look like integers.
Tips for entering your measurements
- 1Identify the hypotenuse first. Locate the side opposite the right angle and use c for that length. The legs can be entered in either order; swapping a and b swaps the labels of the two acute angles.
- 2Enter two known sides. Let the solver determine the third side. If you already have three measured lengths, compare the predicted missing side with your third measurement instead of assuming that the solver independently checks all three.
- 3Keep intermediate values unrounded. Enter the precision you actually measured. When a later calculation needs an irrational length, use its exact root or retain more digits than you plan to show in the final answer.
Pythagorean theorem FAQ
Does the Pythagorean theorem work for every triangle?
No. It applies to triangles with one angle exactly 90°. For a triangle without a right angle, the law of cosines relates two sides and their included angle to the third side.
Why must the hypotenuse be longer than the known leg?
When finding a leg, the calculation subtracts the known leg's square from c². Equal lengths would give a missing side of zero, and a smaller c would give a negative number under the square root. Neither produces a valid right triangle with positive side lengths.
Can I enter decimals, zero or negative lengths?
Positive decimal lengths are allowed; the inputs are not restricted to whole numbers. Zero and negative leg lengths are rejected, and the hypotenuse must be longer than either leg. A valid decimal-sided triangle does not need to produce a Pythagorean triple row.
Can I use this calculator to find a rectangle's diagonal?
Yes. A rectangle's width and length meet at a right angle, so enter them as a and b; its diagonal is c. For example, a rectangle measuring 3 cm by 4 cm has a diagonal of 5 cm.
How does the 3-4-5 method check whether a corner is square?
The converse of the theorem says that a triangle satisfying a² + b² = c² has a right angle opposite c. Marking 3 units along one side of a corner and 4 along the other gives a right angle when the distance between the marks is exactly 5 units. With physical measurements, the check is only as precise as your measurements.
Sources
- 19.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem · OpenStax, Rice University · Accessed November 2026
- 27.2 Right Triangle Trigonometry · OpenStax, Rice University · Accessed November 2026
- 3Pythagoras' Theorem · Australian Mathematical Sciences Institute · Accessed November 2026
- 4Converse of the Pythagorean Theorem · Illustrative Mathematics · Accessed November 2026