Pythagorean Theorem Calculator

Choose what you want to calculate, enter your numbers, and see the formula worked out.

Enter any two sides and leave exactly one blank. All side lengths must be greater than 0.

What Is the Pythagorean Theorem?

The Pythagorean theorem describes a relationship between the three sides of a right triangle. A right triangle contains one 90-degree angle. The two sides that meet at the right angle are called legs. They are commonly labeled a and b. The side opposite the 90-degree angle is called the hypotenuse. It is labeled c. The hypotenuse is always the longest side of a right triangle.

The theorem states: a²+b²=c². In words: the square of one leg plus the square of the other leg equals the square of the hypotenuse.

Suppose the legs measure 3 and 4. Then 3²+4² = 9+16 = 25. Because 5²=25, the hypotenuse is 5. So 3, 4, 5 forms a right triangle.

The theorem is not simply a rule for memorizing three letters. It describes how the areas of squares built on the three sides of a right triangle are related.

Figure 1
The Hypotenuse Is Always Opposite the 90° Angle
a b c 90°
Leg a and leg b meet at the right angle (90°). The hypotenuse c is the side directly across from that right angle, and it is always the longest side of the triangle.

What Does a²+b²=c² Actually Mean?

The exponent 2 means each side length is squared. If a=3, then a² = 3² = 9. If b=4, then b² = 4² = 16. If c=5, then c² = 5² = 25. Now compare: 9+16 = 25. The equation works exactly.

But there is a deeper geometric meaning. Imagine drawing a square on each side of the right triangle. The square built on the side of length 3 has area 9. The square built on the side of length 4 has area 16. The square built on the hypotenuse of length 5 has area 25. The two smaller square areas add to the large square area: 9+16 = 25. That is the geometric idea behind the theorem.

Figure 2
Squares on the Three Sides
9 16 25
9+16=25
The square on leg a (area 3²=9) and the square on leg b (area 4²=16) together have exactly the same total area as the square on hypotenuse c (area 5²=25).

How Do You Find the Hypotenuse?

If both legs are known, solve a²+b²=c² for c. Take the positive square root: c=√(a²+b²). Side lengths are positive, so the negative square root is not used as a physical side length.

Example: a=5, b=12. Substitute: c=√(5²+12²). Square the legs: c=√(25+144). Add: c=√169. Take the square root: c=13. Therefore, the hypotenuse is 13. This is the familiar 5-12-13 right triangle.

Figure 3
Find the Hypotenuse
5 12 ?
5²+12² ↓ 25+144 ↓ 169 ↓ √169 ↓ 13

How Do You Find a Missing Leg?

If the hypotenuse and one leg are known, rearrange the theorem. Start: a²+b²=c². Suppose a is missing. Subtract b² from both sides: a²=c²−b². Then: a=√(c²−b²).

Example: c=13, b=5. Substitute: a=√(13²−5²). Square: a=√(169−25). Subtract: a=√144. Answer: a=12. The same method works if b is missing. Use b=√(c²−a²).

Figure 4
Find a Missing Leg
? 5 13
√(13²−5²) ↓ √144 ↓ 12

Why Must the Hypotenuse Be the Longest Side?

The hypotenuse sits opposite the 90° angle, which is the largest angle in a right triangle. The side opposite the largest angle must also be the longest side. There is also an algebraic reason. Because c²=a²+b², c² is larger than either a² or b² alone. For positive side lengths, c must therefore be longer than a and b. That provides an important input check. If someone enters hypotenuse 4 and leg 5, those values cannot describe a right triangle. A good calculator should explain the issue rather than produce an undefined square root.

What Is the Converse of the Pythagorean Theorem?

The original theorem says: if a triangle is right, then its side lengths satisfy a²+b²=c². The converse works backward. If three positive side lengths satisfy a²+b²=c² with c as the longest side, then the triangle is a right triangle.

Example: 8, 15, 17. Calculate 8²+15². 64+225 = 289. Now 17² = 289. Since 8²+15²=17², the triangle is right.

Figure 5
The Converse

3-4-5

9+16=25

✓ Right Triangle

6-7-9

36+49=85, 9²=81

✗ Not Right Triangle

How Can Side Lengths Tell You Whether the Largest Angle Is Acute, Right, or Obtuse?

The Pythagorean relationship can also help compare the largest angle of a triangle. Let c be the longest side. If a²+b²=c², the largest angle is 90°. The triangle is right. If a²+b²>c², the largest angle is less than 90°. The triangle is acute. If a²+b²<c², the largest angle is greater than 90°. The triangle is obtuse.

