Skip to content
CalcTide logo
Education & Math

Pythagorean Theorem Calculator

A right triangle with legs of 3 and 4 has a hypotenuse of 5. This Pythagorean theorem calculator solves any right triangle using the relationship a squared plus b squared equals c squared, where a and b are the two legs that meet at the right angle and c is the hypotenuse across from it. Choose hypotenuse mode to enter the two legs and find the longest side, or choose leg mode to enter the hypotenuse and one known leg and find the leg that is missing. Along with the side you are solving for, the tool returns the triangle area and its perimeter, so a single calculation gives you the full shape rather than just one number. Every result is rounded to four decimal places, which is precise enough for homework, construction layout, and quick design checks while still staying readable. Enter your known measurements in any consistent unit, feet, meters, inches, or plain numbers, and read the answer in that same unit.

Education & MathBy

Quick answer

The Pythagorean theorem says a squared plus b squared equals c squared for any right triangle, where c is the hypotenuse.

What this tells you

  • The Pythagorean theorem says a squared plus b squared equals c squared for any right triangle, where c is the hypotenuse.
  • The hypotenuse is always the longest side and always sits opposite the 90 degree angle.
  • To find the hypotenuse, add the squares of the two legs and take the square root of the total.
  • To find a missing leg, subtract the square of the known leg from the square of the hypotenuse, then take the square root.
  • The theorem only works on right triangles, so one angle must be exactly 90 degrees for the answer to be valid.
  • This tool also returns area as one half times the two legs and perimeter as the sum of all three sides.

How to Use

  1. 11. Pick a mode. Choose Find hypotenuse when you know both legs, or Find a leg when you know the hypotenuse and one leg.
  2. 22. Enter your first known value. In hypotenuse mode this is leg a, and in leg mode this is the hypotenuse c.
  3. 33. Enter your second known value. In hypotenuse mode this is leg b, and in leg mode this is the known leg a.
  4. 44. Keep your units consistent. Use the same unit for every side, since the calculator returns its answer in that same unit.
  5. 55. Read the results. The primary result is the side you solved for, and the secondary values show the triangle area and perimeter.

How It Works

Formula

a² + b² = c² → c = √(a² + b²), b = √(c² - a²)

The Pythagorean theorem links the three sides of a right triangle. The two shorter sides, called legs, are labeled a and b, and the longest side, opposite the right angle, is the hypotenuse c. Squaring each leg and adding the results gives the square of the hypotenuse, so c equals the square root of a squared plus b squared. Rearranging the same equation lets you solve for a missing leg instead. If you know the hypotenuse and one leg, the other leg equals the square root of the hypotenuse squared minus the known leg squared. Because a real triangle cannot have a leg longer than its hypotenuse, leg mode requires the hypotenuse to be strictly greater than the known leg. Area is computed as one half the product of the two legs, and perimeter is the sum of all three sides.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

The classic 3-4-5 triangle

ModeFind hypotenuse
A3
B4
Resultc = 5, area = 6, perimeter = 12

Squaring the legs gives 9 and 16, which add to 25. The square root of 25 is exactly 5, so the hypotenuse is 5. The area is one half times 3 times 4, which is 6, and the perimeter is 3 plus 4 plus 5, which is 12. This 3-4-5 set is the most familiar Pythagorean triple.

A 5-12-13 triangle

ModeFind hypotenuse
A5
B12
Resultc = 13, area = 30, perimeter = 30

The squares of 5 and 12 are 25 and 144, which sum to 169. The square root of 169 is 13, another whole-number hypotenuse. The area works out to one half times 5 times 12, which is 30, and by coincidence the perimeter of 5 plus 12 plus 13 is also 30.

Finding a missing leg

ModeFind a leg
C10
A6
Resultb = 8, area = 24, perimeter = 24

With a hypotenuse of 10 and one leg of 6, subtract 36 from 100 to get 64. The square root of 64 is 8, so the missing leg is 8. That produces a 6-8-10 triangle, which is the 3-4-5 triple scaled by two, with an area of 24 and a perimeter of 24.

A non-integer answer

ModeFind hypotenuse
A1
B1
Resultc = 1.4142, area = 0.5, perimeter = 3.4142

