What this calculator does
Pythagoras’ theorem relates the three sides of a right triangle: the square of the hypotenuse equals the sum of the squares of the other two sides. It is probably the most widely used result in all of mathematics, appearing wherever a diagonal, a distance or a perpendicular is involved.
From the two legs everything else follows. The angles come from the arctangent of their ratio, the area is simply half their product since the legs are perpendicular, and the altitude onto the hypotenuse falls out of the area.
The formula
The theorem gives the hypotenuse directly. Because the legs meet at a right angle, one is already the perpendicular height onto the other, so the area needs no extra construction. The altitude to the hypotenuse follows from equating the two ways of expressing that same area.
| Term | Meaning |
|---|---|
| Legs | The two sides meeting at the right angle. |
| Hypotenuse | The longest side, opposite the right angle. |
| Altitude | The perpendicular from the right angle onto the hypotenuse. |
| Pythagorean triple | Three whole numbers satisfying a² + b² = c². |
The inputs explained
| Field | What to enter |
|---|---|
| Leg a | The length of one leg. |
| Leg b | The length of the other leg. Both must meet at a right angle. |
When to use it
Finding a diagonal
The diagonal of any rectangle is the hypotenuse of a right triangle formed by two adjacent sides. This covers screen sizes, doorway clearances and whether furniture will fit.
Squaring up a structure
The 3-4-5 method checks a corner is truly square. Any multiple works, and larger multiples give better accuracy over long runs.
Calculating a slope or ramp length
Horizontal run and vertical rise give the ramp length as the hypotenuse, and the angle tells you whether it meets accessibility requirements.
Bracing and roof members
A diagonal brace across a rectangular frame is the hypotenuse of the two sides it spans.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
Pythagorean triples and near-triples
One leg held at 3 while the other varies, including the classic 3-4-5 case.
| Second leg | Hypotenuse c | Area | Angle opposite a | Angle opposite b |
|---|---|---|---|---|
| 1 | 3.162 | 1.500 | 71.57° | 18.43° |
| 4 | 5.000 | 6.000 | 36.87° | 53.13° |
| 5 | 5.831 | 7.500 | 30.96° | 59.04° |
| 8 | 8.544 | 12.000 | 20.56° | 69.44° |
| 12 | 12.369 | 18.000 | 14.04° | 75.96° |
| 20 | 20.224 | 30.000 | 8.53° | 81.47° |
Diagonals of common rectangles
Treating the two legs as the sides of a rectangle, the hypotenuse is its diagonal.
| With a 9 unit side | Hypotenuse c | Area | Angle opposite a | Altitude to hypotenuse |
|---|---|---|---|---|
| 9 × 9 | 12.728 | 40.500 | 45.00° | 6.364 |
| 9 × 12 | 15.000 | 54.000 | 36.87° | 7.200 |
| 9 × 16 | 18.358 | 72.000 | 29.36° | 7.844 |
| 9 × 20 | 21.932 | 90.000 | 24.23° | 8.207 |
| 9 × 40 | 41.000 | 180.000 | 12.68° | 8.780 |
Questions
What is Pythagoras’ theorem?
For a right triangle, a² + b² = c², where c is the hypotenuse. It only holds when one angle is exactly 90°; for other triangles the cosine rule generalises it.
What is a Pythagorean triple?
Three whole numbers satisfying the theorem, such as 3-4-5, 5-12-13 and 8-15-17. Any multiple of a triple is also a triple, which is why 6-8-10 works too.
How do I find the angles?
Take the arctangent of the ratio of the opposite leg to the adjacent one. The two non-right angles always sum to 90°, so finding one gives the other immediately.
Why is the area just half the product of the legs?
Because the legs are perpendicular, so one is already the height relative to the other. No separate height measurement is needed.
How do I check a corner is square?
Measure 3 units along one side and 4 along the other. If the diagonal between those points is exactly 5, the corner is square. Use larger multiples for greater accuracy over long distances.
For triangles without a right angle, see triangle from three sides. For coordinates, use the distance and midpoint calculator.