Example: 5, 12, 14. The longest side is 14. Calculate 5²+12² = 25+144 = 169. 14² = 196. Because 169<196, the largest angle is obtuse. This is a useful extension of the Pythagorean relationship, but this calculator remains focused primarily on right triangles.

Figure 6
Acute vs. Right vs. Obtuse
a²+b² > c²
Acute
a²+b² = c²
Right
a²+b² < c²
Obtuse

What Is a Pythagorean Triple?

A Pythagorean triple is a set of three positive integers that satisfies a²+b²=c². Common examples include 3-4-5, 5-12-13, 8-15-17, 7-24-25, 9-40-41, and 12-35-37.

Multiples of Pythagorean triples also work. For example, 3-4-5 multiplied by 2 becomes 6-8-10. Check: 6²+8² = 36+64 = 100. 10² = 100. So 6-8-10 is also a Pythagorean triple. The original 3-4-5 is called a primitive Pythagorean triple because its three values share no common factor greater than 1. The triple 6-8-10 is not primitive because every term is divisible by 2.

Figure 7
Pythagorean Triple Family
3-4-5×2→6-8-10×3→9-12-15
Same right-triangle proportions. Scaling a primitive triple by any positive integer produces another valid Pythagorean triple.

Why Is the 3-4-5 Triangle Useful in Construction?

A 3-4-5 triangle provides a practical way to create or check a right angle. Measure 3 units along one direction. Measure 4 units along the other. If the distance between the two endpoints is 5 units, the angle between the first two measurements is 90°. This idea can be scaled. For example, 6-8-10 or 9-12-15 creates the same right-angle relationship. This technique can be useful when checking corners, layouts, frames, and other rectangular construction.

Figure 8
3-4-5 Right Angle Check
3 4 5
If the diagonal measures exactly 5 units while the two sides measure 3 and 4, the corner is a true 90° angle.

Why Does the Pythagorean Theorem Work?

There are many mathematical proofs of the theorem. One especially visual approach uses area. Imagine four identical right triangles with legs a and b and hypotenuse c. Arrange the four triangles inside a larger square whose side length is a+b. The total area of the large square is (a+b)². Each right triangle has area ab/2. Four triangles therefore have total area 4(ab/2) = 2ab. The center region forms a square with side c. Its area is c².

So (a+b)² = 2ab+c². Expand the left side: a²+2ab+b² = 2ab+c². Subtract 2ab from both sides. The result is a²+b² = c². That gives the Pythagorean theorem.

Figure 9 · Original Proof
Rearrangement Proof by Area
c² b a a b
Outer Area = (a+b)² Four Triangles = 2ab Center Square = c² ↓ (a+b)² = 2ab+c² ↓ a²+2ab+b²=2ab+c² ↓ a²+b²=c²
Four congruent a-b-c right triangles are arranged pinwheel-style inside a square of side a+b, leaving a tilted square of side c in the middle. Comparing the outer area to the sum of the triangle and inner-square areas proves the theorem. Proportions shown are illustrative and apply to any right triangle.

Another Resource for the Pythagorean Theorem

Brilliant's Pythagorean theorem overview also explains the right-triangle side relationship, the converse of the theorem, Pythagorean triples, the connection to coordinate distance, and geometric proof ideas. For another educational explanation and proof reference, see their Pythagorean theorem guide.

How Is the Distance Formula Related to the Pythagorean Theorem?

The distance formula is the Pythagorean theorem applied to points on a coordinate plane. Suppose two points are (x₁,y₁) and (x₂,y₂). The horizontal distance between them is Δx=x₂−x₁. The vertical distance is Δy=y₂−y₁. Those two changes create the legs of a right triangle. The straight-line distance between the points is the hypotenuse. Therefore d² = (Δx)²+(Δy)². So d = √[(x₂−x₁)²+(y₂−y₁)²].

Example: A=(2,3), B=(6,11). Horizontal change: 6−2 = 4. Vertical change: 11−3 = 8. Distance: √(4²+8²) = √80 = 4√5 ≈ 8.9443.

Figure 10
Distance Formula From a Right Triangle
A(2,3) B(6,11) Δx = 4 Δy = 8
Δx=4, Δy=8 ↓ d = √80 = 4√5

How Do You Find the Diagonal of a Rectangle?

A rectangle can be split into two right triangles by drawing a diagonal from one corner to the opposite corner. The rectangle's width and height become the two legs. The diagonal becomes the hypotenuse. Therefore d=√(w²+h²).