Two legs of length 1 give squares that add to 2, and the square root of 2 is about 1.4142. This is the diagonal of a unit square, an irrational number that the calculator rounds to four decimals. The area is one half, and the perimeter is 1 plus 1 plus 1.4142.

Common Pythagorean Triples

Whole-number right triangles where the two legs and the hypotenuse are all integers.

Leg aLeg bHypotenuse cNotes
345The base triple most people learn first
6810The 3-4-5 triple scaled by two
51213A common triple in geometry problems
81517Larger triple used in construction checks
72425A steep, narrow right triangle
91215The 3-4-5 triple scaled by three
202129A near-isosceles right triangle

Any multiple of a Pythagorean triple is also a triple, so 3-4-5 scales up to 6-8-10, 9-12-15, and beyond. These sets are handy for checking that a corner is square without a protractor.

Where the Pythagorean theorem shows up in real life

The Pythagorean theorem is one of the most widely used results in all of mathematics, and its reach goes far beyond the geometry classroom. Builders and carpenters use the 3-4-5 rule to confirm that a wall corner or a foundation is truly square. By measuring 3 units along one edge, 4 units along the other, and checking that the diagonal between those marks is exactly 5 units, they verify a perfect right angle without any special equipment.

The theorem is also the foundation of the distance formula used in coordinate geometry. The straight-line distance between two points is just the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps between them. That same idea powers navigation, computer graphics, and physics, anywhere you need the shortest path between two positions on a plane.

In everyday problem solving, the theorem answers practical questions such as how long a ladder must be to reach a given window height, whether a television will fit a diagonal measurement, or how much cable is needed to run from a rooftop anchor to a ground stake. Any time a right angle appears between two known measurements, the third side is one calculation away.

Measure straight-line distance with the distance formula calculator

Common mistakes

  • Mixing up which side is the hypotenuse. The hypotenuse is always the longest side and sits opposite the right angle, so never use it as a leg when adding squares.
  • Adding the sides instead of adding their squares. The theorem uses a squared plus b squared, not a plus b, so squaring each side before summing is essential.
  • Applying the theorem to a triangle that is not right-angled. The relationship a squared plus b squared equals c squared only holds when one angle is exactly 90 degrees.
  • Entering a leg that is longer than the hypotenuse in leg mode. A leg can never exceed the hypotenuse, so the calculator returns nothing until the hypotenuse is the larger value.
  • Forgetting to take the square root at the end. Adding or subtracting the squares gives c squared or b squared, and you must take the square root to get the actual side length.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="pythagorean-theorem-calculator" async></script>

Preview the embed at /embed/pythagorean-theorem-calculator/.

Frequently Asked Questions

The Pythagorean theorem states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides, written as a squared plus b squared equals c squared. The hypotenuse c is the longest side, opposite the 90 degree angle, and the legs a and b are the two shorter sides that form the right angle.
Find the hypotenuse by squaring each leg, adding those two results, and taking the square root of the total. For example, with legs of 3 and 4, you compute 9 plus 16 to get 25, and the square root of 25 is 5, so the hypotenuse is 5.
Find a missing leg by subtracting the square of the known leg from the square of the hypotenuse, then taking the square root. If the hypotenuse is 10 and one leg is 6, you compute 100 minus 36 to get 64, and the square root of 64 is 8, so the missing leg is 8.
Pythagorean triples are sets of three whole numbers that satisfy a squared plus b squared equals c squared, such as 3-4-5, 5-12-13, and 8-15-17. Any multiple of a triple is also a triple, so 3-4-5 scales up to 6-8-10 and 9-12-15, which makes them useful for quickly checking right angles.
No, the Pythagorean theorem works only on right triangles, meaning triangles with one 90 degree angle. For triangles without a right angle, you need the law of cosines or the law of sines to relate the sides and angles.
You get no result in leg mode when the hypotenuse you entered is not larger than the known leg. Because the hypotenuse is always the longest side of a right triangle, a leg can never be equal to or longer than it, so the calculator requires the hypotenuse to be strictly greater than the leg before it can solve.
It estimates pythagorean theorem calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Education & Math