Pythagorean Theorem Calculator

Hypotenuse · Missing leg · Right-triangle check · Exact radicals · Area, perimeter and angles

100% private, calculates in your browser, no sign-up
The Pythagorean theorem applies to right triangles only. Enter all lengths in the same unit. Results are rounded for display only.
Unit & Precision
Triangle Sides
Fill in any two sides and leave the third empty. If you fill in all three, the calculator sorts them, treats the longest side as the hypotenuse whichever box it is in, and checks whether they form a right triangle. You can type decimals and fractions such as 3 1/2 or 7/8.
Quick picks (legs a and b):
ResultEnter two sides —
Enter two sides of a right triangle to see the third side and what it means.
The triangle is drawn to your measurements. The side being solved is highlighted in amber. Very thin triangles are adjusted slightly so the labels stay readable.
Step-by-Step Working

Pythagorean Theorem Calculator Guide: Hypotenuse, Missing Legs, Triples and Right-Triangle Checks

How to use a² + b² = c² to find any side of a right triangle, check whether three lengths make a right angle, and work in feet, inches or metric units

A Pythagorean theorem calculator finds the missing side of a right triangle when you know the other two. Enter any two sides and it returns the third, along with the exact radical form, the area, the perimeter and both acute angles. Enter all three sides and it tells you whether they form a right triangle. It suits students checking homework, carpenters squaring a frame, and anyone who needs a diagonal, a ladder length or a straight-line distance. The theorem matters because it turns two easy measurements into a third that is hard to measure directly. Use the calculator above in feet, inches, metric units or plain numbers, then read the guide to understand each result.

Quick answer:

In a right triangle, a² + b² = c², where c is the hypotenuse. The hypotenuse is c = √(a² + b²), and a missing leg is √(c² − the other leg²). For legs 3 and 4, c = √25 = 5.

1. How the Pythagorean Theorem Calculator Works

Some people call it a Pythagorean calculator or a Pythagoras theorem calculator, and it also works as a right triangle calculator for any unknown side. It has three side fields: leg a, leg b and the hypotenuse c. Fill in any two and leave the third empty. It squares the known sides, adds or subtracts the squares as needed, and takes the square root. Every number is read as an exact fraction, and the final square root is computed to 24 digits, so results are rounded only when displayed. If the answer is irrational, such as √89, it also shows the exact radical form. It then derives the area, the perimeter and the two acute angles from the three sides.

If you fill in all three sides, the calculator switches to a check. It treats the longest side as c and compares a² + b² with c², which tells you whether the triangle is right, acute or obtuse, and it reports the largest angle. The calculator assumes straight sides and a right angle between the two legs. It cannot find two missing sides at once, because the theorem links only three lengths, and it does not handle triangles without a right angle except in the check.

2. How to Use the Pythagorean Theorem Calculator

  1. Choose a unit: no unit, millimeters, centimeters, meters, inches, feet, or feet and inches.
  2. Enter any two sides. Decimals and fractions such as 3 1/2 or 7/8 are accepted, and the quick picks fill in common legs for you.
  3. Leave the third side empty. The calculator solves for it right away.
  4. To test a triangle, fill in all three sides and read the right-triangle check.
  5. Choose how many decimal places you want, from 0 to 6.
  6. Read the result, the exact form, the area, the perimeter, the angles and the step-by-step working, then copy, share or download the result as a PDF, or reset.

If an entry is unusable, such as a zero, a negative number or a hypotenuse that is not the longest side, the calculator names the field to fix instead of showing a result. Changing the unit converts what you typed, so the triangle itself does not change.

3. Pythagorean Theorem Formula

a² + b² = c² Hypotenuse: c = √(a² + b²) Leg a: a = √(c² − b²) Leg b: b = √(c² − a²) Area = (a × b) ÷ 2 Angle A = arctan(a ÷ b), angle B = 90° − A

