Home / Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Enter any two sides of a right triangle to find the missing side. The calculator solves for the hypotenuse or either leg and shows each step of the working.

Chris Terry
By Chris Terry, Editor
Updated June 20, 2026

Enter two sides

Leave the side you want to find blank. Use any consistent unit (cm, m, ft, in).

Result

Missing side--
Solving for--
Enter two sides and press Calculate.

The Pythagorean theorem formula

a2 + b2 = c2, where a and b are the two legs and c is the hypotenuse of a right triangle.

a^2 + b^2 = c^2

The hypotenuse is always opposite the right angle and is the longest side. Rearranging the formula lets you solve for any side:

Worked example: 3-4-5 triangle

The 3-4-5 triangle is the most common Pythagorean triple. Here is how to confirm it from scratch.

Given: a = 3, b = 4. Find c.
Step 1. Square both legs: 3^2 = 9 and 4^2 = 16.
Step 2. Add the squares: 9 + 16 = 25.
Step 3. Take the square root: sqrt(25) = 5.
Result: c = 5. The hypotenuse is 5 units.

A right triangle with legs 3 and 4 always has a hypotenuse of 5, no matter the unit. Scale it up: a = 6, b = 8 gives c = 10.

For the history and proof of the theorem, see Wolfram MathWorld on the Pythagorean theorem.

Common Pythagorean triples

Pythagorean triples are sets of whole numbers that satisfy a^2 + b^2 = c^2. The most useful ones to memorize:

abc
345
51213
81517
72425

More free math tools

Find the slope of a line, solve a quadratic, or compute a square root.

Good to know

Frequently asked questions

How do you solve the Pythagorean theorem?

Square both known sides, then add or subtract. To find the hypotenuse c, use c = sqrt(a^2 + b^2). To find a missing leg a, use a = sqrt(c^2 - b^2). The calculator handles all three cases automatically.

What is the basic formula of Pythagoras theorem?

The formula is a^2 + b^2 = c^2, where a and b are the two shorter sides (legs) of a right triangle, and c is the longest side (hypotenuse) opposite the right angle.

Can you do the Pythagorean theorem on a calculator?

Yes. Enter any two sides and this calculator solves for the third. It shows the substituted formula and each arithmetic step so you can follow the working.

How do I find the missing leg of a right triangle?

If you know the hypotenuse c and one leg b, the missing leg a = sqrt(c^2 - b^2). For example, with c = 13 and b = 5: a = sqrt(169 - 25) = sqrt(144) = 12.

Chris Terry
About the author
Chris Terry
Editor, Encore Editorial

Editor at Encore Editorial, Chris Terry sets the editorial standards here and turns dense topics into plain English. He has written widely on education, finance, and consumer markets.