100% freeno sign-upfiles never leave your device
  1. Tools
  2. Calculators

Pythagorean Theorem Calculator – Find the Hypotenuse or a Missing Leg

Enter any two sides of a right triangle and get the third one instantly, together with the area, perimeter, both acute angles, the altitude to the hypotenuse and a check for whole-number Pythagorean triples. Your numbers stay on your device.

  • 100% free
  • No sign-up
  • Your numbers never leave your device

Tool

Leave exactly one of the three sides empty and the calculator finds it. Use a period for decimals (for example 4.5). Any unit works as long as you use the same one for every side.

How to use the Pythagorean theorem calculator

  1. Type the two sides you know into the matching boxes. The legs are a and b, the two sides that meet at the right angle. The hypotenuse is c, the long side opposite the right angle.
  2. Leave the third box empty. If you know both legs, leave c empty to find the hypotenuse. If you know the hypotenuse and one leg, leave the other leg empty.
  3. Press Find missing side or hit Enter. The answer appears at the top, followed by a labeled sketch of your triangle.
  4. Read the extra rows: area, perimeter, the two acute angles, the altitude dropped onto the hypotenuse and whether your numbers form a whole-number triple.
  5. Use Copy result to paste the numbers into a note, a spreadsheet or a message, or Clear to start again.

What the Pythagorean theorem says

In every right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². If the legs are 3 and 4, then 9 + 16 = 25, so the hypotenuse is the square root of 25, which is 5. The theorem is named after the Greek mathematician Pythagoras, although Babylonian and Indian scribes were using the same relationship centuries earlier. It only applies when one angle is exactly 90 degrees, and that restriction is also what makes it useful: if the three sides of a triangle satisfy the equation, you can be certain the triangle has a right angle.

Rearranging the equation gives the other two forms the calculator uses. To find a leg, subtract the square of the known leg from the square of the hypotenuse and take the square root: a = √(c² − b²). Because the hypotenuse is always the longest side, a valid triangle needs c to be greater than both legs. When you enter a hypotenuse that is too short, the tool tells you so instead of returning a meaningless number.

Worked examples

Finding the hypotenuse. A ladder base sits 6 feet from a wall and the top touches the wall 8 feet up. The ladder length is c = √(6² + 8²) = √100 = 10 feet. That is just the 3-4-5 triangle doubled.

Finding a leg. A 13-inch brace runs diagonally across a frame that is 5 inches wide. The height is b = √(13² − 5²) = √(169 − 25) = √144 = 12 inches. Enter 5 in a, 13 in c, leave b empty, and the tool returns 12.

An answer that is not a whole number. Legs of 5 and 7 give c = √74, which is about 8.6023. The calculator shows up to ten decimal places, so you can round it to whatever precision your project needs, for instance 8 5/8 inches when cutting lumber.

Pythagorean triples worth knowing

A Pythagorean triple is a set of three positive whole numbers that satisfy a² + b² = c². They are handy because the answer comes out clean. The row below the result tells you whether your triangle is one, and whether it is a primitive triple or a multiple of a smaller one.

Triple (a, b, c)CheckMultiples
3, 4, 59 + 16 = 256-8-10, 9-12-15, 30-40-50
5, 12, 1325 + 144 = 16910-24-26, 15-36-39
8, 15, 1764 + 225 = 28916-30-34
7, 24, 2549 + 576 = 62514-48-50
20, 21, 29400 + 441 = 84140-42-58

Builders rely on the 3-4-5 rule to square a corner without any special tools. Measure 3 feet along one edge, 4 feet along the other, and adjust until the diagonal between those marks measures exactly 5 feet. Any multiple works too, and a larger one such as 6-8-10 or 9-12-15 is more accurate over long distances.

The extra values explained

Area is half the product of the legs, (a × b) / 2, because a right triangle is half of a rectangle. Perimeter is simply a + b + c. The acute angles come from the arctangent of the legs: the angle opposite a equals arctan(a / b), and the other angle is 90 degrees minus that, so the three angles always add up to 180. The altitude to the hypotenuse is (a × b) / c. It is the length of the perpendicular from the right-angle corner to the long side, and it appears in problems about similar triangles and in geometry tests.