Where a and b are the two legs, which meet at the right angle, c is the hypotenuse, which is the longest side and sits opposite the right angle, and A and B are the acute angles opposite a and b. All three lengths must use the same unit. This is the Pythagorean theorem equation that people search for as a squared plus b squared equals c squared.

The relationship is named after Pythagoras, but it was known to earlier cultures such as the Babylonians, and the best-known ancient proof is Euclid's. In Euclid's Elements it is Proposition 47 of Book I, which, as this Michigan Technological University page on Euclid I.47 explains, says that the square on the hypotenuse has the same area as the two squares on the other sides added together. The formulas above are just that statement rearranged to isolate each side.

4. Worked Examples

Example 1: Find the hypotenuse of legs 5 and 8

Inputs: a = 5, b = 8. Formula: c = √(a² + b²). Calculation: c = √(25 + 64) = √89. Result: c ≈ 9.43. Because 89 is prime, the exact form stays √89. The area is (5 × 8) ÷ 2 = 20, and angle A = arctan(5 ÷ 8) ≈ 32.01°, so angle B ≈ 57.99°.

Example 2: Find a missing leg (hypotenuse 17, leg 15)

Inputs: c = 17, a = 15. Formula: b = √(c² − a²). Calculation: b = √(289 − 225) = √64. Result: b = 8. The three sides 8, 15 and 17 are a Pythagorean triple.

Example 3: Diagonal of a 12 ft by 9 ft rectangle

A rectangle splits into two right triangles, so its diagonal is the hypotenuse. Inputs: a = 12 ft, b = 9 ft. Calculation: c = √(144 + 81) = √225. Result: 15 ft. This is 3 times the 3-4-5 triangle.

Example 4: Feet and inches

Inputs: a = 5 ft 3 3/8 in, b = 12 ft. In inches, a = 63.375 and b = 144. Calculation: c = √(63.375² + 144²) = √(4,016.39 + 20,736) = √24,752.39 ≈ 157.33 in. Result: 13 ft 1 5/16 in to the nearest 1/16 inch. The area is 31.69 square feet.

Example 5: Is 5, 7, 9 a right triangle?

The longest side is 9. The squares of the shorter sides add to 25 + 49 = 74, and 9² = 81. Because 74 is less than 81, the triangle is obtuse, and its largest angle is arccos((25 + 49 − 81) ÷ (2 × 5 × 7)) ≈ 95.74°.

5. Find a Missing Side of a Right Triangle

To find the missing side of a right triangle, first decide which side you are missing. If it is the hypotenuse, find c by adding the squares of the legs and taking the square root. If it is a leg, find b or a by subtracting the square of the known leg from the square of the hypotenuse, then taking the square root. That answers the common question of what the length of the missing leg is: it is √(c² − known leg²). The rule only works when the hypotenuse really is the longest side. If you enter a hypotenuse that is shorter than or equal to a leg, no right triangle exists, and the calculator says so.

Use whichever side you can measure most easily as the known leg. For a ladder against a wall, the ladder is the hypotenuse, the wall height is one leg and the distance from the wall is the other. If you know the ladder and the wall height, solve for the leg on the ground.

6. How to Find the Hypotenuse of a Triangle

The hypotenuse is the side opposite the right angle, and it is always the longest side. To calculate the hypotenuse of a right triangle, square both legs, add them, and take the square root: c = √(a² + b²). The result is always longer than either leg but shorter than the two legs added together. If you only need the hypotenuse and nothing else, our Hypotenuse Calculator is a focused tool for it, while this calculator also solves for a missing leg, checks triangles and shows angles.

7. Understanding Your Result

The headline result is the missing side in your unit. When the square root is not a whole number, the decimal is rounded to the places you chose, and the exact value is shown as a radical. For example, √45 is exactly 3√5, and √89 cannot be simplified. Keep the exact form if you plan to square the result again, because rounding early adds small errors that grow.

