Pythagorean Theorem Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Geometry & Stats#42

Pythagorean Theorem

\(a^2 + b^2 = c^2\): enter any two sides of a right triangle (c is the hypotenuse) and leave the third blank.

This Pythagorean theorem calculator finds the missing side of a right triangle. Enter any two sides (the legs a and b, or one leg and the hypotenuse c), leave the third blank, and it returns the missing side as an exact simplified square root and a decimal, the two acute angles, the area and the perimeter. It also tells you when the sides form a Pythagorean triple.

It’s free and needs no sign-up.

Pythagorean Theorem Calculator: In a right triangle the squares on the two legs add up to the square on the hypotenuse: 3²…
In a right triangle the squares on the two legs add up to the square on the hypotenuse: 3² + 4² = 5².

How to use it

  1. Enter two of the three sides. c is always the hypotenuse, the longest side, opposite the right angle.
  2. Leave the unknown side empty.
  3. Press Solve.

The formula

$$a^2 + b^2 = c^2$$

You wantFormula
Hypotenuse c( c = sqrt{a^2 + b^2} )
Leg a( a = sqrt{c^2 – b^2} )
Leg b( b = sqrt{c^2 – a^2} )

Worked example: the hypotenuse

Legs 3 and 4 (as loaded above): ( c = sqrt{9 + 16} = sqrt{25} = 5 ). The angles are about ( 36.87^circ ) and ( 53.13^circ ), and the area is ( frac12(3)(4) = 6 ).

Worked example: a missing leg

A 25 ft ladder reaches 24 ft up a wall. How far is its foot from the wall? ( a = sqrt{25^2 – 24^2} = sqrt{625 – 576} = sqrt{49} = 7 ) ft.

Worked example: an irrational answer

Legs 2 and 5: ( c = sqrt{4 + 25} = sqrt{29} approx 5.385 ). Most answers aren’t whole numbers; the exact form ( sqrt{29} ) is what teachers usually want.

Using a pythagorean theorem calculator to find pythagorean triples

Whole-number solutions are called Pythagorean triples: (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), and any multiple of them, such as (6, 8, 10). Spotting one saves calculation.

Tips and common mistakes

  • Putting the hypotenuse in the wrong place. ( c ) must be the longest side; ( a^2 + c^2 = b^2 ) only if b is the hypotenuse.
  • Adding instead of subtracting when finding a leg.
  • Taking the square root too early. ( sqrt{9 + 16} neq 3 + 4 ).
  • Non-right triangles. The theorem only works with a ( 90^circ ) angle; otherwise use the law of cosines or the triangle calculator.

Is it a right triangle? The converse

The theorem also works backwards: if \( a^2 + b^2 = c^2 \) for the longest side \( c \), the triangle has a right angle. Comparing the two sides also tells you the other cases:

A speed square on blueprints, showing right angles in construction.
ComparisonTriangle
\( a^2 + b^2 = c^2 \)right
\( a^2 + b^2 > c^2 \)acute (all angles under 90°)
\( a^2 + b^2 < c^2 \)obtuse (one angle over 90°)

Example. Sides 9, 40, 41: \( 81 + 1600 = 1681 = 41^2 \), so it is a right triangle. Sides 7, 8, 11: \( 49 + 64 = 113 < 121 \), so it is obtuse.

Distance between two points

The distance formula is the Pythagorean theorem on a grid. From \( (1, 2) \) to \( (7, 10) \), the horizontal leg is 6 and the vertical leg is 8, so the distance is \( \sqrt{36 + 64} = 10 \). See the distance and midpoint calculator.

In three dimensions

The longest straight line inside a box (its space diagonal) uses the theorem twice:

A spiral stone sculpture, showing a three-dimensional shape.

$$d = \sqrt{a^2 + b^2 + c^2}$$

A box 3 × 4 × 12 has a space diagonal of \( \sqrt{9 + 16 + 144} = \sqrt{169} = 13 \). That is how you check whether a long pole fits in a box or a room.

Real-world examples

  • Ladder: a 6 m ladder with its foot 1.5 m from a wall reaches \( \sqrt{36 - 2.25} = \sqrt{33.75} \approx 5.81 \) m up the wall.
  • TV screen: a 55-inch 16:9 screen has a diagonal of 55 inches. Its width and height are in the ratio 16:9, so the width is \( 55 \times 16 / \sqrt{16^2 + 9^2} \approx 47.9 \) inches and the height about 27.0 inches.
  • Building: builders check a corner is square with the 3-4-5 rule: mark 3 m along one wall and 4 m along the other; the diagonal should be exactly 5 m.