For example, the 3-4-5 triangle has an area of 6, a perimeter of 12, acute angles of about 36.87 and 53.13 degrees, and an altitude of 2.4. Those numbers are useful for roof pitch, ramp slope and any layout where you need the angle as well as the length.

Where the theorem is used in everyday life

Carpenters use it to calculate the length of rafters and diagonal braces. Homeowners use it to check whether a ladder is tall enough to reach a gutter while staying at a safe angle. Screen sizes are quoted as diagonals, so a 16:9 display that is 24 inches wide and 13.5 inches tall has a diagonal of √(24² + 13.5²), about 27.5 inches. Surveyors, game developers and drone pilots calculate straight-line distance from two perpendicular offsets, which is the same formula applied to coordinates. If you need to take roots by hand, our Square Root Calculator shows simplified radical forms such as 6√2.

Common mistakes to avoid

  • Using the wrong side as c. The hypotenuse is always the longest side. If your longest measurement is a leg, the triangle is not described by these inputs.
  • Mixing units. Feet and inches, or meters and centimeters, must be converted first. The Unit Converter makes that quick.
  • Applying it to non-right triangles. For other triangles you need the law of cosines, which adds a correction term involving the angle.
  • Rounding too early. Keep full precision until the final step, then round once.
  • Forgetting the square root. The sum a² + b² equals c², not c. Take the root at the end.

Accuracy and limits

The calculator uses standard double-precision arithmetic, which is accurate to about 15 significant digits, and displays up to ten decimal places. Side lengths must be greater than zero. A triple is recognized only when all three sides are whole numbers once rounded to six decimals. The sketch is scaled to fit, so a very thin triangle may look flat, but the labels always show the exact values.

Private by design

Every calculation runs locally in your browser. The numbers you type are never uploaded or stored, there is no account to create, and once the page has loaded it keeps working without an internet connection.

Frequently asked questions

What is the Pythagorean theorem formula?

The formula is a² + b² = c², where a and b are the legs of a right triangle and c is the hypotenuse, the side opposite the right angle. To find c, take the square root of a² + b². To find a leg, take the square root of c² minus the other leg squared.

How do I find the hypotenuse of a right triangle?

Enter both legs in the a and b boxes, leave c empty and press Find missing side. For legs of 6 and 8, the tool returns c = 10 because 36 + 64 = 100 and the square root of 100 is 10.

How do I find a missing leg if I know the hypotenuse?

Fill in c and one leg, then leave the other leg empty. The tool subtracts the square of the known leg from c² and takes the square root. With c = 13 and a = 5 the missing leg is 12.

Why does the calculator say the hypotenuse must be longer than the leg?

In a right triangle the hypotenuse is always the longest side. If c is equal to or shorter than a leg, the subtraction would give zero or a negative number under the root, and no such triangle exists. Check which side lies opposite the right angle.

What is a Pythagorean triple?

It is a set of three whole numbers, such as 3-4-5 or 5-12-13, that satisfy a² + b² = c². A primitive triple has no common factor, while multiples like 6-8-10 are scaled versions. The calculator flags both types.

Does the theorem work for triangles without a right angle?

No. For any other triangle use the law of cosines, c² = a² + b² − 2ab cos(C). When C is 90 degrees the cosine term is zero and it collapses into the Pythagorean theorem.

Can I use feet, inches, meters or centimeters?

Yes, any unit works. Just use the same unit for every side, and the answer will be in that unit. The area is in square units of the same kind.

How accurate are the angles?

Angles are computed from the arctangent of the legs and shown to two decimal places. Together with the right angle they always add up to 180 degrees.

Are my numbers uploaded anywhere?

No. Everything runs in your browser. Nothing is sent, stored or tracked.

Related tools

Need custom software, a faster website or help with digital projects? The team at 4D1A can help.