Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Pythagorean Theorem Calculator

Last updated: 27 June 2026

Reviewed by Gavin Meiring, Lead research and primary author · Doctoral Candidate (Corporate Governance) · Research and drafting assisted by AI

a² + b² = c²
Was this helpful?


Pythagorean Theorem Calculator

A Pythagorean theorem calculator finds the missing side of a right-angled triangle when two sides are known. It is used by students, builders, architects, and engineers who need to verify right angles or calculate diagonal distances quickly.

How to Use the Pythagorean Theorem Calculator

  1. Enter the two sides you know. If you know both legs (a and b), the calculator finds the hypotenuse (c). If you know the hypotenuse and one leg, it finds the missing leg.
  2. Label your values: a and b are the two shorter sides (legs); c is the hypotenuse (the longest side, opposite the right angle).
  3. Leave the unknown field blank.
  4. Click Calculate to see the missing side length and the full working.
  5. The result also displays the perimeter and area of the triangle.

The Formula

The Pythagorean theorem states that in any right-angled triangle: a squared plus b squared = c squared, where c is the hypotenuse. To find the hypotenuse: c = square root of (a squared plus b squared). To find a missing leg: a = square root of (c squared minus b squared). The theorem works only for right-angled triangles. If you need to verify whether a triangle is right-angled, check whether a squared plus b squared equals c squared using the three side lengths.

Real-World Example

A builder wants to check that a wall corner is a true right angle using the 3-4-5 method. Measure 3 m along one wall and 4 m along the other wall from the corner. The diagonal between these two points should measure exactly 5 m. Check: 3 squared plus 4 squared = 9 plus 16 = 25 = 5 squared. Confirmed right angle. Now a different scenario: a ladder 6 m long leans against a wall with its base 2 m from the wall. How high does it reach? Height = square root of (6 squared minus 2 squared) = square root of (36 minus 4) = square root of 32 = 5.66 m.

Pythagorean Triples

A Pythagorean triple is a set of three positive integers that satisfy the theorem exactly, producing a right-angled triangle with whole-number sides. Common triples include: 3-4-5; 5-12-13; 8-15-17; 7-24-25; 20-21-29. Multiples of these triples also work: 6-8-10, 9-12-15, and 15-20-25 are all multiples of 3-4-5. These triples are used in construction because they let builders verify right angles using only a tape measure and string, without needing angle-measuring tools.

Frequently Asked Questions

Does the Pythagorean theorem work in three dimensions? Yes, with an extension. The space diagonal d of a rectangular box with dimensions a, b, and c satisfies: d squared = a squared plus b squared plus c squared. This is derived by applying the theorem twice: first to find the floor diagonal, then to include the height dimension.

Who was Pythagoras and did he discover the theorem? Pythagoras was a Greek mathematician who lived around 570 to 495 BC. While the theorem bears his name and he or his school likely provided the first proof, the relationship was known to Babylonian and Indian mathematicians centuries earlier. The Babylonian clay tablet Plimpton 322 (circa 1800 BC) lists Pythagorean triples.

Can the Pythagorean theorem be used on non-right triangles? Not directly. For non-right triangles, use the law of cosines: c squared = a squared plus b squared minus (2ab times cos C). When angle C = 90 degrees, cos(90) = 0, and the formula reduces to the Pythagorean theorem. So the theorem is a special case of the law of cosines.

How is the Pythagorean theorem used in everyday technology? GPS receivers use it (in extended 3D form) to calculate distances from satellite signals. Computer graphics use it to compute distances between points on screen. Architects use it to determine rafter lengths, stair dimensions, and diagonal bracing requirements. It also underpins the distance formula in coordinate geometry: distance = square root of ((x2 minus x1) squared plus (y2 minus y1) squared).


Also try these free tools:

Three worked examples you can check by hand

Each example uses the form the calculator applies: c = sqrt(a squared plus b squared) when both legs are known, and a = sqrt(c squared minus b squared) when a leg is missing. Every number below is exact, so you can reproduce it on paper.