Check the answer by squaring: a² + b² should equal c². The calculator shows the squares in the Squares check. Rounding is appropriate at the end, to the precision of your measurements: a tape measure that reads to 1/16 inch does not justify six decimal places. For cutting or buying material, round up to the next cuttable length, and for checking a corner, rely on the angle or the difference between the squares, not on the rounded side.

8. Does the Pythagorean Theorem Work on All Triangles?

No. The equation a² + b² = c² holds only for right triangles. For any other triangle, the law of cosines gives the general relationship, c² = a² + b² − 2ab cos C, where C is the angle opposite c. When C is exactly 90°, the cosine is zero and the formula reduces to the Pythagorean theorem. The converse is also true and is what the calculator's check uses: if a² + b² equals c² for the longest side c, the triangle is right. If a² + b² is larger than c², the largest angle is less than 90° (acute), and if it is smaller, the largest angle is more than 90° (obtuse).

In practice, measurements are never perfect, so a corner can be close to square without being exact. Use the largest angle the check reports to judge how far off it is, and decide whether the error matters for the job.

9. Pythagorean Triples and the 3-4-5 Rule

A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². The smallest is 3, 4, 5. A triple is primitive if its numbers share no common factor, and multiplying every number by the same whole number gives another triple, so 6, 8, 10 and 9, 12, 15 are right triangles too. Because the sides scale together, a triple is a ratio of whole numbers, and you can simplify or scale such sets with our Ratio Calculator. For example, 6 : 8 : 10 reduces to 3 : 4 : 5. People often search these as 3 4 5, 6 8 10 or 17 15 8 triangles, and a 17, 15, 8 triangle is the primitive triple 8-15-17.

Triple (a, b, c)CheckSmaller angleLarger angle
3, 4, 53² + 4² = 5²  (9 + 16 = 25)36.87°53.13°
5, 12, 135² + 12² = 13²  (25 + 144 = 169)22.62°67.38°
8, 15, 178² + 15² = 17²  (64 + 225 = 289)28.07°61.93°
7, 24, 257² + 24² = 25²  (49 + 576 = 625)16.26°73.74°
20, 21, 2920² + 21² = 29²  (400 + 441 = 841)43.6°46.4°
9, 40, 419² + 40² = 41²  (81 + 1600 = 1681)12.68°77.32°

You can generate primitive triples from two whole numbers m and n, with m greater than n: the legs are m² − n² and 2mn, and the hypotenuse is m² + n². With m = 2 and n = 1 you get 3, 4, 5, and with m = 3 and n = 2 you get 5, 12, 13. Builders use the 3-4-5 rule to square a corner: measure 3 units along one wall and 4 along the other, and the diagonal between those marks should be exactly 5 units. Use 6, 8, 10 or 9, 12, 15 for larger layouts, which reduces measuring error.

10. Angles and Trigonometry

The theorem relates side lengths, not angles. To get an angle you need trigonometry. In a right triangle, tan A = a ÷ b, sin A = a ÷ c and cos A = b ÷ c, so angle A = arctan(a ÷ b), and the other acute angle is B = 90° − A. For the 3-4-5 triangle, A = arctan(3 ÷ 4) ≈ 36.87° and B ≈ 53.13°. The calculator shows both angles for any solved triangle.

This is why the calculator reports angles but asks for sides. If you know one side and one angle, you need trigonometric functions instead, such as c = a ÷ sin A. If two sides are missing, the theorem alone cannot solve the triangle, because it contains only one equation for the three sides.

11. Units, Feet and Inches, and Fractions

All three sides must use the same unit, and the result comes back in that unit. You can use millimeters, centimeters, meters, inches or feet, or leave the unit off for a plain number problem. In feet-and-inches mode, each side has a feet box and an inches box, and the inches box accepts fractions such as 3 3/8. The result is shown to the nearest 1/16 inch, with the decimal value beside it. Changing the unit converts your numbers using exact factors: 1 inch is exactly 25.4 millimeters, and 1 foot is exactly 12 inches or 0.3048 meters.

