Skip to main content
Viva Calculator

Pythagorean Theorem Calculator – Find Triangle Sides

Calculate sides of a right triangle using a² + b² = c²

Calculate Side

Method and source check

Last checked:

Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.

Method

For a right triangle, square and add the legs to find the hypotenuse, or subtract the square of the known leg from the hypotenuse squared to find the missing leg. Reject nonpositive lengths and a hypotenuse no larger than the known leg. Use Math.hypot for the hypotenuse and a factored difference for a leg to avoid unnecessary square overflow.

c² = a² + b²

a = √(c² − b²)

Variables and units

a,b
positive perpendicular leg lengths
c
positive hypotenuse length

Worked example

With legs 3 and 4, c = √(9+16) = 5. With c=13 and b=5, a=12.

Limitations

Displayed side lengths and worked calculation are rounded to six decimal places. When scaling for Math.round would overflow, the finite representable value is retained.

  • Applies only to right triangles.
  • Irrational side lengths are shown approximately.
  • Unsupported derived numerical ranges are rejected with a localized error on a visible form field; the calculations use floating-point arithmetic.
  • 3,4,5 and 5,12,13 are exact right-triangle examples.
  • The hypotenuse must be longer than either leg.
  • A 3e154 by 4e154 right-angle displacement yields a finite 5e154 length.

Sources

How to Use

  1. Select which side you want to solve for
  2. Enter the two known side lengths
  3. View the step-by-step calculation

Calculate sides of a right triangle using a² + b² = c²

Calculate any side of a right triangle using the Pythagorean theorem. Method: For a right triangle, square and add the legs to find the hypotenuse, or subtract the square of the known leg from the hypotenuse squared to find the missing leg. Reject nonpositive lengths and a hypotenuse no larger than the known leg.

The formula is expressed as: a² + b² = c², where c is the hypotenuse and a and b are the other two sides (legs) of the right triangle.

How to Use the Pythagorean Theorem

Depending on which side you need to find, you can rearrange the formula:

  • To find the hypotenuse: c = √(a² + b²)
  • To find side a: a = √(c² - b²)
  • To find side b: b = √(c² - a²)

Practical Examples

Example 1: A right triangle has legs of 3 and 4 units. Find the hypotenuse.

c = √(3² + 4²) = √(9 + 16) = √25 = 5 units

Example 2: A right triangle has a hypotenuse of 13 and one leg of 5. Find the other leg.

a = √(13² - 5²) = √(169 - 25) = √144 = 12 units

Worked scenario

  • Right-angle measurement: a=3, b=4 → c=√(9+16)=5.

Method, example, rounding, and limits

Method: For a right triangle, square and add the legs to find the hypotenuse, or subtract the square of the known leg from the hypotenuse squared to find the missing leg. Reject nonpositive lengths and a hypotenuse no larger than the known leg.

Worked example: a=3, b=4 → c=5; c=13, b=5 → a=12.

Rounding: 6 decimal places. Displayed values are rounded as stated beside the result.

Limit: Applies only to right triangles.

Reference: OpenStax. https://openstax.org/books/contemporary-mathematics/pages/10-key-concepts

Frequently Asked Questions

What is the Pythagorean theorem formula?
The Pythagorean theorem formula is a² + b² = c², where a and b are the two legs of a right triangle and c is the hypotenuse (the longest side, opposite the right angle).
Can I use this calculator for non-right triangles?
No, the Pythagorean theorem only applies to right triangles. For other triangles, you would need to use the Law of Cosines or Law of Sines.
What are Pythagorean triples?
Pythagorean triples are sets of three positive integers that satisfy the Pythagorean theorem. Common examples include (3, 4, 5), (5, 12, 13), and (8, 15, 17).
Why must the hypotenuse be larger than the other sides?
In a right triangle, the hypotenuse is always the longest side because it's opposite the largest angle (90°). If the hypotenuse were smaller, the triangle couldn't exist.