Pythagorean Theorem Calculator

Hypotenuse (c)5.0000
Triangle area6.0000
Perimeter12.0000
How this was calculated
  1. Hypotenuse c = √(a² + b²) = √(3.00² + 4.00²) = √(25.0000) = 5.0000.
  2. The legs 3.00 and 4.00 enclose an area of 6.0000, and the triangle's perimeter is 12.0000.

A pythagorean theorem calculator solves for the missing side of a right triangle using the relationship a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle. Enter the two known sides and the tool returns the third side instantly. For example, legs 3 and 4 give a hypotenuse of exactly 5, the well-known 3-4-5 triple. With a leg of 6 and a hypotenuse of 10, the missing leg is exactly 8, the same triple scaled by two. Legs 5 and 12 give a hypotenuse of exactly 13. To find a leg instead of the hypotenuse, the formula rearranges to b = sqrt(c^2 - a^2), and the hypotenuse must be longer than either leg, or no such triangle exists.

The Pythagorean theorem is the accepted standard for right-triangle calculations because it is a proven geometric relationship, not an estimate. Its reliability is why builders still check square corners with 3-4-5 measurements today. In fact, Pythagorean triples, whole-number sides like 3-4-5, 5-12-13 and 8-15-17, were used for surveying and construction long before algebra existed. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify every result the calculator produces.

Worked examples

The classic 3-4-5 triangle

√(9 + 16) = 5 exactly — the triple builders have used for millennia. (Hypotenuse from two legs (a and b) · 3 · 4)

Hypotenuse (c)5.0000
Triangle area6.0000
Perimeter12.0000

Finding a leg: a = 6, c = 10

√(100 − 36) = 8 — the same 3-4-5 family, doubled. (Missing leg from leg a and hypotenuse c · 6 · 10)

Missing leg (b)8.0000
Triangle area24.0000
Perimeter24.0000

Legs 5 and 12

√(25 + 144) = 13, another exact Pythagorean triple. (Hypotenuse from two legs (a and b) · 5 · 12)

Hypotenuse (c)13.0000
Triangle area30.0000
Perimeter30.0000

The theorem in one picture's worth of words

The Pythagorean theorem states that in a right triangle, a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle. A pythagorean theorem calculator applies this rule directly, but seeing it worked out by hand makes the idea click. The classic example is the 3-4-5 triple: a triangle with legs of 3 and 4 units. Square the first leg and you get 9. Square the second leg and you get 16. Add those two squares together: 9 + 16 = 25. Take the square root of 25 and you get 5 — the hypotenuse, exactly.

That same triple scales up cleanly. Use a leg of 6 and a hypotenuse of 10, and the missing leg comes out to exactly 8 — the 3-4-5 triple multiplied by two. The 5-12-13 triple works the same way: square 5 to get 25, square 12 to get 144, add them to get 169, and take the square root to land on 13. No rounding, no approximations. These whole-number sides, called Pythagorean triples, were used for surveying and construction long before algebra existed. Builders still check square corners with 3-4-5 measurements today.

When you need a leg rather than the hypotenuse, rearrange the formula: b = sqrt(c^2 - a^2). Subtract the known leg's square from the hypotenuse's square, then take the square root of what remains. One hard rule applies here: the hypotenuse must be longer than either leg, or no such triangle exists. If your given hypotenuse is shorter than the known leg, the equation has no valid answer in real geometry.

Pythagorean triples — whole-number sides like 3-4-5, 5-12-13 and 8-15-17 — show up throughout building and design because they turn the theorem into a quick, tool-free check. A framer who measures 3 feet along one wall and 4 feet along the adjoining one knows the diagonal should read exactly 5 feet when the corner is square. That hands-on test is the same math a calculator runs in the background, just slower and more deliberate.

Finding a missing leg

When you know the hypotenuse and one leg but need the other leg, the Pythagorean theorem can be rearranged to solve for the missing side. Starting from a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle, subtract the known leg squared from the hypotenuse squared, then take the square root. The rearranged formula is b = sqrt(c^2 - a^2). A pythagorean theorem calculator applies this rearrangement automatically, but it helps to understand what the numbers mean before you plug them in.

A clear example shows how the rearranged formula works. Suppose one leg measures 6 and the hypotenuse measures 10. Plug those values into b = sqrt(c^2 - a^2) to get b = sqrt(10^2 - 6^2), which simplifies to b = sqrt(100 - 36), or b = sqrt(64). The missing leg is exactly 8. This result is no coincidence: the sides 6, 8, and 10 are the familiar 3-4-5 triple scaled by two, and the math confirms it cleanly.

The same logic applies to any right triangle, not just those with whole-number sides. If your known leg is 5 and your hypotenuse is 13, the missing leg works out to exactly 12 — the 5-12-13 triple. Whether the sides are integers or decimals, the rearranged formula gives the same reliable answer every time, which is why it remains a staple of geometry, construction, and design.

