b2KIT

Pythagorean Theorem Calculator

Calculate the missing side of a right triangle from two known sides with visual diagram.

Tested tool guide Tested browser tools Checked August 16, 2026

What Pythagorean Theorem Calculator does, with a checked example

This calculator solves the right triangle relation a² + b² = c²: enter any two side lengths, and it returns the third, with a visual diagram of the labeled triangle. The catch most people hit: the hypotenuse is the side opposite the right angle and has to be identified as such, and when that side is missing you add the squares, but when a leg is missing you subtract them. The result is only valid for a triangle with one exact 90-degree angle; for anything else, the law of cosines, not this tool, gives the missing side.

Worked example

A concrete input and expected output from the current implementation.

Input

Leg a = 5, hypotenuse c = 13; find leg b

Expected output

b = 12

With c as the hypotenuse, b² = c² - a² = 169 - 25 = 144, and the square root of 144 is 12. The three sides form the classic 5-12-13 Pythagorean triple, so every value comes out as an exact integer.

How the result is produced

1

How it picks add or subtract

You enter two of the three sides, and the tool must know which one is the hypotenuse, the longest side and the one opposite the right angle. That choice fixes the operation: with the hypotenuse missing, it adds the squared legs and takes the root, sqrt(a² + b²); with a leg missing, it subtracts, sqrt(c² - b²). Mislabeling which side is the hypotenuse is the difference between these two computations.

2

Diagram and geometric validity

The page draws a right triangle with the right-angle marker, labels the two known sides, and calls out the unknown one. The arithmetic is only possible when the inputs are geometrically consistent: both known sides positive, and a stated hypotenuse strictly longer than each stated leg. Otherwise the square-root step has no real result and no length exists to report.

Good uses

  • Squaring a corner on site: mark 3 units along one edge from the corner and 4 along the other, enter them, and the diagonal across should read exactly 5. Any deviation means the corner is not a true right angle.
  • Finding the diagonal of a rectangle: a 1.5 m by 2 m tabletop returns a 2.5 m diagonal, which tells you whether furniture or materials will fit through a doorway or into an elevator.
  • Planning a ladder or ramp: with the wall height and the base distance from the wall measured on the ground, the tool returns the minimum ladder length, sqrt(height² + distance²), so the ladder you rent is long enough and at a safe angle.

Limits and checks

  • Right-angled only: the theorem assumes one angle of exactly 90 degrees. Feeding in sides from a measured triangle that is close to right but not exact (an 89-degree corner) still produces a number, but it is the hypotenuse of a perfect right triangle, not the length you will actually measure.
  • Hypotenuse labeling: the hypotenuse must be the longest side. If the side you name as hypotenuse is not the longest, the input set cannot form a right triangle and no valid answer exists; re-examine which side really sits opposite the 90-degree angle.
  • Units and rounding: the tool is unit-agnostic, so mixing feet with inches yields nonsense, and the result comes back in whatever unit you entered. Many answers are irrational, such as legs of 1 and 1 giving sqrt(2), about 1.414, so displayed values are rounded and slightly inexact.

Common questions

Does it work for any triangle, or only right triangles?

Only right triangles, and the diagram always shows the 90-degree marker so you can confirm the input qualifies. With three sides and no known angle, a missing length is not determined by the Pythagorean relation. The general formula is the law of cosines, c² = a² + b² - 2ab cos(C), which also needs the included angle.

Why does the result come out smaller when I enter the hypotenuse and one leg?

Because the missing value is a leg, and the relation rearranges to a² = c² - b²: you subtract the squared leg from the squared hypotenuse. The hypotenuse is the longest side, so every leg must be shorter than it. Adding would produce a length longer than the hypotenuse, which cannot be a side of the same triangle.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools