Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Pythagorean Theorem Calculator

Enter two sides of a right triangle to find the third with the Pythagorean theorem. The answer is kept exact when it is a square root, and the area, perimeter and acute angles follow automatically.

Examples

About the Pythagorean Theorem Calculator

The Pythagorean theorem is one of the first results in geometry that students use constantly: for ladders leaning on walls, diagonals of screens and rooms, distances on a coordinate grid, the length of a ramp or the shortest path across a park. Whenever a right angle appears, two known sides determine the third.

This calculator solves both versions of the problem. Give the two legs to find the hypotenuse, or give one leg and the hypotenuse to find the other leg. The square root is simplified exactly, so 8\sqrt{8} becomes 222\sqrt{2} and a whole-number answer is recognised as a Pythagorean triple. The steps show the squaring and adding, and the result also lists the area, perimeter and the two acute angles in degrees.

What is the Pythagorean theorem?

In a right triangle, the side opposite the right angle is the hypotenuse cc, and the two sides that form the right angle are the legs aa and bb. The Pythagorean theorem states that a2+b2=c2a^2 + b^2 = c^2: the area of the square built on the hypotenuse equals the combined areas of the squares built on the legs.

The converse is also true and just as useful. If three lengths satisfy a2+b2=c2a^2 + b^2 = c^2, the triangle they form has a right angle opposite cc. Builders use this with a 3-4-5 rope to set out square corners, and it is a quick way to test whether a triangle given by its sides is right-angled, acute (a2+b2>c2a^2 + b^2 > c^2) or obtuse (a2+b2<c2a^2 + b^2 < c^2).

How to use the Pythagorean Theorem Calculator

  1. Choose whether you want the hypotenuse or a missing leg.
  2. To find the hypotenuse, enter legs aa and bb.
  3. To find a leg, enter the known leg aa and the hypotenuse cc, which must be the longer of the two.
  4. Press Solve triangle to see the squares, the sum or difference, and the square root.
  5. Read the exact length, its decimal value, and the area, perimeter and angles below it.

Formulas

Pythagorean theorem

a2+b2=c2a^2 + b^2 = c^2

Hypotenuse

c=a2+b2c = \sqrt{a^2 + b^2}

Missing leg

b=c2−a2b = \sqrt{c^2 - a^2}

Area of a right triangle

Area=12ab\text{Area} = \tfrac12 ab

The two legs act as base and height because they are perpendicular.

Acute angle

tan⁡A=ab\tan A = \frac{a}{b}

Worked example: Legs 3 and 4

The worked example uses legs a=3a = 3 and b=4b = 4. Squaring gives 99 and 1616, which add to 2525, so c=25=5c = \sqrt{25} = 5. Because all three sides are whole numbers, (3,4,5)(3, 4, 5) is a Pythagorean triple.

The area is 12⋅3⋅4=6\frac12 \cdot 3 \cdot 4 = 6, the perimeter is 3+4+5=123 + 4 + 5 = 12, and the acute angles are arctan⁡34≈36.87°\arctan\frac34 \approx 36.87° and arctan⁡43≈53.13°\arctan\frac43 \approx 53.13°, which add with the right angle to 180°180°.

The solution below is generated by the same engine that powers the calculator above.

Final answer

c=5c = 5

How we read your problem

Find the hypotenuse of a right triangle from its two legs.

a=3, b=4, c=?a = 3,\ b = 4,\ c = ?

Step-by-step solution

  1. Write the Pythagorean theorem

    The hypotenuse c is the side opposite the right angle and is always the longest side.

    c2=a2+b2c^2 = a^2 + b^2
  2. Substitute the legs and square them

    c2=32+42=9+16=25c^2 = 3^2 + 4^2 = 9 + 16 = 25
  3. Take the positive square root

    Lengths are positive, so only the positive root is used.

    c=25=5c = \sqrt{25} = 5
  4. Area and perimeter

    Area=12ab≈6,P=a+b+c≈12\text{Area} = \tfrac12ab \approx 6,\qquad P = a + b + c \approx 12
  5. Acute angles

    Angle A is opposite leg a and angle B is opposite leg b; the right angle C is 90°.

    ∠A=arctan⁡ab≈36.869898∘,∠B=90∘−∠A≈53.130102∘\angle A = \arctan\frac{a}{b} \approx 36.869898^\circ,\qquad \angle B = 90^\circ - \angle A \approx 53.130102^\circ

Formulas used

  • Pythagorean theorem

    a2+b2=c2a^2 + b^2 = c^2
  • Missing leg

    b=c2−a2b = \sqrt{c^2 - a^2}
  • Area

    Area=12ab\text{Area} = \tfrac12 ab