One important constraint governs this calculation: the hypotenuse must be longer than either leg, or no such triangle exists. If you enter a hypotenuse value that is shorter than the known leg, the expression under the square root becomes negative, and the result is undefined in real numbers. In practical terms, a triangle cannot have its longest side opposite the right angle be shorter than one of the sides forming that angle. Always verify that your hypotenuse value exceeds your leg value before computing the missing side.

If the value you enter as the hypotenuse is shorter than the known leg, the triangle is impossible — no real solution exists. Double-check your measurements before calculating.

Pythagorean triples and the builder's 3-4-5 check

A Pythagorean triple is a right triangle whose three sides are all whole numbers. Because the Pythagorean theorem states that a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle, a triple is any set of integers that satisfies that equation exactly. The smallest and most familiar is 3-4-5: legs of 3 and 4 give a hypotenuse of exactly 5. These triples were used for surveying and construction long before algebra formalized the relationship, and they remain practical today because they let you check a right angle without solving any equation.

The same triple can be scaled up and still work. With a leg of 6 and a hypotenuse of 10, the missing leg is exactly 8 — the same triple scaled by two. Carpenters rely on this when framing walls, laying out foundations, or checking that a corner is truly square. The process is simple: measure 3 feet along one wall from the corner and 4 feet along the other, then check the diagonal between those two marks. If it reads 5 feet, the corner is square. If not, you adjust the framing until it does. Larger versions like 6-8-10 or 9-12-15 cover bigger layouts while using the same idea.

A pythagorean theorem calculator handles these checks instantly, but knowing the common triples by heart speeds up work on a job site where you may not want to stop and type. The table below lists four triples that appear often in textbook problems and real-world measurements. Each row gives the two legs and the resulting hypotenuse, confirming the relationship without any rounding.

If you need to find a leg instead of the hypotenuse, rearrange the theorem: b = sqrt(c^2 - a^2). The hypotenuse must be longer than either leg, or no such triangle exists. This matters when you know the long side and one short side and need the other — for example, checking whether a given diagonal and one wall length produce a clean whole-number leg or whether the measurement is off.

TripleLeg aLeg bHypotenuse c
3-4-5345
5-12-1351213
8-15-1781517
7-24-2572425
Carpenters still use the 3-4-5 method because it needs only a tape measure: mark 3 feet on one wall, 4 feet on the other, and confirm the diagonal between the marks is 5 feet. If it is, the corner is square.

How to use this Pythagorean calculator

Using this pythagorean theorem calculator is straightforward. Start by choosing the mode that matches what you already know. If you have the two legs and need the hypotenuse, select the option for finding the hypotenuse. If you instead know one leg and the hypotenuse, select the option for finding the missing leg. The calculator applies the Pythagorean theorem — in a right triangle, a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle — to solve for whichever side you leave blank.

Next, enter the two known sides in matching units. Both values must use the same unit of length, whether inches, feet, centimeters, or meters. The calculator does not convert between units, so mixing them will give a wrong answer. If your measurements are in different units, convert them yourself before entering the numbers. Once both known sides are entered, the tool returns the missing side along with the triangle's area and perimeter, so you get more than just the one value you were missing.

To find a leg instead of the hypotenuse, the calculator rearranges the theorem to b = sqrt(c^2 - a^2). Keep one rule in mind here: the hypotenuse must be longer than either leg, or no such triangle exists. If you enter a leg that is longer than the hypotenuse, the calculator cannot produce a valid result because the math would require taking the square root of a negative number.

You can check the results against well-known Pythagorean triples. Legs 3 and 4 give a hypotenuse of exactly 5, the classic 3-4-5 triple. With leg 6 and hypotenuse 10, the missing leg is exactly 8 — the same triple scaled by two. Legs 5 and 12 give a hypotenuse of exactly 13, another standard triple. These whole-number sides like 3-4-5, 5-12-13 and 8-15-17 were used for surveying and construction long before algebra. Builders still check square corners with 3-4-5 measurements today, stretching a tape along one wall for 3 units, along the other for 4, and confirming the diagonal reads 5.

Real problems this solves

The Pythagorean theorem states that in a right triangle, a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle. That relationship shows up in more everyday situations than most people realize. A pythagorean theorem calculator turns these real-world geometry questions into quick answers, whether you are shopping for a television, positioning a ladder, or checking a building corner.

TV and screen sizes are sold by their diagonal measurement, which is the hypotenuse of a right triangle formed by the width and height of the screen. If you know the width and height of a space where a television will sit, you can find the maximum diagonal that will fit. The same logic applies to doorways: if you are trying to slide a sofa through a doorway diagonally, the doorway width and height are the legs, and the diagonal clearance is the hypotenuse. Compare that hypotenuse to the sofa depth to see whether the piece will clear the opening.

Ladder reach is another direct application. The distance from the base of a wall to the foot of the ladder is one leg, the height the ladder reaches up the wall is the other leg, and the ladder itself is the hypotenuse. If you place a ladder 6 feet from a wall and the ladder is 10 feet long, the missing leg is exactly 8 feet — the same 3-4-5 triple scaled by two. Roof rafters follow the same pattern: the horizontal run from the wall to the ridge is one leg, the vertical rise is the other, and the rafter length is the hypotenuse. For projects that involve stair stringers and riser heights, our stair calculator handles those layout dimensions directly.