Example: Rectangle 12 by 5. Diagonal: √(12²+5²) = √(144+25) = √169 = 13. This relationship appears in screens, rooms, boards, frames, construction, and rectangular layouts.

Figure 11
Rectangle Diagonal
12 5 13
12²+5²=13²

What Is the Diagonal of a Square?

A square has equal width and height. If each side is s, then d²=s²+s². So d²=2s². Take the square root: d=s√2. Example: side length 10. Diagonal: 10√2 ≈ 14.1421. This is why the diagonal of a square is longer than one side but shorter than two side lengths combined.

What Are Exact and Decimal Answers?

Some Pythagorean calculations produce whole numbers. Example: 3-4-5. Some produce irrational square roots. Example: legs 5 and 5. Hypotenuse: √(25+25) = √50 = 5√2. The expression 5√2 is the exact answer. A decimal such as 7.0711 is an approximation. Both are useful. Exact radicals preserve the precise mathematical value. Decimals are useful when making physical measurements or estimates. A strong calculator should show both when appropriate.

Figure 12
Exact vs. Decimal
√50 ↓ 5√2 · Exact ↓ ≈7.0711 · Decimal Approximation

How Do You Know If a Triangle With Three Sides Is Even Possible?

Before checking whether three lengths form a right triangle, they must first satisfy the triangle inequality. For side lengths a≤b≤c, a+b must be greater than c. Example: 2, 3, 6. Check: 2+3 = 5. But 5<6. These lengths cannot form a triangle at all. The Pythagorean right-triangle test should only be applied after the side lengths form a valid triangle.

What Is the Difference Between the Pythagorean Theorem and the Triangle Calculator?

The Pythagorean theorem applies specifically to right triangles. If you know two side lengths in a right triangle, it can find the third. The broader Triangle Calculator can solve many triangles that are not right triangles and can calculate missing angles, sides, area, and other properties. Use the Triangle Calculator when you need general triangle solving. Use this Pythagorean Theorem Calculator when the problem specifically involves right triangles, right-angle verification, diagonals, or coordinate distance.

Where Is the Pythagorean Theorem Used in Real Life?

The theorem appears anywhere a right-angle relationship creates an unknown diagonal or straight-line distance.

Construction: it can help check whether corners are square. A 3-4-5 layout is a common practical example. Carpentry: it can help determine diagonal brace lengths or check rectangular frames. Ladders: a ladder leaning against a vertical wall creates a right triangle when the ground and wall meet at 90°. If you know the distance from the wall and the height reached, the ladder length is the hypotenuse. Screens and rectangles: screen diagonal, width, and height form right-triangle relationships. Coordinate geometry: the distance between two points comes directly from the theorem. Navigation and mapping: horizontal and vertical displacements can form the legs of a right triangle. Physics: perpendicular vector components often create right-triangle calculations. Surveying: right angles and straight-line distances can be checked using Pythagorean relationships.

Figure 13
Ladder Example
6 ft 8 ft 10 ft
6²+8²=10²

What Are the Most Common Pythagorean Theorem Mistakes?

How Do You Use the Pythagorean Theorem Step by Step?

  1. Step 1: Confirm it is a right-triangle problem. Look for a 90° angle, a rectangle diagonal, perpendicular coordinate changes, or another right-angle relationship.
  2. Step 2: Identify the hypotenuse. It is opposite the right angle. Label it c.
  3. Step 3: Identify the legs. Label them a and b.
  4. Step 4: Write the formula. a²+b²=c².
  5. Step 5: Substitute the known values. Use parentheses around negative coordinate differences before squaring when working with distance.
  6. Step 6: Isolate the missing side. Add when finding c. Subtract when finding a or b.
  7. Step 7: Take the positive square root. A physical side length is positive.
  8. Step 8: Simplify the radical. If the answer is not a perfect square, show exact radical form where practical.
  9. Step 9: Verify. Substitute all three side lengths back into a²+b²=c².

What Should You Leave This Page Knowing?