Example 1, finding the hypotenuse. A deck is braced by two perpendicular beams, one 9 ft and one 12 ft. The diagonal brace is c = sqrt(9 squared plus 12 squared) = sqrt(81 plus 144) = sqrt(225) = 15 ft exactly. The perimeter is 9 plus 12 plus 15 = 36 ft and the area is (9 times 12) divided by 2 = 54 sq ft. This is the 3-4-5 triple scaled by 3.

Example 2, finding a leg. A 13 m guy wire runs from the top of a mast to an anchor 5 m from the base. The mast height is the missing leg: a = sqrt(13 squared minus 5 squared) = sqrt(169 minus 25) = sqrt(144) = 12 m exactly.

Example 3, a result that is not a whole number. A screen is 2.5 m wide and 6 m tall. Its diagonal is sqrt(2.5 squared plus 6 squared) = sqrt(6.25 plus 36) = sqrt(42.25) = 6.5 m. The square root lands exactly on 6.5 because 2.5, 6 and 6.5 are the 5-12-13 triple scaled by 0.5.

When the square root does not land on a whole number it is irrational, and any decimal you write down is truncated. The calculator carries the full double-precision value and rounds only for display, so a value pasted from the result is closer to the true length than a value rounded by hand.

Input and output comparison

The table treats a and b as the two legs and reports the hypotenuse, the perimeter and the area.

abcPerimeterAreaNote
345126primitive triple 3-4-5
512133030primitive triple 5-12-13
815174060primitive triple 8-15-17
724255684primitive triple 7-24-25
20212970210primitive triple 20-21-29
2.566.5157.55-12-13 scaled by 0.5
111.414213563.414213560.5square root of 2, irrational

The last row is the case that catches people out. With both legs at 1 the hypotenuse is the square root of 2, which never terminates, so a square checked with two sides and a diagonal will always be a hair out. Trades work around this by using a triple from the table instead of a square.

What the formula assumes, and what it does not cover

The calculator assumes all of the following. If any one of them is false the arithmetic still runs, but the answer no longer describes your triangle.

  • One angle is exactly 90 degrees. A corner at 89.5 degrees returns a diagonal that is short by a small but measurable amount.
  • The geometry is flat. On a curved surface a right angle can have a hypotenuse that breaks the rule. Over a 1 km survey the curvature of the Earth is negligible; over 100 km it is not.
  • All lengths are positive and the hypotenuse is the longest side. Enter a leg longer than the hypotenuse in leg-finding mode and the result is imaginary, so there is no real length to return.
  • Every field uses the same unit. The theorem is unit-agnostic, so mixing feet and metres returns a number in neither.

The theorem does not cover oblique triangles. The law of cosines handles the general case: c squared = a squared plus b squared minus 2ab times cos C. Setting C to 90 degrees makes cos C zero and removes the last term, which is why the theorem is the special case of that law rather than a separate rule. A box rather than a plane needs the space diagonal, the square root of a squared plus b squared plus c squared.

Which leg moves the answer more

Both legs feed the hypotenuse, but not equally. Differentiating c = sqrt(a squared plus b squared) splits the blame: a squared divided by c squared of any change comes from the first leg, and b squared divided by c squared from the second.

On a 3-4-5 triangle that is 9 divided by 25 = 0.36 from the 3 leg and 16 divided by 25 = 0.64 from the 4 leg. A 1 percent measuring error in the longer leg moves the diagonal about twice as far as the same error in the shorter one. On a long thin triangle the effect is sharper: legs of 1 and 20 put 400 divided by 401 = 0.998 of the sensitivity on the long leg. Measure the long side first, and measure it twice.

Source

The result is Proposition 47 of Book I of Euclid's Elements, which proves that the square on the hypotenuse equals the sum of the squares on the legs. The relationship is older than the proof: the Babylonian tablet Plimpton 322, written around 1800 BC, tabulates Pythagorean triples, and the 3-4-5 knotted-rope method used on building sites predates both.