In every right triangle the square on the hypotenuse equals the sum of the squares on the two legs. Knowing any two sides fixes the third, and the angles follow from the tangent ratio.

Verification

  • Check: a² + b² = 25 and c² = 25, which agree.
  • (3, 4, 5) is a Pythagorean triple: all three sides are whole numbers.
  • Angle sum: 90° + 36.869898° + 53.130102° = 180°.

Detailed explanation

Finding the hypotenuse

Square each leg, add the squares, and take the square root. For legs 1 and 1 the sum is 2, so the hypotenuse is 2≈1.414\sqrt{2} \approx 1.414, the diagonal of a unit square. For legs 2.5 and 6 the sum is 6.25+36=42.256.25 + 36 = 42.25, so the hypotenuse is exactly 6.56.5.

The hypotenuse is always longer than either leg but shorter than their sum. If your answer breaks either rule, a value has been squared or added incorrectly. A common slip is adding the legs first and then squaring, which gives (3+4)2=49(3 + 4)^2 = 49 instead of 2525.

Finding a missing leg

Subtract the square of the known leg from the square of the hypotenuse, then take the square root. With leg 5 and hypotenuse 13, 169−25=144169 - 25 = 144 and the missing leg is 1212, another well-known triple. With leg 7 and hypotenuse 10, 100−49=51100 - 49 = 51, and since 51 has no square factor the answer stays as 51≈7.141\sqrt{51} \approx 7.141.

Subtraction is the step people most often get backwards. The hypotenuse is the longest side, so its square comes first. If the leg you enter is not shorter than the hypotenuse, the calculator stops and explains why, because no right triangle has a leg at least as long as its hypotenuse.

Simplified radicals and Pythagorean triples

When the answer is not a whole number, it is simplified by pulling square factors out of the root, for example 72=62\sqrt{72} = 6\sqrt{2}, and a decimal approximation is shown alongside. Teachers often expect the exact radical, while practical measurements need the decimal, so both are provided.

Triples such as (3,4,5)(3, 4, 5), (5,12,13)(5, 12, 13), (8,15,17)(8, 15, 17) and (7,24,25)(7, 24, 25) appear in many exercises, and any multiple of a triple is also a triple, such as (6,8,10)(6, 8, 10). Spotting one saves time, and the calculator flags it when all three sides come out as whole numbers.

Common mistakes

  • Treating the longest side as a leg instead of the hypotenuse.
  • Adding the legs before squaring rather than squaring each leg first.
  • Adding the squares when looking for a leg; a missing leg needs c2−a2c^2 - a^2.
  • Using the theorem on a triangle that has no right angle; use the law of cosines instead.
  • Rounding the hypotenuse early and then using the rounded value to compute angles or area.

Tips

  • Sketch the triangle and mark the right angle before deciding which side is cc.
  • Mixed units must be converted first, for example feet and inches both to inches.
  • On a coordinate grid, the horizontal and vertical differences are the legs; this is exactly the distance formula.
  • Learn the first few triples so you can check answers mentally.
  • For three-dimensional diagonals, apply the theorem twice: d=a2+b2+c2d = \sqrt{a^2 + b^2 + c^2} for a box.

Frequently asked questions

How do you find the hypotenuse of a right triangle?

Square the two legs, add the results, and take the square root: c = √(a² + b²). For legs 6 and 8 that is √(36 + 64) = √100 = 10.

How do you find a missing leg with the Pythagorean theorem?

Subtract the square of the known leg from the square of the hypotenuse and take the square root: b = √(c² − a²). For example, with a = 8 and c = 17, b = √(289 − 64) = √225 = 15.

What is a Pythagorean triple?

A set of three whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13. Multiplying every number of a triple by the same whole number gives another triple, for example 9, 12, 15.

Does the Pythagorean theorem work for every triangle?

No. It holds only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab cos C, which reduces to the Pythagorean theorem when C is 90°.

How can I check whether a triangle is a right triangle?

Square the three sides and compare the largest square with the sum of the other two. If they are equal, the triangle has a right angle; if the largest square is smaller the triangle is acute, and if it is larger the triangle is obtuse.

Why is the answer shown as a square root?

When a² + b² is not a perfect square, the exact length is irrational. The calculator simplifies the radical, for example √50 = 5√2, and also shows a decimal so you can use whichever form your task needs.

How are the angles of the right triangle found?

The tangent of angle A equals the opposite leg over the adjacent leg, so A = arctan(a/b). The other acute angle is 90° minus A, because the three angles of any triangle add to 180°.

Solve your right triangle

Enter two sides above to get the third side exactly, together with the area, perimeter and both acute angles.

More math calculators