Home ›
Math › Pythagorean Theorem Calculator
· 🌐 EN / DE Pythagorean Theorem Calculator
Enter any two sides of a right triangle and this calculator solves the third using a² + b² = c².
Example
A ladder leans against a wall. Its base is 3 m from the wall (leg a) and it reaches 4 m up the wall (leg b). How long is the ladder (hypotenuse c)?
a = 3, b = 4
c = √(a² + b²)
c = √(3² + 4²)
c = √(9 + 16)
c = √25
c = 5 m
Solving in reverse: if c = 5 and a = 3, then b = √(5² − 3²) = √(25 − 9) = √16 = 4.
How it works
Choose which side to solve for, type the two known values, and the result updates live. Hypotenuse c must always be the longest side, so each leg must be shorter than c.
Good to know
This Pythagorean Theorem Calculator solves a right triangle from any two of its three sides using the relationship a² + b² = c². You pick whether you want to find the hypotenuse c or one of the legs (a or b), type in the two values you already know, and the missing side appears instantly along with the triangle's area and perimeter. It's aimed at students checking geometry homework, but it's just as handy for anyone working with diagonals, bracing, ramps, screen sizes, or any layout where a right angle is involved.
Reach for it whenever you have a known horizontal and vertical distance and need the straight-line distance between them, or when you have a diagonal and one side and need the other. Typical real-world cases include sizing a ladder against a wall, finding the diagonal of a rectangular room or TV, working out roof rafter lengths, or confirming that a corner is square (the 3-4-5 rule). Because everything runs in your browser, you can use it offline and none of the numbers you enter are sent anywhere.
The big number at the top is the side you chose to solve for, while the stats row repeats all three side lengths plus the computed area (½ × a × b) and perimeter (a + b + c) so you can sanity-check the whole triangle at once. The note line shows the actual substitution, for example c = √(a² + b²) = √(9 + 16) = 5, which is useful for showing your work. Results are rounded to about six decimal places, so a value like 7.071068 is really the irrational √50.
One thing to watch: the hypotenuse must always be the longest side. When you solve for a leg, the hypotenuse you enter has to be strictly greater than the known leg, otherwise c² − leg² would be zero or negative and no real triangle exists, so the tool will ask you to fix the values instead of returning a number.
Frequently asked questions
Which side is the hypotenuse?
The hypotenuse (c) is the side opposite the right angle and is always the longest side of a right triangle. In a² + b² = c², a and b are the two shorter legs that form the right angle, and c is the hypotenuse.
Why do I get an error when solving for a leg?
When solving for a leg, the hypotenuse you enter must be longer than the known leg. If a leg is equal to or longer than the hypotenuse, no real right triangle exists (c² − leg² would be zero or negative), so the calculator asks you to fix the values.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser; nothing is uploaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the Pythagorean theorem formula?
It states that in a right triangle the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². Here c is the side opposite the right angle, and a and b are the two sides that form it.
How do you find the hypotenuse of a right triangle?
Square both legs, add them together, and take the square root of the total: c = √(a² + b²). For example, with legs of 3 and 4, c = √(9 + 16) = √25 = 5.
How do you find a missing leg when you know the hypotenuse?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root: a = √(c² − b²). The hypotenuse must be longer than the known leg for a real answer to exist.
Does the Pythagorean theorem work for all triangles?
No. It applies only to right triangles, meaning triangles that contain a 90-degree angle. For triangles without a right angle you would use the law of cosines instead.
What is a Pythagorean triple?
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13, and 8-15-17. Any multiple of a triple, like 6-8-10, is also a valid triple.
How do you find the diagonal of a rectangle?
Treat the length and width as the two legs of a right triangle and apply the theorem: diagonal = √(length² + width²). For a rectangle 6 by 8, the diagonal is √(36 + 64) = √100 = 10.
Why is the answer a long decimal instead of a whole number?
Most right triangles do not produce whole-number sides, so the result is often an irrational square root shown as a rounded decimal. For instance, legs of 1 and 1 give a hypotenuse of √2, which displays as roughly 1.414214.
What does the 3-4-5 rule mean in construction?
It is a quick way to check or create a square corner: measure 3 units along one edge and 4 along the other, and if the diagonal between those points is exactly 5, the corner is a true right angle. It works because 3, 4, and 5 satisfy the Pythagorean theorem.
Related calculators