The Pythagorean theorem
A right triangle has one angle of exactly 90°. The two sides that form that angle are the legs, usually called a and b. The side opposite the right angle is the hypotenuse, c. It is always the longest side.
The Pythagorean theorem links the three sides:
In words: the square on the hypotenuse has the same area as the squares on the two legs put together. Rearranged, it gives a formula for whichever side is missing:
Leg: a = √(c² − b²) or b = √(c² − a²)
When you find the hypotenuse you add the squares. When you find a leg you subtract. Mixing those up is the most common mistake.
How to use the calculator
- Pick Find c for the hypotenuse, or Find a or Find b for a leg.
- Enter the two sides you know. Decimals are fine.
- Read the answer. If it is not a whole number, you also get the exact surd (such as 5√2) when it simplifies neatly.
- The angles, area, perimeter and the height to the hypotenuse are worked out too, with every step shown.
The fourth option, Is it a right triangle?, takes three sides in any order and tells you whether they meet at a right angle.
Worked examples
Example 1: the hypotenuse
A right triangle has legs of 6 and 8.
- c² = 6² + 8² = 36 + 64 = 100
- c = √100 = 10
The angles are α = arctan(6 ÷ 8) ≈ 36.87° and β = 90° − 36.87° ≈ 53.13°. The area is 6 × 8 ÷ 2 = 24.
Example 2: a ladder against a wall
A 10 ft ladder leans against a wall with its foot 6 ft from the wall. How high does it reach? The ladder is the hypotenuse, so subtract:
- a² = 10² − 6² = 100 − 36 = 64
- a = √64 = 8 ft
Example 3: an answer that is not a whole number
Legs of 5 and 5 give c² = 25 + 25 = 50, so c = √50. Since 50 = 25 × 2 and √25 = 5, the exact answer is 5√2, which is about 7.0711. A triangle with two equal legs is a 45-45-90 triangle, and its hypotenuse is always the leg × √2.
Example 4: a TV screen
TV sizes are the diagonal. A 55-inch screen with a 16:9 shape has a height-to-width ratio of 9 to 16. The diagonal of a 16 × 9 rectangle is √(256 + 81) = √337 ≈ 18.358. Scale it up to 55 inches by multiplying both sides by 55 ÷ 18.358:
- Width ≈ 16 × 2.996 ≈ 47.94 in
- Height ≈ 9 × 2.996 ≈ 26.96 in
Example 5: decimals
Legs of 2.5 m and 6 m: c² = 6.25 + 36 = 42.25, so c = √42.25 = 6.5 m. Decimals work exactly the same way.
Is it a right triangle? (the converse)
The theorem also works backwards. If the two shorter sides squared add up to the longest side squared, the triangle has a right angle. If not, the sum tells you what kind of triangle it is:
| Compare x² + y² with z² (z = longest side) | Triangle |
|---|---|
| x² + y² = z² | Right (one angle is exactly 90°) |
| x² + y² > z² | Acute (all angles under 90°) |
| x² + y² < z² | Obtuse (one angle over 90°) |
For example, 7, 24, 25: 49 + 576 = 625 = 25², so it is a right triangle. But 4, 5, 6: 16 + 25 = 41, which is more than 36, so it is acute. Three lengths only make a triangle at all if the two shorter ones add up to more than the longest.
The calculator compares typed decimals exactly, not with rounded floating-point numbers, so 0.3, 0.4, 0.5 is correctly reported as a right triangle.
Pythagorean triples
A Pythagorean triple is three whole numbers that fit a² + b² = c². A primitive triple has no common factor. Here are all 16 primitive triples with a hypotenuse up to 100:
| c up to 29 | c from 30 to 53 | c from 54 to 73 | c from 74 to 100 |
|---|---|---|---|
| 3, 4, 5 | 12, 35, 37 | 11, 60, 61 | 13, 84, 85 |
| 5, 12, 13 | 9, 40, 41 | 16, 63, 65 | 36, 77, 85 |
| 8, 15, 17 | 28, 45, 53 | 33, 56, 65 | 39, 80, 89 |
| 7, 24, 25 | 48, 55, 73 | 65, 72, 97 | |
| 20, 21, 29 |
Multiply any of them by a whole number to get more: 3-4-5 gives 6-8-10, 9-12-15, 12-16-20 and so on. You can make primitive triples with Euclid’s formula: pick whole numbers m > n, one odd and one even, with no common factor. Then a = m² − n², b = 2mn and c = m² + n². With m = 2 and n = 1 you get 3, 4, 5; with m = 3 and n = 2 you get 5, 12, 13.
Special right triangles
Two right triangles come up so often that their side ratios are worth remembering:
| Triangle | Angles | Sides (short leg : long leg : hypotenuse) |
|---|---|---|
| Isosceles right | 45°, 45°, 90° | 1 : 1 : √2 |
| Half an equilateral | 30°, 60°, 90° | 1 : √3 : 2 |
Try them: legs 1 and 1 give √2 ≈ 1.4142. A leg of 1 and a hypotenuse of 2 give the other leg √3 ≈ 1.7321, with angles of 30° and 60°.
Simplifying the square root
To turn √n into a surd like k√m, find the largest perfect square that divides n:
- √50 = √(25 × 2) = 5√2
- √72 = √(36 × 2) = 6√2
- √48 = √(16 × 3) = 4√3
- √51 = √(3 × 17) cannot be simplified, so it stays √51
The calculator does this for you and shows the exact form next to the decimal whenever the numbers stay readable.
Where you will use it
- Squaring a corner. Builders mark 3 units along one edge and 4 along the other. If the diagonal between the marks is exactly 5, the corner is square. Larger multiples such as 6-8-10 or 9-12-15 give better accuracy on big layouts.
- Distance between two points. On a graph, the distance from (x₁, y₁) to (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (7, 10) it is √(36 + 64) = 10.
- Diagonals. Screen sizes, the diagonal of a room or a sheet of plywood, and the brace across a gate.
- Slopes and roofs. The length of a ramp or rafter is the hypotenuse of its rise and run.
- 3D boxes. The space diagonal of a box is √(l² + w² + h²). A 3 × 4 × 12 box has a diagonal of √(9 + 16 + 144) = √169 = 13.
Common mistakes
- Using the wrong side as c. The hypotenuse is always opposite the right angle and always the longest side. If your “leg” comes out longer than c, you have swapped them.
- Adding instead of subtracting. For a missing leg, subtract: a² = c² − b².
- Taking the square root too early. √(3² + 4²) is 5, but √3² + √4² is not; square, add, then take the root.
- Using it on a triangle without a right angle. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos C.
- Mixing units. Convert all sides to the same unit first. The area comes out in square units.
A little history
The theorem is named after the Greek mathematician Pythagoras (6th century BC), but the relationship was known much earlier. A Babylonian clay tablet known as Plimpton 322, from about 1800 BC, lists numbers that correspond to Pythagorean triples. Euclid’s Elements gives a proof as Book I, Proposition 47, and hundreds of different proofs have been published since.
Related tools
For the area of any triangle, including one with three known sides, use the area calculator. The slope calculator finds the slope, angle and distance between two points, and the roofing calculator uses the same idea to turn a roof pitch into rafter lengths. For square roots and trig functions on their own, open the scientific calculator. Everything is calculated in your browser.