Pythagorean Theorem Calculator
Solve for any side of a right triangle with a² + b² = c²
📐 Right triangle
Choose which side is unknown, then enter the two sides you know. Results update instantly.
✅ Hypotenuse c
📊 Triangle summary
The Pythagorean theorem (a² + b² = c²) applies only to right triangles. Lengths use en-US number formatting and are shown to four decimal places.
Last updated June 2026
Method: Sides are computed directly from the Pythagorean theorem, a² + b² = c², with the hypotenuse as c = √(a² + b²) and a missing leg as √(c² − leg²). Acute angles use inverse tangent (arctan).
Included: The missing side, the full triangle (both legs and hypotenuse), area, perimeter, the two acute angles, and a step-by-step solution.
Not included: Non-right (oblique) triangles, 3-D distances, and unit conversion. All three sides are assumed to share the same unit.
Pythagorean theorem calculator: everything you need to know
The Pythagorean theorem is one of the most useful results in all of mathematics: in any right triangle, the square of the longest side equals the sum of the squares of the other two. Written as a² + b² = c², it lets you find a side you cannot measure directly - the diagonal of a TV screen, the length of a ramp, the straight-line distance between two points, or the bracing for a square corner. This Pythagorean theorem calculator solves for the hypotenuse or a missing leg, shows the work step by step, and throws in the area, perimeter, and angles of the triangle.
The classic worked example is the 3-4-5 triangle: with legs of 3 and 4, the hypotenuse is √(3² + 4²) = √(9 + 16) = √25 = 5. Because all three sides are whole numbers, this triangle - and the others below - show up constantly in textbooks, carpentry, and the calculator's quick-try buttons.
The formula and what each letter means
The theorem is usually written with the right angle between the two legs:
a² + b² = c² where a and b are the two legs (the sides that form the right angle) and c is the hypotenuse (the side opposite the right angle, and always the longest). Rearranging the formula gives the two things this calculator solves:
c = √(a² + b²) a = √(c² − b²) The first form finds the hypotenuse from two legs; the second finds a missing leg when you know the hypotenuse and one leg. The theorem holds only for right triangles, so the calculator assumes a 90-degree angle between the legs.
How to use this calculator
- Pick the unknown side. Use the toggle to choose whether you are solving for the hypotenuse (c) or a leg (a or b).
- Enter the two sides you know. When solving for c, type both legs. When solving for a leg, type the hypotenuse and the one leg you already have.
- Read the result. The large blue number is the missing side. Below it, the step-by-step box shows exactly how the answer was reached.
- Scan the summary. The triangle summary lists both legs, the hypotenuse, the area, the perimeter, and the two acute angles, plus a verification line confirming a² + b² = c².
Every field updates instantly as you type, so you can experiment - change a leg and watch the hypotenuse and area move together.
Who this calculator is for
- Students checking geometry and algebra homework, or studying for the SAT, ACT, or a math final.
- Carpenters and DIYers squaring up a deck, wall, or foundation using the 3-4-5 method.
- Designers and makers finding a screen diagonal, a rafter length, or a ramp run.
- Anyone needing a straight-line distance - the distance between two points on a grid is a Pythagorean calculation.
Worked example 1: finding the hypotenuse
A ladder leans against a wall. Its base is 6 feet from the wall and the top reaches 8 feet up. How long is the ladder? The ladder is the hypotenuse: c = √(6² + 8²) = √(36 + 64) = √100 = 10 feet. This is the 3-4-5 triangle scaled by two (6-8-10).
Worked example 2: finding a missing leg
You know a right triangle has a hypotenuse of 13 and one leg of 5. The other leg is b = √(13² − 5²) = √(169 − 25) = √144 = 12. That makes it the 5-12-13 triple. Note the calculator rejects a "leg" longer than the hypotenuse, because that triangle cannot exist.
Worked example 3: a non-whole answer
Most right triangles do not have tidy whole-number sides. With legs of 5 and 7, the hypotenuse is √(25 + 49) = √74 ≈ 8.6023. The area is ½ × 5 × 7 = 17.5 square units, and the acute angles are about 35.54° and 54.46°. Irrational results like √74 are completely normal - the 3-4-5 family is the exception, not the rule.
Common Pythagorean triples
A Pythagorean triple is three whole numbers that satisfy a² + b² = c². They are handy to recognize because the answer comes out clean. Every multiple of a triple is also a triple.
| Leg a | Leg b | Hypotenuse c | Check (a² + b²) |
|---|---|---|---|
| 3 | 4 | 5 | 9 + 16 = 25 |
| 5 | 12 | 13 | 25 + 144 = 169 |
| 8 | 15 | 17 | 64 + 225 = 289 |
| 7 | 24 | 25 | 49 + 576 = 625 |
| 20 | 21 | 29 | 400 + 441 = 841 |
| 9 | 40 | 41 | 81 + 1,600 = 1,681 |
| 6 | 8 | 10 | 36 + 64 = 100 |
The bottom row (6-8-10) is the 3-4-5 triple doubled - proof that scaling a triple keeps it a triple.
Key terms explained
- Right triangle: a triangle with one 90-degree angle. The theorem applies to these and only these.
- Legs (a and b): the two shorter sides that meet at the right angle. The order does not matter - swapping a and b gives the same hypotenuse.
- Hypotenuse (c): the side across from the right angle, always the longest side.
- Pythagorean triple: three whole numbers satisfying a² + b² = c².
- Converse: if a² + b² = c² for a triangle's sides, then it must be a right triangle.
Real-world uses
The theorem turns up far beyond the classroom. Builders square a corner by measuring 3 feet along one edge and 4 along the other; if the diagonal is exactly 5, the corner is a perfect 90 degrees (the 3-4-5 rule). The diagonal of a rectangular room or screen is √(width² + height²). On a map or coordinate grid, the straight-line distance between two points is √((x₂ − x₁)² + (y₂ − y₁)²) - the distance formula is just the Pythagorean theorem in disguise. Even in 3-D, the diagonal of a box uses an extended version, √(l² + w² + h²).
Tips for getting it right
- Identify the hypotenuse first. It is always opposite the right angle and the longest side. Plug it in as c, never as a leg.
- Use consistent units. All three sides must be in the same unit (all inches, or all meters). Convert before you calculate.
- Square before you add. A frequent slip is adding a + b first; you must square each side, then add.
- Expect irrational answers. If the hypotenuse is not a whole number, that is normal - keep a few decimals for accuracy.
Related concepts
The Pythagorean theorem is the gateway to several bigger ideas. The law of cosines (c² = a² + b² − 2ab·cos C) extends it to any triangle and collapses back to a² + b² = c² when the angle is 90 degrees. The distance formula and the unit circle in trigonometry both rest on it. For other quick math jobs, see our Percentage, Square Root, Exponent, Fraction, and Scientific calculators linked below.
⚠️ Common mistakes & edge cases
Treating a leg as the hypotenuse
The hypotenuse is always the longest side and always opposite the right angle. If you plug a leg in as c, you will get a wrong (or impossible) answer. When solving for a leg, the hypotenuse must be the larger number you enter.
Using it on a non-right triangle
a² + b² = c² only works when there is a 90-degree angle. For other triangles you need the law of cosines. Plugging oblique-triangle sides into this formula gives a meaningless result.
Adding before squaring
You must square each side first, then add: (3 + 4)² = 49 is wrong; 3² + 4² = 25 is right. Squaring is not distributive over addition, so the order matters.
Mixing units
All three sides must use the same unit. Mixing feet and inches (or meters and centimeters) silently throws off the answer. Convert everything to one unit before entering it.
❓ Frequently asked questions
What is the Pythagorean theorem?
The Pythagorean theorem states that in a right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse, c, is always the longest side. The theorem only holds for right triangles - triangles that contain a 90-degree angle.
How do I find the hypotenuse?
To find the hypotenuse c, square both legs, add them, and take the square root: c = √(a² + b²). For example, with legs of 3 and 4, c = √(9 + 16) = √25 = 5. Enter the two legs in the calculator and it returns the hypotenuse instantly, along with the area, perimeter, and angles.
How do I find a missing leg?
If you know the hypotenuse c and one leg, rearrange the formula: a = √(c² − b²). The unknown leg equals the square root of the hypotenuse squared minus the known leg squared. Select 'Leg a' or 'Leg b' in the calculator, then enter the hypotenuse and the leg you know.
Does the Pythagorean theorem work for any triangle?
No. It applies only to right triangles - those with one 90-degree angle. For triangles without a right angle, you need the law of cosines (c² = a² + b² − 2ab·cos C), which generalizes the Pythagorean theorem. When the angle C is 90 degrees, cos C is 0 and the law of cosines reduces to a² + b² = c².
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive whole numbers a, b, c that satisfy a² + b² = c². The best-known is (3, 4, 5). Other common triples include (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any multiple of a triple is also a triple - for example (6, 8, 10) is just (3, 4, 5) doubled.
Why must the hypotenuse be the longest side?
Because the hypotenuse is opposite the largest angle in the triangle - the 90-degree right angle - and in any triangle the longest side sits opposite the largest angle. Mathematically, c² = a² + b² is always greater than either a² or b² alone, so c is greater than both a and b. If you try to enter a 'leg' that is longer than the hypotenuse, the calculator flags it as impossible.
Can the Pythagorean theorem use decimals or fractions?
Yes. The sides do not have to be whole numbers. You can enter decimals such as 2.5 and 6.25, and the result will rarely be a whole number - most right triangles have an irrational hypotenuse. This calculator accepts any positive value and shows the answer to four decimal places.
How do I calculate the area of a right triangle?
In a right triangle the two legs are perpendicular, so they serve as the base and height. The area is simply ½ × a × b. For a 3-4-5 triangle the area is ½ × 3 × 4 = 6 square units. The calculator reports the area automatically once you enter the two legs.
What is the converse of the Pythagorean theorem?
The converse says that if the three sides of a triangle satisfy a² + b² = c², then the triangle must be a right triangle. This is how the theorem is used in construction and surveying: measure three sides, check whether they form a 3-4-5 relationship, and you can confirm a perfect 90-degree corner without a protractor.
Does this calculator give angles too?
Yes. Once the three sides are known, the calculator computes the two acute angles using inverse tangent (arctan), since the third angle is always 90 degrees. The angle opposite leg a equals arctan(a ÷ b), and the two acute angles always add up to 90 degrees.
💡 Good to know
The order of the legs does not matter
Because addition is commutative, swapping a and b gives the same hypotenuse. A 3-4 triangle and a 4-3 triangle both have a hypotenuse of 5 - so do not worry about which leg you call a.
Most hypotenuses are irrational
Only special triangles (the Pythagorean triples) produce whole-number hypotenuses. For everyday measurements you will usually get a decimal like √74 ≈ 8.6023, which is perfectly correct - just round as needed.
It is the basis of the distance formula
The straight-line distance between two points on a grid, √((x₂−x₁)² + (y₂−y₁)²), is just a² + b² = c² applied to the horizontal and vertical gaps. Learn one and you know the other.
Related Calculators
Percentage Calculator
Solve any percentage problem - what is X% of Y and more
Fraction Calculator
Add, subtract, multiply and divide fractions
Scientific Calculator
A full scientific calculator with trig, logs and more
Average Calculator
Calculate the mean, median and mode of numbers
Square Root Calculator
Find the square root of any number
Exponent Calculator
Raise numbers to any power