Pythagorean Theorem Calculator
The Pythagorean theorem links the three sides of a right triangle: a² + b² = c². Give it the two sides you know and it returns the missing hypotenuse or leg.
Your numbers
Result
- Side found
- Hypotenuse
- Formula used
- √(3² + 4²)
| Step | Detail |
|---|---|
| Finding | the hypotenuse |
| Formula | √(3² + 4²) |
| Result | 5 |
How the theorem works
In a right triangle — one containing a 90° angle — the square of the longest side equals the sum of the squares of the other two: a² + b² = c².
The long side, c, is the hypotenuse, and it is always the one opposite the right angle. The other two are the legs. Getting that assignment right is most of the battle; the arithmetic is trivial once the sides are labelled.
To find the hypotenuse, add the squares and take the root: c = √(a² + b²). Legs of 3 and 4 give √(9 + 16) = √25 = 5.
The word "square" is not decoration. Build an actual square on each of the three sides and the two smaller ones, in area, exactly fill the largest. That is what the theorem asserts, and it is the reason the relationship is about areas rather than lengths — which in turn is why you cannot simply add the legs.
One consequence follows immediately: the hypotenuse is always shorter than the two legs combined but longer than either one alone. Cutting a corner across a rectangular field saves distance, but never as much as intuition suggests.
Finding a missing leg
The same equation solves in the other direction. Rearranged, a leg is a = √(c² − b²).
If the hypotenuse is 5 and one leg is 3, the other is √(25 − 9) = √16 = 4. Switch the mode selector above to work this way.
The subtraction imposes a constraint that the addition does not: the hypotenuse must be the largest side. If you enter a hypotenuse shorter than a leg, c² − b² goes negative and there is no real square root — because there is no such right triangle. That is not a limitation of the calculator; those three lengths simply cannot be assembled with a right angle between them.
A useful reading of that failure: it usually means either the sides were mislabelled, or the triangle you are measuring is not actually right-angled.
The equal case, where the hypotenuse matches a leg, gives zero — a degenerate triangle collapsed onto a line.
Pythagorean triples and squaring a corner
Most right triangles have an irrational hypotenuse. Legs of 1 and 1 give √2 ≈ 1.414, a number with no exact decimal — a fact that reportedly unsettled the ancient Greeks considerably.
A few sets of three whole numbers do satisfy the equation exactly. These are Pythagorean triples, and the small ones are worth memorising: 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is another triple, so 6-8-10 and 9-12-15 work just as well.
The practical payoff comes from the converse of the theorem, which is also true: if three sides satisfy a² + b² = c², the angle between the legs must be exactly 90°.
That is the basis of the 3-4-5 method for squaring a corner. Measure 3 units along one edge and 4 along the other; if the diagonal between those marks is exactly 5, the corner is square. Builders scale it to 6-8-10 or 12-16-20 for larger layouts, because a longer baseline makes the check more sensitive. It needs no instrument beyond a tape measure, and it is how foundations, decks and tile layouts get set out.
Distance is the theorem in disguise
The straight-line distance between two points on a plane is Pythagoras with different labels. Take the horizontal difference and the vertical difference as the two legs: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. The distance formula is not a separate result — it is this theorem applied to a right triangle you have not drawn.
It extends cleanly into three dimensions. The diagonal of a rectangular box with edges x, y and z is √(x² + y² + z²), which is what tells you whether a long object fits inside a given crate.
Screen sizes are the same calculation run backwards. A display is sold by its diagonal, but its usable width and height depend on the aspect ratio. For a 16:9 panel, the diagonal spans √(16² + 9²) ≈ 18.36 ratio-units, so a 55-inch television is about 47.9 inches wide and 27.0 inches tall. That is why a 55-inch 16:9 screen and a 55-inch screen in any other shape are not the same amount of picture.
The theorem also underpins the shortest rafter, the length of a diagonal brace, the ladder-against-a-wall problem, and the reach of a guy wire — anywhere a slope has to be derived from a run and a rise.
What the theorem does not cover
The Pythagorean theorem applies to right triangles only. Feed it a triangle without a 90° angle and it returns a number that means nothing.
For any other triangle, the generalisation is the law of cosines: c² = a² + b² − 2ab × cos(C), where C is the angle opposite side c. Set C to 90°, note that its cosine is zero, and the correction term vanishes — Pythagoras is the special case. When C is smaller than 90° the correction is subtracted, and when it is larger it is added, which is exactly why comparing c² with a² + b² classifies a triangle as acute, right or obtuse.
There is a deeper limit too. The theorem holds in flat, Euclidean geometry. On the curved surface of a sphere it fails: a triangle drawn on the Earth with vertices at the North Pole and two points on the equator a quarter-turn apart has three right angles, which no flat triangle can. This is not academic — long-haul navigation and geodesy use spherical formulas for exactly this reason. Over the distances involved in a room, a roof or a building site, the flat version is accurate far beyond anything you could measure.
Frequently asked questions
Sources
Embed this calculator
Copy the code and paste it into your site or blog. Credit with a link back to Contania is included, and the height adjusts itself.
<iframe src="https://contania.app/embed/math/pythagorean-theorem" title="Pythagorean Theorem Calculator (a² + b² = c²)" width="100%" height="720" loading="lazy" style="border:1px solid #e5e0d8;border-radius:12px;max-width:640px"></iframe>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.type==="contania:embed-height"){var f=document.querySelector('iframe[src="https://contania.app/embed/math/pythagorean-theorem"]');if(f){f.style.height=e.data.height+"px"}}});</script>Related calculators
Area
Calculate the area of a rectangle, square, triangle, circle or trapezoid. Pick the shape and enter its measurements to get the area and the formula used.
CalculateSquare Root
Find the square root of any number, plus the cube root and the square. See whether the number is a perfect square.
CalculateVolume
Calculate the volume of a cube, box, sphere, cylinder, cone or pyramid. Pick the solid and enter its measurements to get the volume and the formula used.
CalculateQuadratic Equation
Solve quadratic equations ax² + bx + c = 0 with the quadratic formula. Enter the coefficients to see the discriminant and the roots.
Calculate