Pythagorean Theorem Calculator
With leg a 3, leg b 4, pythagorean theorem comes to 5.0000 — missing side. It is reached in 9 steps, the last of which is solve_for_hypotenuse ? from_legs : from_hypotenuse, and each one is printed on the page with its numbers filled in. The formula is the one published by Wolfram MathWorld, not an approximation fitted to it.
Solves a² + b² = c² in either direction — the hypotenuse from two legs, or the missing leg from a leg and the hypotenuse — with the squares shown.
Formula and sources checked · How we check
What is missing The hypotenuse c, Leg a 3, Leg b 4
5.0000
Missing side for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.
It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.
- Missing side
5- a²
3 * 39- b²
4 * 416- c² — and a² + b² equals it
5 * 525- Area of the triangle
3 * 4 / 26- Perimeter
3 + 4 + 512- Angle opposite a
atan(3 / 4) * 180 / pi36.87 °- Angle opposite b
90 - 36.86989853.13 °- How far the hypotenuse is from a whole number
abs(5 - round(5))0
Worked example
The 3-4-5 triangle: 9 + 16 = 25, so the hypotenuse is exactly 5. It is the smallest triangle with three whole-number sides, which is why builders use it to square a corner — measure 3 along one wall, 4 along the other, and the diagonal reads 5 only if the corner is true.
How to work it out yourself
- 1.Identify the hypotenuse first: it is opposite the right angle and always the longest side. Everything else follows from putting the right number in the right place.
- 2.Square the two known sides, add or subtract, then take the square root. Adding gives the hypotenuse; subtracting the smaller square from the larger gives the missing leg.
- 3.To square a corner on site, measure 3 units along one edge and 4 along the other. If the diagonal between the marks is not 5, the corner is not 90°. Multiples work as well and measure more accurately — 6-8-10, or 12-16-20 for a room.
- 4.The theorem only holds for right triangles. With three known sides and no right angle you need the law of cosines instead.
Hypotenuse when leg a is 3
| Leg b | Missing side | How far the hypotenuse is from a whole number |
|---|---|---|
| 1 | 3.1623 | 0.16 |
| 2 | 3.6056 | 0.39 |
| 3 | 4.2426 | 0.24 |
| 4 | 5.0000 | 0 |
| 5 | 5.8310 | 0.17 |
| 6 | 6.7082 | 0.29 |
| 7 | 7.6158 | 0.38 |
| 8 | 8.5440 | 0.46 |
| 9 | 9.4868 | 0.49 |
| 10 | 10.4403 | 0.44 |
| 11 | 11.4018 | 0.4 |
| 12 | 12.3693 | 0.37 |
Only b = 4 gives a whole-number hypotenuse here. Whole-number triples are rare, which is what makes 3-4-5 worth memorising.
The formula
- Missing side
- a²
3 * 3 - b²
4 * 4 - c² — and a² + b² equals it
5 * 5 - Area of the triangle
3 * 4 / 2 - Perimeter
3 + 4 + 5 - Angle opposite a
atan(3 / 4) * 180 / pi - Angle opposite b
90 - 36.869898 - How far the hypotenuse is from a whole number
abs(5 - round(5))
Source: Wolfram MathWorld — Pythagorean theorem, Euclid, Elements, Book I, Proposition 47
Questions people actually ask
- What is the Pythagorean theorem?
- In a right triangle, the square on the hypotenuse equals the sum of the squares on the other two sides: a² + b² = c². It holds in every right triangle and in no other kind, which is why it doubles as a test for a right angle.
- How do I find a leg instead of the hypotenuse?
- Subtract instead of adding: b = √(c² − a²). Switch the mode above and the working shows the same three squares in the other order. If the leg you enter is longer than the hypotenuse there is no such triangle, and the answer comes back as zero rather than an error.
- What are the common Pythagorean triples?
- 3-4-5, 5-12-13, 8-15-17, 7-24-25 and 9-40-41, plus every multiple of each. They are the only right triangles whose three sides are all whole numbers at that size, which is why the same handful appears in every textbook and on every framing square.
- Does it work in three dimensions?
- Yes, applied twice: the diagonal of a box is √(l² + w² + h²). Measuring whether a room is square, or whether a crate fits through a door, is the same theorem run once on the floor and once up the side.
Related
- Right Triangle CalculatorHypotenuse, area, perimeter and both acute angles of a right triangle from its two legs, with the Pythagorean step shown before the square root.
- Distance Formula CalculatorDistance between two points in the plane or in space, with the midpoint and the slope, and every step of the square root shown.
- Diagonal & Rafter Length CalculatorHypotenuse of a right triangle in feet and inches — brace lengths, rafter runs, and squaring a layout.
- Triangle CalculatorEvery angle, the area, the perimeter and the height of any triangle from its three sides, using the law of cosines.
- Dot and Cross ProductDot product, cross product, magnitudes and the angle between two 3-D vectors. The dot returns a number, the cross returns a vector — that is the difficulty.
- Law of Cosines CalculatorSolves a triangle from two sides and the angle between them: the third side, the other two angles and the area, using c² = a² + b² − 2ab·cos C.
Put this calculator on your site
Free, no attribution required beyond the link.
<iframe src="https://rulecalculators.com/embed/pythagorean-theorem" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Pythagorean Theorem Calculator"></iframe>