Distance across a rectangular field is a common outdoor use. If you need to cut diagonally from one corner to the opposite corner, the two sides of the rectangle are the legs and the shortcut is the hypotenuse. Legs 5 and 12 give a hypotenuse of exactly 13, the 5-12-13 triple. To find a leg instead of the hypotenuse, rearrange the formula: b = sqrt(c^2 - a^2). The hypotenuse must be longer than either leg, or no such triangle exists. This matters when you know a diagonal distance and one side but need the other side to plan a fence line or a garden bed.

Pythagorean triples — whole-number sides like 3-4-5, 5-12-13 and 8-15-17 — were used for surveying and construction long before algebra. Builders still check square corners with 3-4-5 measurements, laying out three units along one wall, four along the other, and confirming the diagonal measures five. It is a fast way to verify a right angle without any specialized tools.

When the triangle is not right-angled

The Pythagorean theorem applies only to triangles that have a true 90-degree corner. In a right triangle, a^2 + b^2 = c^2, where c is the hypotenuse opposite the right angle. If the angle is not exactly 90 degrees, that equation no longer holds, and a pythagorean theorem calculator will not give you a valid result for the third side.

A quick test can tell you whether a triangle is right-angled. Take the two shorter sides and square each one, then add those squares together. If the sum does not equal the square of the longest side, the angle between the shorter sides is not a right angle. For example, legs 3 and 4 give a hypotenuse of exactly 5, because 3 squared plus 4 squared equals 5 squared. That 3-4-5 triple is the same relationship builders still use to check square corners. If your three sides do not satisfy the equation in this way, you do not have a right triangle.

When the triangle is not right-angled, the tool you need is the law of cosines rather than the Pythagorean theorem. The law of cosines generalizes the theorem to any triangle by including the angle between the two known sides. It reduces to a^2 + b^2 = c^2 only when that angle is 90 degrees, because the cosine of 90 degrees is zero. For every other angle, the cosine is nonzero and changes the result, which is why the Pythagorean equation fails on non-right triangles.

The same logic applies when you try to find a leg instead of the hypotenuse. To solve for a leg, you rearrange the theorem to b = sqrt(c^2 - a^2). The hypotenuse must be longer than either leg, or no such triangle exists. With leg 6 and hypotenuse 10, the missing leg is exactly 8, the same 3-4-5 triple scaled by two. Legs 5 and 12 give a hypotenuse of exactly 13, another whole-number triple. Each of these works because the corner is a true right angle. Without that 90-degree corner, the numbers will not line up, and you need the law of cosines instead.

If a^2 + b^2 does not equal c^2, the triangle is not right-angled. Use the law of cosines instead of the Pythagorean theorem.

FAQs

What is the hypotenuse of a triangle with legs 3 and 4?

The hypotenuse is 5. The theorem states that the hypotenuse equals the square root of the sum of each leg squared. So sqrt(3^2 + 4^2) = sqrt(25) = 5. This is the classic example used to demonstrate how the theorem works with whole numbers.

How do I find a missing leg?

Rearrange the theorem: leg = sqrt(hypotenuse^2 - other leg^2). For example, with hypotenuse 10 and leg 6, the missing leg is sqrt(100 - 36) = 8. Subtract the known leg squared from the hypotenuse squared, then take the square root of the result to get the missing leg.

What is a Pythagorean triple?

Three whole numbers that satisfy the theorem exactly, like 3-4-5, 5-12-13 and 8-15-17. Builders use 3-4-5 to check square corners. These triples give a perfect right triangle with no decimals, making them useful for quick checks in construction and design.

Does the theorem work for any triangle?

Only right-angled triangles. For other triangles you need the law of cosines. The theorem specifically requires one 90-degree angle to function. If a triangle lacks a right angle, the relationship between its sides does not hold and the theorem cannot be applied.

Which side is the hypotenuse?

The longest side, opposite the right angle. It must be longer than either leg — if your 'hypotenuse' is shorter than a leg, the inputs describe an impossible triangle. Always identify the side across from the 90-degree angle as the hypotenuse before doing any calculations.

How do I measure a TV or monitor size?

Screen sizes are the diagonal: for a 16:9 screen the diagonal follows from width and height by this theorem — a 48.4 x 27.2 inch panel is a 55.5-inch class screen. The diagonal is the hypotenuse of a right triangle formed by the width and height of the screen.

Sources

Related calculators

Square Footage Calculator
Area of a rectangle in sq ft, m², sq yd and acres from length × width — with an optional per-square-foot cost estimate.
Exponent Calculator
Any base to any power — whole, negative and fractional exponents — with squares and cubes for reference.
Ratio Calculator
Simplify a ratio, split a total in a given ratio, or solve a proportion for the missing fourth value.
Pythagorean Theorem Calculator
Find the missing side of a right triangle - hypotenuse or leg - from the other two sides, with the square on the missing side and the triangle area.