Skip to content
CalculatorAtlas

Pythagorean Theorem Calculator

Tested

Find the hypotenuse or a missing leg of a right triangle.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The Pythagorean theorem states a² + b² = c², where c is the hypotenuse. With legs 3 and 4, c = √(9 + 16) = 5. The calculator also finds a missing leg: for c = 5 and a = 3, b = √(25 − 9) = 4.

Choose what to find (hypotenuse or a leg), then enter the known sides.

Related tools: Right Triangle Calculator: Solve a right triangle from its two legs: hypotenuse, angles, area and perimeter. Triangle Calculator: Area, perimeter, angles and type of a triangle from its three sides. Trigonometry Calculator: All six trigonometric functions of an angle.

How to use the Pythagorean Theorem Calculator

  1. Choose find: Hypotenuse c and Missing leg b.
  2. Enter leg a (above 0).
  3. Enter other side (leg b or hypotenuse c) (above 0).
  4. Press Calculate to see the result, and use Reset to start again.
Inputs of the Pythagorean Theorem Calculator
InputWhat to enterAllowed values
FindChoose one: Hypotenuse c; Missing leg bStarts at Hypotenuse c
Leg aA number> 0
Other side (leg b or hypotenuse c)A number> 0

Formula and method

Formula

a² + b² = c²

IEEE-754 double precision; shown to at most 6 decimal places.

c = √(a² + b²); b = √(c² − a²), which requires c > a.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Find = Hypotenuse c; Leg a = 3; Other side (leg b or hypotenuse c) = 4.

Results of example 1
ResultValue
Hypotenuse c5

Example 2

Inputs: Find = Missing leg b; Leg a = 5; Other side (leg b or hypotenuse c) = 13.

Results of example 2
ResultValue
Missing leg b12

Example 3

Inputs: Find = Hypotenuse c; Leg a = 1; Other side (leg b or hypotenuse c) = 1.

Results of example 3
ResultValue
Hypotenuse c1.414214

The first line is the headline result (hypotenuse c). IEEE-754 double precision; shown to at most 6 decimal places.

Common triples

Whole-number solutions are called Pythagorean triples: 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Multiplying all three sides by the same number gives another triple, such as 6-8-10.

Checking a right angle

Carpenters use 3-4-5 (or 6-8-10) to square a corner: if the diagonal between points 3 and 4 units along the sides measures exactly 5, the corner is 90°. When finding a leg, the hypotenuse must be longer than the known leg.

How the result changes with leg a

Holding every other input at the first worked example, this table changes only leg a. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with leg a
Leg aHypotenuse c
1.54.272002
35
67.211103
1212.649111

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Other side (leg b or hypotenuse c): entering "5" shows "The hypotenuse must be longer than the leg." beside that field and no result.

Choosing between the Pythagorean Theorem Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Pythagorean Theorem Calculator and similar calculators
CalculatorYou enterIt returns
[Right Triangle Calculator](/math/right-triangle-calculator/)leg a and leg bHypotenuse c
[Triangle Calculator](/math/triangle-calculator/)side a, side b and side cArea
[Trigonometry Calculator](/math/trigonometry-calculator/)angle and unitsin
[Law of Cosines Calculator](/math/law-of-cosines-calculator/)side b, side c and included angle ASide a
[Area Calculator](/math/area-calculator/)shape and aArea

Background: geometry measurements

Geometry results carry units that depend on the quantity: a perimeter or length is in linear units such as cm, an area or surface area is in square units (cm²) and a volume is in cubic units (cm³). Use one length unit for every input, because the calculator multiplies the numbers as given.

Flat (2D) shapes have an area and a perimeter; solids (3D) have a surface area and a volume. Two familiar checks: a circle of radius r has area πr² and circumference 2πr, and a sphere has volume (4/3)πr³ and surface area 4πr².

Assumptions and limitations

  • Hypotenuse must be longer than the known leg

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for other side (leg b or hypotenuse c) to confirm this.

Frequently asked questions

Does the theorem work for any triangle?

Only right triangles.

Can the hypotenuse be shorter than a leg?

No. The hypotenuse is always the longest side of a right triangle.

What is a converse check?

If a² + b² = c², the triangle is right-angled.

What does the Pythagorean Theorem Calculator calculate?

Find the hypotenuse or a missing leg of a right triangle. It returns Hypotenuse c.

What formula does the Pythagorean Theorem Calculator use?

a² + b² = c². c = √(a² + b²); b = √(c² − a²), which requires c > a.

What do I need to enter in the pythagorean Theorem Calculator?

You enter Find, Leg a and Other side (leg b or hypotenuse c).

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Hypotenuse must be longer than the known leg.

What does the “Find” option change?

It sets how the pythagorean Theorem is worked out. The choices are Hypotenuse c and Missing leg b.

What is an example of a pythagorean Theorem result?

With find Hypotenuse c, leg a 3 and other side (leg b or hypotenuse c) 4, the hypotenuse c is 5.

Sources

  • OpenStax, Algebra and Trigonometry 2e (Rice University): exponents, radicals, logarithms and inverse trigonometric functions

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.