Do not leave knowing only "my missing side is 5." Leave knowing that you know what makes a triangle a right triangle. You know which sides are the legs. You know how to identify the hypotenuse. You understand what a²+b²=c² means. You understand the square-area interpretation of the theorem. You know how to calculate the hypotenuse. You know how to calculate a missing leg. You understand why the hypotenuse must be longest. You know the converse of the Pythagorean theorem. You can check whether three side lengths form a right triangle. You understand how a²+b² compared with c² relates to acute, right, and obtuse triangles. You know what a Pythagorean triple is. You recognize common triples such as 3-4-5 and 5-12-13. You understand how multiples of a triple work. You understand a geometric area proof of the theorem. You know how the distance formula comes from the theorem. You know how to calculate a rectangle diagonal. You understand why a square diagonal is s√2. You know the difference between exact radical and decimal answers. You know the triangle inequality should be checked first when three sides are given. And most importantly: you can see why the Pythagorean Theorem Calculator produced the answer. That is what the CalculateThisWay Pythagorean Theorem Calculator should help someone understand.

Worked Examples

Example 1: 3-4-5. Legs a=3, b=4.
c = √(3²+4²) = √25
Hypotenuse c = 5
Example 2: 5-12-13. Legs a=5, b=12.
c = √(5²+12²) = √169
Hypotenuse c = 13
Example 3: Find a Leg. c=13, b=5.
a = √(13²−5²) = √144
Missing Leg a = 12
Example 4: Irrational. Legs a=5, b=5.
c = √50 = 5√2
Exact: 5√2, Decimal: ≈7.0711
Example 5: Check Right. Sides 8, 15, 17.
8²+15² = 289 = 17²
Right Triangle
Example 6: Not Right. Sides 6, 7, 9.
6²+7² = 85 ≠ 81 = 9²
Not Right Triangle
Example 7: Invalid Triangle. Sides 2, 3, 6.
2+3 = 5 < 6
Does Not Form a Triangle
Example 8: Rectangle Diagonal. 12 × 5.
d = √(12²+5²) = √169
Diagonal = 13
Example 9: Square Diagonal. Side 10.
d = 10√2
Diagonal ≈ 14.1421
Example 10: Coordinate Distance. (2,3) and (6,11).
d = √(4²+8²) = √80 = 4√5
Distance ≈ 8.9443
Example 11: Ladder. 6 ft from wall, 8 ft high.
L = √(6²+8²) = √100
Ladder = 10 ft

Try It Yourself

A right triangle has legs 9 and 12. What is the hypotenuse?

Pythagorean Theorem Formulas at a Glance

What You NeedFormula
Pythagorean Theorema²+b²=c²
Find Hypotenusec=√(a²+b²)
Find Leg aa=√(c²−b²)
Find Leg bb=√(c²−a²)
Right Triangle Checka²+b²=c² with c longest
Acute Largest Anglea²+b²>c²
Obtuse Largest Anglea²+b²<c²
Right Triangle AreaA=ab/2
PerimeterP=a+b+c
Rectangle Diagonald=√(w²+h²)
Square Diagonald=s√2
Coordinate Distanced=√[(x₂−x₁)²+(y₂−y₁)²]

Pythagorean Theorem Calculator or Another Math Tool?

Pythagorean Theorem Calculator

I have a right triangle and need a missing side, right-triangle check, diagonal, or coordinate distance.

You are here

Triangle Calculator

I need angles or missing sides in a general triangle, including SSS, SAS, ASA, or AAS.

Open Calculator ›

Scientific Calculator

I need advanced roots, powers, trigonometry, or scientific calculations.

Open Calculator ›

Slope Calculator

I have two coordinate points and need slope, midpoint, or a line equation.

Open Calculator ›

Area Calculator

I need the area of a triangle, rectangle, circle, or another 2D shape.

Open Calculator ›

Questions People Actually Ask

What is the Pythagorean theorem?

It is the rule that relates the three sides of a right triangle: the square of one leg plus the square of the other leg equals the square of the hypotenuse.

What is the Pythagorean theorem formula?

a²+b²=c², where a and b are the legs and c is the hypotenuse.

What do a, b, and c mean?

a and b are the two legs that meet at the right angle. c is the hypotenuse, opposite the right angle.

Which side is the hypotenuse?

The side directly opposite the 90° angle. It is always the longest side.

How do I find the hypotenuse?

Use c=√(a²+b²) with both legs known.

How do I find a missing leg?

Use a=√(c²−b²) or b=√(c²−a²) with the hypotenuse and one leg known.

Why is the hypotenuse the longest side?

It is opposite the largest angle (90°), and algebraically c²=a²+b² must exceed either a² or b² alone.

Can the Pythagorean theorem be used on any triangle?

No. It applies only to right triangles.

How do I know if a triangle is a right triangle?

Check whether a²+b²=c² for the two shorter sides and the longest side.

What is the converse of the Pythagorean theorem?

If a²+b²=c² for three positive side lengths with c longest, the triangle must be a right triangle.