Step-by-step method

  1. Identify the right angle and the hypotenuse (the side opposite it, always the longest).
  2. For the hypotenuse: square both legs, add, take the square root.
  3. For a leg: square the hypotenuse, subtract the other leg squared, take the square root.
  4. Check the answer: the hypotenuse must be longer than either leg.

Why the theorem is true

Arrange four copies of the right triangle inside a large square of side \( a + b \), with their hypotenuses forming a tilted square in the middle. The large square’s area can be counted two ways:

$$(a + b)^2 = c^2 + 4 \cdot \tfrac{1}{2}ab$$

Expanding the left side gives \( a^2 + 2ab + b^2 = c^2 + 2ab \), and subtracting \( 2ab \) from both sides leaves \( a^2 + b^2 = c^2 \).

Pythagoras and trigonometry

For a right triangle with hypotenuse 1, the legs are \( \cos\theta \) and \( \sin\theta \). Thus, the pythagorean theorem calculator identity is \( \sin^2\theta + \cos^2\theta = 1 \). This is the starting point for most trig identities and for the unit circle.

The Pyramids of Giza at sunset in a desert landscape.

Common mistakes to avoid

  • Adding instead of subtracting for a missing leg: the leg is \( \sqrt{c^2 - b^2} \), never \( \sqrt{c^2 + b^2} \).
  • Using it on a triangle that is not right-angled. For other triangles, use the law of cosines, \( c^2 = a^2 + b^2 - 2ab\cos C \), which reduces to Pythagoras when \( C = 90° \).
  • Mixing units, such as one side in metres and another in centimetres.

Generating your own triples

For whole numbers \( m > n > 0 \), Euclid’s formula gives a Pythagorean triple: \( a = m^2 - n^2 \), \( b = 2mn \), \( c = m^2 + n^2 \). With \( m = 3, n = 2 \) you get 5, 12, 13. With \( m = 4, n = 1 \) you get 15, 8, 17. Multiplying any triple by a whole number gives another. So 3-4-5 also gives 6-8-10 and 9-12-15. Use a pythagorean theorem calculator for these calculations.

A smiling woman standing next to a whiteboard with some writing on it.

Practice problems

  1. Legs 8 and 15: find the hypotenuse.
  2. Hypotenuse 26, one leg 10: find the other leg.
  3. Is a triangle with sides 6, 7 and 10 right, acute or obtuse?

Answers: 1. \( \sqrt{64 + 225} = 17 \). 2. \( \sqrt{676 - 100} = 24 \). 3. \( 36 + 49 = 85 < 100 \), so obtuse.

Using the Calculator Step-by-Step

This Pythagorean theorem calculator simplifies finding triangle sides. First, identify your knowns. Determine which sides you have and which you need to find. Remember, 'c' always represents the hypotenuse, the longest side.

Next, input your values. The calculator provides three input fields: 'a', 'b', and 'c'. Enter the lengths of the two sides you know into their respective boxes. Leave the field for the unknown side completely blank.

Then, initiate the calculation. Locate and click the 'Solve' button. The calculator will instantly process your input. It then displays the missing side's length, along with other triangle properties.

Finally, review the output. The result for the missing side appears both as an exact simplified square root and a decimal approximation. Also, observe the calculated angles, area, and perimeter. This comprehensive output helps in understanding the entire triangle.

Checking Your Calculator Results

After using the Pythagorean theorem calculator, always verify the output. A quick check confirms the results make sense. First, ensure the hypotenuse (c) is the longest side. If you found a leg, it must be shorter than the hypotenuse.

Next, consider general magnitudes. Small number inputs expect small results. Large inputs should yield larger outputs. Wildly different scales might signal an input error. For instance, a hypotenuse of 10 for legs 3 and 4 is clearly incorrect in a pythagorean theorem calculator.

Also, look at the angles. The calculator provides the two acute angles. Their sum should be close to 90 degrees. This provides an additional confirmation for your right triangle solution. Small discrepancies might occur due to rounding.

Finally, if possible, perform a mental check. For common Pythagorean triples like 3-4-5 or 5-12-13, you can quickly confirm the answer. For example, if legs are 8 and 15, the hypotenuse should be 17. These checks build confidence in the calculator's accuracy.

Related guides

Further reading

FAQ

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: ( a^2 + b^2 = c^2 ).

How do I find the hypotenuse?

( c = sqrt{a^2 + b^2} ).

How do I find a missing leg?

( a = sqrt{c^2 – b^2} ).

Does it work for any triangle?

Only for right triangles. For others, use the law of cosines.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators