The Pythagorean Theorem Calculator is a free online tool that finds any missing side of a right triangle in one click. Pick whether you want the hypotenuse or one of the legs, type the two values you already know, and the calculator returns the third side, the triangle’s area, perimeter, and both acute angles in degrees. A collapsible step-by-step panel shows the full derivation so you can hand the working in for class or double-check the arithmetic for yourself.
The Pythagorean theorem is one of the oldest and most influential results in mathematics. It states that in any right triangle (a triangle with one 90° angle) the area of the square built on the hypotenuse equals the combined area of the squares built on the two legs. Algebraically: a² + b² = c², where c is the hypotenuse — the side opposite the right angle, always the longest of the three — and a and b are the two legs that form the right angle. The theorem is named after the Greek mathematician Pythagoras of Samos (c. 570-495 BC), although clay tablets show that the relation was known to Babylonian scribes more than a thousand years earlier and to Indian mathematicians of the Sulba Sutras tradition.
There are three ways to use the formula, and the calculator handles all of them. To find the hypotenuse from two legs, the calculator computes c = √(a² + b²). To find a missing leg when you know the hypotenuse and the other leg, it rearranges to a = √(c² − b²) or b = √(c² − a²). The classic worked example is 3-4-5: with legs 3 and 4, the hypotenuse is √(9 + 16) = √25 = 5 exactly. With hypotenuse 13 and leg 5, the missing leg is √(169 − 25) = √144 = 12 exactly. With two legs of length 1, the hypotenuse is √2 ≈ 1.4142, the diagonal of a unit square — a number whose irrationality famously shocked the ancient Pythagoreans.
A Pythagorean triple is a set of three positive integers (a, b, c) for which a² + b² = c² holds exactly. Primitive triples — those whose three numbers share no common factor — are surprisingly numerous. The first ten in order of hypotenuse are 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 9-40-41, 12-35-37, 11-60-61, 28-45-53, and 33-56-65. Every primitive triple can be scaled by any positive integer k to produce another valid triple, so 6-8-10, 9-12-15, 12-16-20 and so on are all "shadows" of 3-4-5. Triples have a long practical history: Egyptian rope-stretchers used a 3-4-5 loop tied at twelve evenly spaced knots to lay out perfectly square corners for the bases of pyramids, and modern carpenters still use the same trick to check that a wall is plumb against a floor.
The Pythagorean theorem appears everywhere once you start looking. It is the basis for the distance formula in coordinate geometry: the distance between two points (x₁, y₁) and (x₂, y₂) on the plane is √((x₂ − x₁)² + (y₂ − y₁)²), which is just the Pythagorean theorem applied to the legs of a right triangle whose hypotenuse joins the two points. It tells you the diagonal of a screen given its width and height — a 16:9 television advertised as "55 inches" is measuring the hypotenuse, not the width. It tells you the length of a rafter given the run and rise of a roof, the length of a ladder given the height it must reach and how far its base sits from the wall, and the great-circle distance approximation for short hops on a map. In computer graphics and physics, it is the workhorse behind vector magnitude, collision detection, and lighting falloff calculations.
The calculator also returns the two acute angles in the right triangle, computed as α = arctan(a / b) and β = arctan(b / a), the angles opposite sides a and b respectively. These two angles always sum to exactly 90° because the triangle’s three interior angles must total 180° and the right angle alone accounts for 90°. The area uses the simple formula A = (a × b) / 2, since the two legs are perpendicular and so serve directly as the base and height of the triangle. The perimeter is the straightforward sum a + b + c.
A small but important note about accuracy. The calculator computes the hypotenuse with the JavaScript Math.hypot function, which is specifically designed to avoid numerical overflow when the legs are very large and underflow when they are very small — it does not simply compute Math.sqrt(a*a + b*b). For solving a missing leg, the calculator uses the factored form √((c − leg)(c + leg)) instead of √(c² − leg²) because the factored form preserves more significant digits when the hypotenuse and leg are nearly equal. Internally everything is computed in IEEE-754 double precision and rounded only at display time, so the answers are accurate to about 15 significant digits regardless of how many decimal places you choose to show.
Finally, a reminder about scope. The Pythagorean theorem is exclusive to right triangles — triangles with one 90° angle. For any other triangle the more general law of cosines applies: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. When the angle C happens to be 90°, cos(C) = 0 and the law of cosines collapses back to a² + b² = c². So you can think of the Pythagorean theorem as the right-triangle special case of a more general result. For non-right triangles use a triangle solver that supports the law of cosines and the law of sines instead.