Side c. These are whole numbers, so they form a Pythagorean triple — the primitive is 3, 4, 5.
Leg a
3
given
Leg b
4
given
Hypotenuse c
5
solved for
Area
6
half the product of the legs
Angle at a
36.8699°
opposite leg a
Angle at b
53.1301°
and they add to 90°
Drawn to scale from your numbers. The small square marks the right angle — the theorem holds only when it is there, and the cosine rule is what generalises it to every other triangle.
a² + b² = c²: 9.0000000 + 16.000000 = 25.000000. That identity is the whole theorem, and substituting back is the check worth doing.
The theorem works ONLY on a right triangle. For any other, the cosine rule generalises it: c² = a² + b² − 2ab·cos C, and the −2ab·cos C term vanishes exactly when C is 90°.
These are whole numbers, so they form a Pythagorean triple — 3, 4, 5, which reduces to the primitive 3, 4, 5. Every multiple of a primitive triple is another triple.
The converse holds too: if a² + b² = c² then the triangle IS right-angled. That is what makes the 3-4-5 rule useful for squaring a corner on site.
The hypotenuse is checked against the legs before solving, so a swapped input gets a reason rather than a NaN.
What this tool shows
a² + b² = c². Legs of 3 and 4 give a hypotenuse of 5 — and those three are a Pythagorean triple, one of the rare cases where all three sides are whole numbers. Most are not, and the page says which yours is.
Any side of a right triangle from the other two
The identity a² + b² = c², evaluated
Whether the three form a Pythagorean triple
The primitive triple it reduces to
Area, perimeter and both acute angles
What to do when the triangle is not right-angled
Any of the three The identity checked Triples detected Drawn to scale
Only valid on a right triangle; the page checks the inputs.
Updated 7 September 2026 · Works in any browser, no installation
Square the two you know, then add or subtract, then take the square root. For the hypotenuse: c = √(a² + b²), so 3 and 4 give √25 = 5. For a leg: a = √(c² − b²). The hypotenuse is always the longest side, and always opposite the right angle.
At a glance
Formula shown
a\u00b2 + b\u00b2 = c\u00b2, where c is the hypotenuse. So c = \u221a(a\u00b2 + b\u00b2), and a leg is a = \u221a(c\u00b2 \u2212 b\u00b2). The converse also holds: if a\u00b2 + b\u00b2 = c\u00b2 then the triangle has a right angle opposite c.
Scenario support
Finding a diagonal; squaring a corner on site with the 3-4-5 rule; any distance between two points on a grid.
Educational estimate
Planning support from the values you enter — not professional advice.
What the theorem says
In a right triangle, the square on the hypotenuse equals the sum of the squares on the other two sides. That is a statement about AREAS, and it is worth reading it that way at least once.
Draw a square on each side of a 3-4-5 triangle. The squares on the legs have areas 9 and 16. The square on the hypotenuse has area 25. The two smaller squares, cut up, fit exactly into the larger one — there are dissection proofs that do precisely this.
The algebraic form a² + b² = c² is the same statement written down. Nothing about it is approximate: it is exact for every right triangle, of every size.
Why the converse matters
The theorem says: right angle ⇒ a² + b² = c². The converse says the reverse, and it is the half that gets used on building sites.
If three lengths satisfy a² + b² = c², the triangle they make IS right-angled. So to square a corner, measure 3 units along one edge and 4 along the other; when the diagonal between the marks is exactly 5, the corner is square.
No protractor, no set square, no trust in either. It works at any scale — 300, 400 and 500 millimetres, or 6, 8 and 10 metres — because every multiple of a triple is a triple.
It also gives a test: if a² + b² is greater than c² the triangle is acute, and if it is less, obtuse. The comparison classifies the triangle, not just the right-angled case.
Pythagorean triples
Three whole numbers satisfying the theorem. They are uncommon, which is why the small ones are memorable: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 9-40-41.
A triple is primitive when the three share no common factor. 6-8-10 is a triple but not primitive — it is 3-4-5 doubled. The page reduces whatever you enter to its primitive.
Euclid’s formula generates all of them: for m > n > 0, the sides m² − n², 2mn and m² + n² always form a triple, and every primitive one arises from a coprime pair of opposite parity.
Two consequences worth knowing: one leg is always divisible by 3, one by 4, and one side by 5. And Fermat’s Last Theorem is the statement that nothing like this exists for cubes or any higher power — aⁿ + bⁿ = cⁿ has no whole-number solutions for n > 2.
When it does not apply
No right angle, no theorem. This is the constraint people forget. For any other triangle the cosine rule applies: c² = a² + b² − 2ab·cos C. The extra term is zero exactly when C is 90°, which is why Pythagoras is a special case of it.
Not on a sphere. On a curved surface the theorem fails. Walk 1000 km south, 1000 km east and the direct distance home is not √2 million km, because the Earth is not flat. Spherical trigonometry has its own rules.
Watch which side is which. The hypotenuse must be the longest. Entering it as a leg gives a negative under the root, and this page reports that as a mislabelled input rather than as NaN.
Where it is actually used
Squaring a corner. The 3-4-5 method, above. Builders, tilers and carpenters use it constantly.
Diagonals. Will a 200 cm sofa turn a corner; what is the diagonal of a 16:9 screen; how long is the brace across a rectangular frame. All the same calculation.
Distance on a grid. Straight-line distance between two points is Pythagoras applied to the differences in the coordinates.
Vector magnitude. The length of a vector is the root of the sum of its squared components — the same theorem, in as many dimensions as you like.
Roof pitch and ladder safety. Rise and run give the rafter length; wall height and base distance give the ladder length.
Distance is Pythagoras
The distance formula is not a separate thing to learn. √((x₂−x₁)² + (y₂−y₁)²) is Pythagoras with the legs being the horizontal and vertical gaps.
In three dimensions it extends by adding another squared term, and it keeps extending: the length of a vector in any number of dimensions is the root of the sum of the squares of its components.
That generalisation is why the theorem turns up in places with no visible triangle at all — the magnitude of a signal, the distance between two data points, the norm of an error. All of them are the same statement about squares adding up.
Sources and methodology
The theorem and its converse are foundational; these are the references.
Method. The hypotenuse is checked against both legs before anything is solved, so a swapped input gets a reason rather than a square root of a negative. Integer triples are detected exactly and reduced by their greatest common divisor to the primitive. The identity is evaluated on the returned values and displayed, so the check is computed rather than restated. The suite asserts across two thousand generated cases that a² + b² = c² holds on the output and that the two acute angles sum to 90°. That engine is verified on every change against 76 hand-written assertions, including that a² + b² = c² holds on the returned sides across two thousand generated cases, and that the two acute angles always sum to exactly 90°. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
TriangleSolve any triangle from three measurements — and when two sides and a non-included angle describe TWO triangles, this one shows both instead of picking one.
Heron’s FormulaArea from three sides in the rearrangement that keeps its digits — with the textbook form shown beside it so you can see what the usual order costs.
Special Right Triangles30-60-90 and 45-45-90 from any one side, in exact surd form as well as decimals — with the warning that the long leg is √3 times the short, not twice.
Similar TrianglesScale factor and the missing sides — plus the area factor, which is its square. Two pairs with different ratios are reported as not similar rather than averaged.
Square RootThe exact square root first — 72 gives 6 root 2 — then the decimal to as many as sixty places, computed on whole numbers rather than a double.
CircleRadius, diameter, circumference and area from any one of them — and why a 16-inch pizza is four times an 8-inch one rather than twice.
For a triangle without a right angle, the Triangle Calculator uses the cosine rule — which is this theorem with a correction term that disappears exactly when the angle is 90°.
Educational use disclaimer
This is an educational tool. The theorem holds only for right triangles; for any other, the cosine rule is what generalises it, and the page says so rather than assuming a right angle you did not state.
Published the Pythagorean theorem page checking that the hypotenuse really is the longest side before solving, so a swapped input gets a reason rather than the square root of a negative.
Integer triples are detected and reduced to their primitive, and the converse is stated because it is the half used on building sites — 3-4-5 squares a corner without a set square.
Restores a slug that had been answering 410 Gone since an old content purge.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.