What is a Pythagorean triple?

A set of three positive integers satisfying a²+b²=c².

What are common Pythagorean triples?

3-4-5, 5-12-13, 8-15-17, 7-24-25, 9-40-41, and 12-35-37.

Is 3-4-5 a right triangle?

Yes. 3²+4²=5².

Is 5-12-13 a right triangle?

Yes. 5²+12²=13².

Is 8-15-17 a right triangle?

Yes. 8²+15²=17².

Is 6-8-10 a Pythagorean triple?

Yes, and it is a non-primitive multiple of 3-4-5.

What is a primitive Pythagorean triple?

A triple whose three values share no common factor greater than 1, such as 3-4-5.

Can the Pythagorean theorem produce decimals?

Yes, whenever the sum of the squares is not a perfect square.

Can the answer contain a square root?

Yes. This calculator simplifies square roots into exact radical form where practical.

What is the exact answer versus a decimal approximation?

The exact answer is the precise radical or rational value, such as 5√2. The decimal approximation, such as 7.0711, is a rounded estimate.

How do I simplify a square root answer?

Factor out the largest perfect square, such as √72=√(36×2)=6√2.

What happens if the hypotenuse is shorter than a leg?

The inputs describe an impossible right triangle. The calculator shows an invalid-triangle message instead of an undefined result.

What is triangle inequality?

For sides a≤b≤c, the rule that a+b must be greater than c for a triangle to exist at all.

How do you find the diagonal of a rectangle?

Use d=√(w²+h²), treating width and height as the legs of a right triangle.

How do you find the diagonal of a square?

Use d=s√2, where s is the side length.

Why is the diagonal of a square s√2?

Because d²=s²+s²=2s², and taking the square root gives d=s√2.

How is the distance formula related to the Pythagorean theorem?

The horizontal and vertical coordinate differences form the legs of a right triangle, and the distance is the hypotenuse.

How do I find distance between two points?

Use d=√[(x₂−x₁)²+(y₂−y₁)²].

How is the Pythagorean theorem used in construction?

It helps check that corners are square and helps calculate diagonal brace or frame lengths.

How does a 3-4-5 triangle create a right angle?

If sides of 3 and 4 units meet with a diagonal of exactly 5 units, the angle between them must be 90°.

What does a²+b²>c² mean?

The largest angle of the triangle is acute, less than 90°.

What does a²+b²<c² mean?

The largest angle of the triangle is obtuse, greater than 90°.

Why does the Pythagorean theorem work?

It can be shown with an area-based proof: rearranging four congruent right triangles inside a square reveals that a²+b² must equal c².

Can the theorem be proven with areas?

Yes. Comparing the area of a large square built from four right triangles and a smaller central square is one classic proof.

What is the difference between this calculator and the Triangle Calculator?

This calculator focuses on right triangles, right-angle checks, diagonals, and coordinate distance. The Triangle Calculator solves general triangles, including non-right triangles and angle-based problems.

Sources & Further Reading

Pythagorean Theorem Formulas & Methodology

Formulas Used on This Page

Missing Sidea²+b²=c²
Right Triangle Checka²+b² vs c²
Rectangle Diagonald=√(w²+h²)
Square Diagonald=s√2
Coordinate Distance√[(x₂−x₁)²+(y₂−y₁)²]
Area (Right Triangle)A=ab/2
PerimeterP=a+b+c

Missing-side calculations use a²+b²=c², and the hypotenuse is always treated as the side opposite the right angle and must be the longest side; an entry that would make the hypotenuse shorter than a leg is rejected as an invalid right triangle rather than producing NaN. Three-side checks validate the triangle inequality first, and only proceed to a right-triangle comparison once a valid triangle is confirmed. Right-triangle checks compare a²+b² with c² within a small numerical tolerance to accommodate decimal and fractional inputs. Exact square-root simplification is preserved where practical, and simple fraction inputs are parsed exactly rather than converted to decimals prematurely. Decimals are rounded for display while calculations use greater internal precision; use the decimal-places control to see additional digits. Coordinate distance uses horizontal and vertical differences as the legs of a right triangle, and rectangle diagonal calculations treat width and height as perpendicular legs. Pythagorean triple detection requires all three side lengths to be positive integers satisfying the theorem exactly, with primitivity determined by the greatest common divisor of the three values.

This calculator is provided for general educational and informational purposes only. It is not engineering, construction, or surveying advice. Always verify measurements independently and consult a qualified professional before relying on them for construction, layout, or design decisions.