By Muhammad Tayyab (MSc Mathematics, Subject Specialist) · Last updated:
What this Pythagorean theorem calculator does
This free Pythagorean theorem calculator solves any right-triangle problem based on \( a^2 + b^2 = c^2 \). It works in three modes: finding the hypotenuse when the two legs are known, and finding either leg when the hypotenuse and the other leg are known. It validates impossible inputs, such as a hypotenuse shorter than a leg, before computing. The answer is shown in exact form (an integer or a simplified radical) next to the decimal approximation, with step-by-step working, automatic Pythagorean triple detection, and a diagram that draws the triangle in correct proportion with every side labelled.
How to use the calculator
- Choose what to find: hypotenuse \( c \), leg \( a \), or leg \( b \).
- Enter the two known sides. Decimals are fine, and any unit works (cm, m, inches, feet) as long as both sides use the same unit.
- Press Calculate (or Enter). You get the exact and decimal answer, the working, and the diagram.
- Check the verification line showing \( a^2 + b^2 \) equals \( c^2 \).
The Pythagorean theorem
In any right triangle, the square of the hypotenuse (the side opposite the \( 90^\circ \) angle) equals the sum of the squares of the other two sides. In words: a squared plus b squared equals c squared.
Variable definitions
- \( c \): the hypotenuse, the side opposite the right angle and always the longest side.
- \( a, b \): the two legs, which meet at the right angle.
Common Pythagorean triples
A Pythagorean triple is a set of three positive integers \( (a, b, c) \) with \( a^2 + b^2 = c^2 \). These recur throughout exams, and recognising them saves time. Any multiple of a triple is also a triple, for example \( (6, 8, 10) \) is \( 2 \times (3, 4, 5) \).
| \( a \) | \( b \) | \( c \) | Check: \( a^2 + b^2 = c^2 \) |
|---|---|---|---|
| 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 \) |
| 12 | 35 | 37 | \( 144 + 1225 = 1369 \) |
| 9 | 40 | 41 | \( 81 + 1600 = 1681 \) |
| 11 | 60 | 61 | \( 121 + 3600 = 3721 \) |
Special right triangles
| Triangle | Side ratio | Why |
|---|---|---|
| 45-45-90 | \( 1 : 1 : \sqrt{2} \) | \( 1^2 + 1^2 = 2 \), so the hypotenuse is \( \sqrt{2} \) |
| 30-60-90 | \( 1 : \sqrt{3} : 2 \) | \( 1^2 + (\sqrt{3})^2 = 4 = 2^2 \) |
Worked examples
Example 1: Given legs \( a = 3 \), \( b = 4 \)
- Square each leg: \( a^2 = 9 \), \( b^2 = 16 \).
- Sum: \( 9 + 16 = 25 \).
- Take the square root: \( c = \sqrt{25} = \mathbf{5} \).
- \( (3, 4, 5) \) is the smallest Pythagorean triple.
Example 2: Given legs \( a = 5 \), \( b = 12 \)
- \( a^2 = 25 \), \( b^2 = 144 \). Sum \( = 169 \).
- \( c = \sqrt{169} = \mathbf{13} \).
- \( (5, 12, 13) \) is the second most common triple in exams.
Example 3: Given legs \( a = 1 \), \( b = 1 \)
- \( a^2 + b^2 = 1 + 1 = 2 \).
- \( c = \sqrt{2} \).
- The exact form is \( \mathbf{\sqrt{2}} \approx 1.41421356\ldots \), an irrational number.
- This is the side ratio of a 45-45-90 triangle.
Example 4: Given hypotenuse \( c = 13 \) and leg \( a = 5 \)
- Square each: \( c^2 = 169 \), \( a^2 = 25 \).
- Difference: \( 169 - 25 = 144 \).
- Other leg: \( b = \sqrt{144} = \mathbf{12} \).
Example 5: Given hypotenuse \( c = 5 \), leg \( a = 5 \)
- Difference \( c^2 - a^2 = 25 - 25 = 0 \).
- \( b = \sqrt{0} = 0 \). But a side of length 0 does not form a triangle.
- Invalid: a right triangle cannot have a leg equal to its hypotenuse.
Example 6: Given hypotenuse \( c = 4 \), leg \( a = 5 \)
- \( c^2 - a^2 = 16 - 25 = -9 \), which is negative.
- There is no real number whose square is \( -9 \).
- Invalid: the hypotenuse must be the longest side, so it cannot be shorter than a leg.
Example 7: A 5 m ladder with its base 1.5 m from the wall
- The ladder is the hypotenuse: \( c = 5 \). The base distance is a leg: \( a = 1.5 \).
- Height on the wall: \( b = \sqrt{c^2 - a^2} = \sqrt{25 - 2.25} = \sqrt{22.75} \).
- The ladder reaches \( \approx 4.77 \text{ m} \) up the wall.
Example 8: Diagonal of a 48 in × 27 in TV screen
- The legs are the width and height: \( a = 48 \), \( b = 27 \).
- \( a^2 + b^2 = 2304 + 729 = 3033 \).
- \( d = \sqrt{3033} \approx \mathbf{55.07} \text{ in} \), which is sold as a 55-inch TV.
Real-world uses of the Pythagorean theorem
- Construction and carpentry: the 3-4-5 rule checks that a corner is square. Measure 3 units along one wall and 4 along the other; the diagonal must be exactly 5.
- Ladders and ramps: find how high a ladder reaches or how long a ramp must be.
- Screens and rectangles: the diagonal of a rectangle or a TV is the hypotenuse of its width and height.
- Navigation and maps: straight-line distance between two points on a grid.
- Physics: combining perpendicular vectors such as velocity or force components.
- 3D diagonals: the space diagonal of a box is \( d = \sqrt{l^2 + w^2 + h^2} \), the theorem applied twice.
History and the converse
The theorem is named after the Greek mathematician Pythagoras (around 570–495 BCE), but the relationship was known much earlier. A Babylonian clay tablet known as Plimpton 322, from roughly 1800 BCE, lists Pythagorean triples. Hundreds of different proofs have been published since.
The converse is just as useful: if the three sides of a triangle satisfy \( a^2 + b^2 = c^2 \), the triangle must be a right triangle. If \( a^2 + b^2 > c^2 \) the triangle is acute, and if \( a^2 + b^2 < c^2 \) it is obtuse. For any triangle, the law of cosines \( c^2 = a^2 + b^2 - 2ab\cos(C) \) generalises the theorem, and it reduces to Pythagoras when \( C = 90^\circ \).
Where the Pythagorean theorem appears in school maths
The theorem is introduced in lower secondary school (Grade 8 in the US Common Core, Key Stage 3 and GCSE in the UK, Class 9 and 10 in the Punjab board syllabus) and keeps returning in later topics:
- Coordinate geometry: the distance formula \( d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \) is Pythagoras applied to coordinate differences.
- Trigonometry: the identity \( \sin^2\theta + \cos^2\theta = 1 \) comes from Pythagoras on the unit circle.
- Physics: vector addition, projectile motion and forces at right angles.
- Mensuration: diagonals of rectangles and squares, heights of triangles, slant heights of cones.
Common mistakes to avoid
- Adding the sides without squaring first. The theorem is \( a^2 + b^2 = c^2 \), not \( a + b = c \). \( 3 + 4 = 7 \), but the hypotenuse is 5, not 7.
- Confusing which side is the hypotenuse. The hypotenuse is always the side opposite the right angle and always the longest. If your "hypotenuse" is shorter than a leg, something is wrong.
- Subtracting instead of adding when finding the hypotenuse. To find \( c \), you ADD the squares of the legs. Subtracting gives the difference, which is meaningless here.
- Forgetting to take the square root. The theorem gives \( c^2 = a^2 + b^2 \), so you must take the square root at the end. Leaving the answer as \( a^2 + b^2 \) is incomplete.
- Mixing up which square to subtract when finding a leg. To find a leg, compute \( c^2 - (\text{the other leg})^2 \), not the other way around. \( c \) must be larger than either leg.
- Rounding too early. Keep \( \sqrt{} \) symbols until the final step. For exam answers, the exact form \( \sqrt{13} \) is preferred over 3.606.
- Mixing units. Convert all sides to the same unit before squaring.
FAQ
What is the Pythagorean theorem?
In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: \( a^2 + b^2 = c^2 \). Here \( c \) is the hypotenuse (the side opposite the right angle) and \( a \) and \( b \) are the two legs.
How do I find the hypotenuse if I know the two legs?
Use \( c = \sqrt{a^2 + b^2} \). Square each leg, add them, then take the square root. For example, if \( a = 3 \) and \( b = 4 \), then \( c = \sqrt{9 + 16} = \sqrt{25} = 5 \).
How do I find a leg if I know the hypotenuse and the other leg?
Rearrange the Pythagorean equation: \( a = \sqrt{c^2 - b^2} \). The hypotenuse must be longer than the known leg, otherwise the expression inside the square root is negative and no real triangle exists.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers \( (a, b, c) \) satisfying \( a^2 + b^2 = c^2 \). The smallest is \( (3, 4, 5) \). Multiples like \( (6, 8, 10) \) and \( (9, 12, 15) \) are also triples. Recognising triples lets you solve right-triangle problems without a calculator.
Can a right triangle have a side of length zero?
No. All three sides must be strictly positive. A zero-length side would make the shape degenerate and the theorem would reduce to a trivially true equation like \( a^2 = a^2 \).
When solving for a leg, why must the hypotenuse be greater than the other leg?
Because the expression under the square root is \( c^2 - b^2 \). If \( c \le b \), then \( c^2 - b^2 \) is zero or negative, which cannot be the square of a real number. This reflects the geometric fact that the hypotenuse is always the longest side of a right triangle.
Does the Pythagorean theorem work for any triangle?
No. It only works for right triangles, those with one \( 90^\circ \) angle. For other triangles use the law of cosines, \( c^2 = a^2 + b^2 - 2ab\cos(C) \), which reduces to the Pythagorean theorem when \( C = 90^\circ \) because \( \cos(90^\circ) = 0 \).
What is the converse of the Pythagorean theorem?
If the three sides of a triangle satisfy \( a^2 + b^2 = c^2 \), then the triangle is a right triangle with the right angle opposite side \( c \). This is how builders check a corner with a 3-4-5 triangle.
How do I find the diagonal of a rectangle or a TV screen?
The diagonal is the hypotenuse of a right triangle whose legs are the width and the height: \( d = \sqrt{w^2 + h^2} \). A screen 48 in wide and 27 in tall has a diagonal of \( \sqrt{3033} \approx 55.07 \text{ in} \), which is sold as a 55-inch TV.
What are the special right triangles?
The 45-45-90 triangle has sides in the ratio \( 1 : 1 : \sqrt{2} \), and the 30-60-90 triangle has sides in the ratio \( 1 : \sqrt{3} : 2 \). Both follow directly from the Pythagorean theorem.
Can I enter decimals, and which units can I use?
Yes. The calculator accepts decimals and any unit (cm, m, inches, feet) as long as all sides use the same unit. The answer comes out in that same unit.
Related tools
More from Hira Science Academy
The Pythagorean theorem is a foundation for the geometry and trigonometry chapters in Class 9 and 10. Revise with our free Class 9 notes and Class 10 notes.