Formula

Pythagorean theorem

Also written: a squared plus b squared equals c squared · pythagoras · hypotenuse formula

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

In a right triangle, the squares of the two shorter sides add to the square of the longest. The letter c is always the hypotenuse.

What each part means

a,ba, b
the legs — the two sides meeting at the right angle
cc
the hypotenuse, opposite the right angle and always the longest side

Pythagorean theorem calculator

Choose the side to find and enter the other two to use a2+b2=c2a^2 + b^2 = c^2 on a right triangle. The answer stays exact (such as 525\sqrt{2}), with the decimal beside it, and whole-number answers are recognized as Pythagorean triples.

The steps below find the hypotenuse of a right triangle with legs 3 and 4, using a2+b2=c2a^2 + b^2 = c^2. Turn on JavaScript to try your own sides.

Worked example: a=3,b=4

The hypotenuse is c = 5, and 3, 4, 5 is a Pythagorean triple.

A right triangle with legs 3 and 4 Shows a right triangle with a horizontal leg a = 3, a vertical leg b = 4, a right-angle mark between them, and the sloping hypotenuse c = 5. a = 3 b = 4 c = 5
A right triangle with legs 3 and 4

Name the sides

The picture shows a right triangle with the legs a and b meeting at the right angle and the hypotenuse c across from it. The sides you know are a = 3 and b = 4, and c is the side to find.

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

a2+b2=c2

Add the squares to find the hypotenuse

c=a2+b2

Square each leg and add

c2=32+42=9+16=25

Take the square root

c=25=5

Check

The squares of the legs must add up to the square of the hypotenuse.

32+42=9+16=25=52

A Pythagorean triple

3, 4, 5 is a Pythagorean triple: all three sides are whole numbers that satisfy a² + b² = c².

Runs on your device: nothing you type is sent or saved. Want to know why it works? Read the Pythagorean theorem lesson, or see square roots for the last step.

When to use it

A right triangle has two known sides and one missing. Also for the distance between two points, and for checking whether a corner is square.

It is a statement about areas

Draw a real square on each side of the triangle. The theorem says the two smaller squares hold exactly as much area as the big one.

9⏟3×3+16⏟4×4=25⏟5×5\underbrace{9}_{3\times3} + \underbrace{16}_{4\times4} = \underbrace{25}_{5\times5}

That is a claim about area, not lengths — 3+4≠53 + 4 \ne 5, and was never meant to. Only after squaring do the sides fit together.

Which side is c

Always the hypotenuse: opposite the right angle, and always the longest side.

The practical test is size. If one known side is longer than the other, it is cc and the calculation subtracts. If both known sides are shorter than the missing one, they are aa and bb and the calculation adds.

You knowYou wantDo
both legsthe hypotenuseadd the squares
hypotenuse and a legthe other legsubtract the squares

Rearranged

c=a2+b2a=c2−b2c = \sqrt{a^2 + b^2} \qquad a = \sqrt{c^2 - b^2}

Do not forget the square root. The theorem gives the square of the side, and one step always remains.

Triples worth recognizing

TripleCheck
3,4,53, 4, 59+16=259 + 16 = 25
5,12,135, 12, 1325+144=16925 + 144 = 169
8,15,178, 15, 1764+225=28964 + 225 = 289
7,24,257, 24, 2549+576=62549 + 576 = 625

Any multiple of a triple is another triple — 6,8,106, 8, 10 and 9,12,159, 12, 15 are the 3,4,53, 4, 5 triangle scaled. Scaling multiplies every side alike, so the relationship survives.

The converse is true too

If a triangle’s sides satisfy a2+b2=c2a^2 + b^2 = c^2, the triangle must be right-angled. That is how a builder checks a corner: measure 33 along one wall, 44 along the other, and confirm the diagonal is exactly 55.

The signature error

Adding when you should subtract gives a leg longer than the hypotenuse, which is impossible for a right triangle. The answer fails on inspection, before any arithmetic is rechecked. See the Pythagorean theorem.

Lessons that teach this

Related