Percentages and Math

Pythagorean Theorem Calculator

Enter two sides of a right triangle to find the third, along with area, perimeter and angles.

Your numbers

Find

Result

Hypotenuse c

5

a^2 + b^2 = c^2

Leg a
3
Leg b
4
Hypotenuse c
5
Area
6
Perimeter
12
Angle A (opposite a)
36.86989765 degrees
Angle B (opposite b)
53.13010235 degrees
Right angle C
90 degrees
How this was calculated
  1. c = sqrt(a^2 + b^2) = sqrt(3^2 + 4^2) = sqrt(25) = 5.
  2. Area = a x b / 2 = 3 x 4 / 2 = 6. Perimeter = a + b + c = 12.
  3. Angle A (opposite a) = arctan(a / b) = 36.86989765 degrees. Angle B = 90 - A = 53.13010235 degrees.
  • 3, 4, 5 is a Pythagorean triple: all three sides are whole numbers.

Next step

How to use the pythagorean theorem calculator

  1. Choose which side to find: the hypotenuse c, leg a or leg b.
  2. Enter the two sides you know. Use the same unit for both.
  3. Read the missing side, the area, the perimeter and the two acute angles. Open the steps to see the substitution.

Formula

a^2 + b^2 = c^2

c = sqrt(a^2 + b^2), a = sqrt(c^2 - b^2), b = sqrt(c^2 - a^2)

Area = a x b / 2, Angle A = arctan(a / b)

Leg a is opposite angle A and leg b is opposite angle B. The hypotenuse c is opposite the right angle and is always the longest side.

Worked examples

Legs 3 and 4: c = sqrt(9 + 16) = sqrt(25) = 5. The area is 3 x 4 / 2 = 6 and the perimeter is 12. Angle A is arctan(3/4) = 36.8699 degrees and angle B is 53.1301 degrees.

Hypotenuse 13 and leg 12: a = sqrt(169 - 144) = sqrt(25) = 5.

Legs 1 and 1: c = sqrt(2) = 1.414213562, and both acute angles are 45 degrees.

Hypotenuse 5 and leg 6: this is impossible, because the hypotenuse must be longer than either leg. The tool asks you to check the numbers.

Pythagorean triples

A triple is a set of three whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13 or 8, 15, 17. Multiples of a triple also work, so 6, 8, 10 is another. When your sides form a triple the tool points it out, which is handy for squaring up a building frame with the 3-4-5 method.

Validation for real triangles

Every side must be a positive number. When you solve for a leg, the hypotenuse has to be longer than the known leg, otherwise no right triangle exists and the square root would be of a negative number. The missing leg is computed from (c - b)(c + b), which keeps accuracy when c and b are close in size.

Using the angles and area

The acute angles come from the inverse tangent of the two legs, and they always add to 90 degrees. For areas of other shapes, including triangles given three sides, use the area calculator. If your problem becomes a quadratic equation, the quadratic equation solver can finish it.

Assumptions and limits

  • The triangle has a right angle. The theorem does not apply to other triangles.
  • Both known sides must use the same unit, and the answer is in that unit.
  • Values up to 1e15 are accepted. Results show 10 significant digits.
  • Angles are in degrees and rounded only for display.
  • Calculations run in your browser and nothing is sent anywhere.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the square of the longest side equals the sum of the squares of the other two sides. It lets you find any side when you know the other two.

How do I find the hypotenuse?

Square both legs, add them, and take the square root. For legs of 6 and 8, 36 + 64 is 100, and the square root is 10.

Can the hypotenuse be shorter than a leg?

No. It is opposite the largest angle, 90 degrees, so it is always the longest side. The tool rejects values that break this rule.

What is the 3-4-5 rule used for?

Builders use it to check for a square corner. If one side measures 3 units, the other 4 and the diagonal exactly 5, the corner is a right angle.

Why does the calculator show angles?

Once the three sides are known, the angles follow from trigonometry. They are useful for roof pitch, ramps and ladder placement.