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.

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.

Real-World Uses

The Pythagorean theorem, a2 + b2 = c2, is one of the few pieces of school geometry that shows up constantly outside school. A mover checks whether a couch fits diagonally through a doorway using exactly this formula. A framer squares a wall by measuring 3 feet along one edge, 4 feet along the other, and confirming the diagonal is 5 feet. A TV size in inches is measured along its diagonal, which is the hypotenuse of the right triangle formed by the screen's height and width.

How It's Calculated

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's page on the Pythagorean theorem.

Reference: 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

Common Mistakes to Avoid

The theorem only applies to right triangles, so it cannot be used directly on an acute or obtuse triangle without first checking for a 90-degree angle. Another frequent slip is subtracting the legs instead of the squares: a = sqrt(c^2 - b^2) requires squaring first and subtracting second, not the reverse. Watch the units too; mixing feet and inches in the same calculation will square the error along with the numbers.

Nearby geometry tools

A right triangle with an angle instead of two sides needs a slightly different setup.

On this page

Pythagorean theorem calculator FAQs

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.

Marcus Vance
About the author
Marcus Vance
Contributing Writer, Technology & Data, Encore Editorial

Marcus Vance spent a decade building data pipelines and testing calculation logic before he started writing about the math behind the tools. On MathCalcTools he checks every formula against the source math, then writes out the steps so a reader can follow the same path a calculator takes.