How do you solve the Pythagorean theorem?

Square the two sides you know, add them for the hypotenuse or subtract for a leg, then take the square root. For legs 3 and 4: 9 + 16 = 25, and √25 = 5.

By Mateo Díaz · Last updated: July 19, 2026

Pythagorean theorem calculator

Quick triples

Tap a side to solve for it - the dashed side is the one being calculated.

Hypotenuse c
5
Perimeter
12
Area
6
Angle opposite leg a
36.87°
Angle opposite leg b
53.13°

c = √(3² + 4²) = √25 = 5

The full answer

The three steps

  1. Write the formula a2+b2=c2a^2+b^2=c^2 and substitute the two sides you know.
  2. Square them, then add if you are finding the hypotenuse or subtract if you are finding a leg.
  3. Take the square root of the result.

Finding the hypotenuse from legs 3 and 4:

c=32+42=9+16=25=5c=\sqrt{3^2+4^2}=\sqrt{9+16}=\sqrt{25}=5

Finding a leg from hypotenuse 13 and leg 5:

a=132−52=169−25=144=12a=\sqrt{13^2-5^2}=\sqrt{169-25}=\sqrt{144}=12

Which version to use

You knowYou wantDo this
Both legsHypotenuse ccAdd the squares, then root
One leg and the hypotenuseThe other legSubtract the leg square from the hypotenuse square, then root

When subtracting, the hypotenuse square always comes first - it is the longest side, so its square is the biggest number. If your subtraction goes negative, the side you called the hypotenuse is not actually the hypotenuse.

The mistakes that cost marks

MistakeWhy it failsFix
Adding before squaring(3+4)2=49(3+4)^2=49, not 2525Square each side separately, then add
Adding when solving for a legGives a side longer than the hypotenuseSubtract from the hypotenuse square
Mixing unitsFeet on one side, inches on the otherConvert everything to one unit first
Forgetting the square rootLeaves you with c2c^2, not ccThe last step is always the root

When it does not apply

The theorem only works when the triangle has a 90° angle. For any other triangle you need the law of cosines, which adds a correction term for the actual angle.

More questions about the pythagorean theorem calculator