Pythagorean theorem calculator guide
In a right triangle the two sides that meet at the right angle are the legs (a and b), and the side opposite the right angle is the hypotenuse (c), always the longest side. The Pythagorean theorem states that the square of the hypotenuse equals the sum of the squares of the legs: a² + b² = c². Rearranged, that identity finds any one side from the other two.
Choose Find hypotenuse to compute c = √(a² + b²) from two positive legs, or Find a leg to compute the missing leg as √(c² − known²) from a positive hypotenuse and one shorter known leg. The calculator also reports whether the three sides form a Pythagorean triple — all three lengths are integers, as in the classic 3-4-5 triangle.
How to use this Pythagorean theorem calculator
- Choose the mode: Select Find hypotenuse to compute c from both legs, or Find a leg to compute the missing leg from the hypotenuse and the other known side.
- Enter the known sides: All lengths must be positive numbers in the same unit. Empty, non-numeric, and non-positive values are rejected. When finding a leg, the known side must be shorter than the hypotenuse.
- Select Calculate: Press Calculate (or Enter in a field). The missing side appears with the identity a² + b² = c² written in numbers so you can check the arithmetic.
- Read the triple flag: If a, b, and c are all whole numbers (within 1e-9 of integers), the result is labelled a Pythagorean triple. The default 3-4-5 triangle is the smallest primitive example.
- Reset or share: Reset returns to legs 3 and 4 with hypotenuse 5. Copy the link to share the current mode and side lengths — they are encoded in the page URL.
Formula and variables
The theorem relates the two legs a and b to the hypotenuse c. Solving for the hypotenuse takes the positive square root of the sum of the squared legs. Solving for a missing leg subtracts the square of the known leg from the square of the hypotenuse and takes the positive square root. The known leg must be strictly shorter than the hypotenuse; otherwise the difference under the radical is zero or negative and no positive real triangle exists. The converse of the Pythagorean theorem says the implication also runs the other way: if three positive lengths satisfy a² + b² = c², then a triangle with those side lengths is right-angled between a and b.
a² + b² = c² c = √(a² + b²) unknown = √(c² − known²)- a, b — Legs
- The two sides that form the right angle. Either may be the known side when finding a missing leg. (length (any consistent unit))
- c — Hypotenuse
- The side opposite the right angle, always longer than either leg. (length (any consistent unit))
- known — Known leg
- The given leg when solving for the other leg; it must satisfy known < c. (length (any consistent unit))
Worked example: the 3-4-5 triple
A right triangle has legs 3 and 4 (the calculator default). Find the hypotenuse, then recover one leg from the hypotenuse to show both modes of the theorem.
- Leg a
- 3
- Leg b
- 4
- Mode
- Find hypotenuse, then Find a leg
- Hypotenuse: c = √(a² + b²) = √(3² + 4²) = √(9 + 16) = √25 = 5.
- The identity reads 3² + 4² = 5², or 9 + 16 = 25.
- Missing leg: given c = 5 and known leg b = 4, a = √(c² − b²) = √(25 − 16) = √9 = 3.
- All three sides are integers, so 3-4-5 is a Pythagorean triple. Any positive multiple (6-8-10, 9-12-15, …) is a triple as well.
Result: c = 5, and the missing leg is 3; 3-4-5 is a Pythagorean triple
Five is the unique positive length that completes a right triangle with legs 3 and 4. The converse of the Pythagorean theorem then says that any triangle whose sides are 3, 4, and 5 is right-angled between the sides of length 3 and 4 — which is why the 3-4-5 layout is used to square a corner in construction.
Understanding your results
The missing side
The large value is the side that was solved for: the hypotenuse c in Find hypotenuse mode, or the missing leg a in Find a leg mode. Beneath it, a, b, and c are listed together so every side of the triangle is visible.
The identity a² + b² = c²
The two numeric lines restated the theorem with your sides: first as squares of the side lengths, then as the summed areas. For 3-4-5 they read 3² + 4² = 5² and 9 + 16 = 25. If those two lines do not match, a side was transcribed incorrectly.
Pythagorean triples
When every side is an integer, the result is a Pythagorean triple. Primitive triples (gcd(a, b, c) = 1) include 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Sides such as 2, 3, and √13 satisfy the theorem but are not a triple, because √13 is not an integer.
Assumptions
- The triangle is right-angled; the theorem does not apply to acute or obtuse triangles.
- a and b are the legs and c is the hypotenuse (the longest side, opposite the right angle).
- All entered lengths are positive real numbers measured in the same unit.
- A Pythagorean triple is reported when each of a, b, and c lies within 1e-9 of an integer.
Limitations
- The calculator solves plane right triangles only; it does not apply the law of cosines, find angles, or compute 3-D space diagonals.
- A known leg equal to or longer than the hypotenuse is rejected rather than returning 0 or a complex number.
- Very large side lengths that overflow to Infinity are rejected instead of being approximated.
- Units are not converted: 3 feet and 4 inches are not a 3-4-5 triangle until both lengths use one unit.
Common mistakes
- Using the theorem on a triangle that is not right-angled; only a 90° angle between the legs makes a² + b² = c² true.
- Treating a leg as the hypotenuse: c is always the longest side. If a “hypotenuse” comes out shorter than a given leg, the labels are swapped.
- Subtracting in the wrong order when finding a leg — compute √(c² − known²), never √(known² − c²).
- Expecting a triple whenever the theorem holds; 2-3-√13 is a right triangle but not a Pythagorean triple.
- Mixing units (metres with centimetres, feet with inches) before squaring.
- Forgetting the converse: three lengths that satisfy a² + b² = c² form a right triangle, which is the test behind the 3-4-5 squaring method.
Practical use cases
Find a diagonal or the hypotenuse
A rectangle 9 by 12 has diagonal √(9² + 12²) = √(81 + 144) = √225 = 15, a scaled 3-4-5 triple. The same step finds a rafter, a screen diagonal, or the straight-line path across a rectangular lot.
Find a missing height or base
A 10-metre ladder stands 6 metres from a wall. The height it reaches is √(10² − 6²) = √(100 − 36) = √64 = 8 metres. Any problem that gives the hypotenuse and one leg uses this rearrangement.
Square a corner with a 3-4-5 triple
Measure 3 units along one edge and 4 along the other; if the diagonal is 5, the corner is a right angle by the converse of the theorem. Crews often scale the same triple to 6-8-10 or 9-12-15 for a larger layout.
Check homework against a known triple
If the sides come out 5, 12, and 13, or 8, 15, and 17, the arithmetic is consistent with a primitive triple. A non-integer hypotenuse such as √13 is equally valid — it is simply not a triple.
Planning and decision guide
Identify the hypotenuse first
Mark the right angle, then label the opposite side c. The remaining two sides are a and b in either order. Swapping a and b does not change c; swapping a leg with c does, and that is the usual setup error.
Use the converse to test a right angle
If you already have three lengths and want to know whether they form a right triangle, check whether (longest)² equals the sum of the other two squares. Equality means the angle opposite the longest side is 90°; a larger left-hand side means that angle is obtuse, a smaller one means it is acute.
Keep the same units and extra digits until the end
Square, add or subtract, then take the square root. Rounding a side before squaring compounds error. For a triple the result is exact; otherwise the calculator shows up to six decimal places.
Frequently asked questions
What is the Pythagorean theorem?
In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². The identity finds any one side from the other two and holds only when the angle between a and b is 90°.
What is a 3-4-5 triangle?
It is the smallest Pythagorean triple: 3² + 4² = 9 + 16 = 25 = 5². Any positive multiple (6-8-10, 9-12-15, 15-20-25) is also a right triangle. The default example on this calculator is 3-4-5.
What is the converse of the Pythagorean theorem?
If three positive lengths a, b, and c satisfy a² + b² = c², then a triangle with those sides is right-angled between a and b. The converse is the reason a 3-4-5 layout proves a corner is square, and it is how you test three given sides for a right angle.
How do I find a missing leg?
Use Find a leg. Enter the hypotenuse c and the known leg. The missing side is √(c² − known²). For c = 5 and a known leg of 4, the missing leg is √(25 − 16) = 3. The known leg must be shorter than c.
Why must the known leg be shorter than the hypotenuse?
The hypotenuse is the longest side of a right triangle. If the known “leg” is equal to or longer than c, then c² − known² is zero or negative, so there is no positive real missing side. The calculator rejects that input instead of returning 0 or a complex value.
What is a Pythagorean triple?
A Pythagorean triple is three positive integers a, b, and c with a² + b² = c². This calculator flags a triple when each computed side is within 1e-9 of an integer, so 3-4-5 and 5-12-13 count, while 2-3-√13 does not.
Does the theorem work for non-right triangles?
No. For an acute or obtuse triangle the correct relation is the law of cosines, c² = a² + b² − 2ab cos(C). The Pythagorean theorem is the special case of that law when C = 90° and cos(C) = 0.
How do I know which side is the hypotenuse?
It is the side opposite the right angle and the longest of the three. In a diagram look for the small square that marks 90°, then take the side across from it as c. If you are given three lengths and no diagram, the largest length is the only candidate for c.
Sources and review
- Pythagorean Theorem — MathWorld — A Wolfram Resource. Accessed 2026-08-23.
- Pythagorean theorem intro — Khan Academy. Accessed 2026-08-23.
- Pythagorean Theorem — Math Is Fun. Accessed 2026-08-23.
Reviewed 2026-08-23.