Areas are in square units, so 31.69 ft² is not the same as 31.69 ft. The calculator labels areas as square units, and for feet-and-inches mode it shows the area in square feet with the square inches beside it. Used as a Pythagorean theorem calculator with fractions, it reads them exactly, so 1/3 stays one third and is not rounded to 0.33 before the calculation.

12. Practical Tips

  • Measure both known sides in the same unit before you enter them.
  • Decide which side is the hypotenuse first. It is opposite the right angle and is the longest side.
  • Keep full precision until your last step, then round to the accuracy of your tape or instrument.
  • For the diagonal of a rectangle or a box face, enter the length and width as the legs and read the diagonal as the hypotenuse.
  • Check a corner with the 3-4-5 rule or its multiples, and measure the diagonal twice.
  • Use the right-triangle check when you have three measured sides and want to know how close they are to square.

13. Common Mistakes

  • Using the theorem on a triangle with no right angle: the equation is only valid for right triangles.
  • Swapping the hypotenuse and a leg: the hypotenuse must be the longest side.
  • Adding when you should subtract: for a missing leg, the formula is c² − the known leg², not the sum.
  • Forgetting the square root: a² + b² gives c², not c.
  • Mixing units: inches with feet, or centimeters with meters, gives a wrong answer.
  • Rounding too early: rounding a square root before you use it again can shift the final result.

The Pythagorean theorem calculator is used to find the diagonal of a rectangle, room or screen, the length of a ladder or ramp, the straight-line distance between two points on a grid, and the length of a brace or rafter that spans a known run and rise. It also checks whether a frame or foundation is square. The same equation, in the form √((x₂ − x₁)² + (y₂ − y₁)²), gives the distance between two points on a coordinate plane. Similar triangles, which have the same angles and sides in proportion, let you find a missing side from a smaller or larger copy of the triangle, and our Proportion Calculator solves that scaling directly. If your question is about the angles of a right triangle or a right angle triangle calculator in general, the angles shown here come from the same two sides you already entered.

15. Frequently Asked Questions

Square both legs, add the squares, and take the square root: c = √(a² + b²). For legs 3 and 4, c = √(9 + 16) = √25 = 5. For legs 5 and 8, c = √89 ≈ 9.43. The hypotenuse is always the longest side of a right triangle.

Subtract the square of the known leg from the square of the hypotenuse, then take the square root: b = √(c² − a²). With a hypotenuse of 17 and a leg of 15, b = √(289 − 225) = √64 = 8. The hypotenuse must be longer than the known leg, or no right triangle exists.

No. The equation a² + b² = c² holds only for right triangles. For other triangles, the law of cosines applies: c² = a² + b² − 2ab cos C. The converse is useful: if a² + b² equals c² for the longest side, the triangle is right, and if it is larger or smaller, the triangle is acute or obtuse.

Because 3² + 4² = 5², a triangle with sides 3, 4 and 5 has a right angle, and builders use it to square corners. Multiplying all three sides by the same number keeps the shape, so 6-8-10 (36 + 64 = 100), 9-12-15 and 12-16-20 are all right triangles.

Not by itself, because it relates side lengths. Once you know two sides, angle A = arctan(a ÷ b) and the other acute angle is 90° − A. For the 3-4-5 triangle, that gives about 36.87° and 53.13°. The calculator shows both angles for any solved triangle.

Conclusion

A Pythagorean theorem calculator turns any two sides of a right triangle into the third, using a² + b² = c². Accurate measurements in a single unit matter most, because every result comes from squaring and taking a square root, so small input errors carry through. Use the exact form when you need precision, the decimal when you need a length to cut, and the right-triangle check when you want to know whether a corner is square. Enter your sides in the calculator above to solve for a missing leg or the hypotenuse, and use the working to confirm each step.

This calculator is for general mathematics and planning. For structural, surveying or safety-critical work, confirm measurements and results with a qualified professional and follow your local requirements.