Pythagorean Theorem Calculator
Choose what you want to calculate, enter your numbers, and see the formula worked out.
Find any missing side of a right triangle, check whether three sides form a right triangle, calculate rectangle diagonals and coordinate distances, and see exact radicals, formulas, diagrams, and step-by-step math.
Choose what you want to calculate, enter your numbers, and see the formula worked out.
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.
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.
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.
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²).
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.
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.
9+16=25
36+49=85, 9²=81
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
| What You Need | Formula |
|---|---|
| Pythagorean Theorem | a²+b²=c² |
| Find Hypotenuse | c=√(a²+b²) |
| Find Leg a | a=√(c²−b²) |
| Find Leg b | b=√(c²−a²) |
| Right Triangle Check | a²+b²=c² with c longest |
| Acute Largest Angle | a²+b²>c² |
| Obtuse Largest Angle | a²+b²<c² |
| Right Triangle Area | A=ab/2 |
| Perimeter | P=a+b+c |
| Rectangle Diagonal | d=√(w²+h²) |
| Square Diagonal | d=s√2 |
| Coordinate Distance | d=√[(x₂−x₁)²+(y₂−y₁)²] |
I have a right triangle and need a missing side, right-triangle check, diagonal, or coordinate distance.
You are hereI need angles or missing sides in a general triangle, including SSS, SAS, ASA, or AAS.
Open Calculator ›I need advanced roots, powers, trigonometry, or scientific calculations.
Open Calculator ›I have two coordinate points and need slope, midpoint, or a line equation.
Open Calculator ›I need the area of a triangle, rectangle, circle, or another 2D shape.
Open Calculator ›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.
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.