The Pythagorean Theorem Calculator solves the Pythagorean equation a² + b² = c² for any side of a right triangle. Enter two side lengths and the calculator returns the third side, the step-by-step working, the answer in simplest radical form, and the area, perimeter and angles of the triangle. Students use the tool to check homework, and builders, carpenters and surveyors use it to find diagonals, rafter lengths and straight-line distances. The tool has 4 parts: 4 solving modes, input fields that accept decimals, fractions, roots and feet-inches, a live diagram with a square drawn on every side, and an output panel with the answer, the working and the extra measurements.
How to Use the Pythagorean Theorem Calculator
To use the Pythagorean Theorem Calculator, pick a mode, enter the known values and read the answer. The result updates as you type, so there is no calculate button to press.
- Choose a mode. "Find a missing side" solves for one side of a right triangle. "Check a right triangle" tests 3 lengths. "3D box diagonal" finds the longest straight line inside a box. "Distance between points" measures the gap between 2 coordinates.
- Pick the side to solve for. Select hypotenuse c when you know both legs, or leg a or leg b when you know the hypotenuse and the other leg.
- Enter the known values. Type 2.5, 3/4, 1 1/2, √2, 3√5 or 5' 6 3/8". The unit menu labels the result in centimeters (cm), meters (m), inches (in), feet (ft) and 4 other units without converting the numbers.
- Read the result. The output shows the missing side as a decimal, the exact radical form, every step of the arithmetic, and the area, perimeter, altitude and both acute angles.
The Decimals menu sets the rounding from 0 to 10 places. Pick feet or inches as the unit and the answer appears in feet-inches to the nearest 1/16 inch, the format a tape measure uses on a job site.
What Is the Pythagorean Theorem?
The Pythagorean theorem states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. A right triangle has one 90° angle. The two sides that form the 90° angle are the legs (leg a and leg b), and the side opposite the 90° angle is the hypotenuse (side c), the longest side of the triangle.
Squares on the sides of a 3-4-5 triangle
The theorem carries the name of Pythagoras of Samos, an ancient Greek mathematician and philosopher of the sixth century BC. Older cultures used the rule first. A Babylonian clay tablet, Plimpton 322, lists right-triangle side ratios from around 1800 BC, and the Indian Baudhayana Sulba Sutra (about 800 BC) states the rule for the diagonal of a rectangle. Euclid wrote a formal geometric proof as Proposition 47 in Book I of the Elements, around 300 BC.
The Pythagorean theorem has hundreds of proofs. Elisha Loomis collected 367 of them in The Pythagorean Proposition (1940). The proofs fall into 3 groups: geometric proofs built from shapes, algebraic proofs built from equations, and proofs that use differentials from calculus. The rearrangement proof below is one of the shortest.
Rearrangement proof
The algebraic proof reads the left square as one equation: (a + b)² = c² + 4 × (ab ÷ 2). Expanding gives a² + 2ab + b² = c² + 2ab, and removing 2ab from both sides leaves a² + b² = c².
The law of cosines extends the theorem to every triangle: c² = a² + b² − 2ab·cos C. At C = 90°, cos C = 0, and the law of cosines reduces to the Pythagorean equation.
Pythagorean Theorem Formula (a² + b² = c²)
The Pythagorean theorem formula is a² + b² = c², where a and b are the legs and c is the hypotenuse. Rearranging the Pythagorean equation gives one formula for each side of a right triangle:
c is always the hypotenuse, the side opposite the 90° angle.
How to Find the Hypotenuse (c)
To find the hypotenuse, square both legs, add the squares and take the square root of the sum. The hypotenuse formula is c = √(a² + b²).
- Square leg a and leg b.
- Add the 2 squares.
- Take the square root of the total.
Legs of 5 cm and 12 cm give c = √(25 + 144) = √169 = 13 cm. The hypotenuse is always longer than either leg, so a result shorter than a leg points to an input error.
How to Find the Missing Leg (a or b)
To find a missing leg, subtract the square of the known leg from the square of the hypotenuse, then take the square root. The formulas are a = √(c² − b²) and b = √(c² − a²).
A hypotenuse of 25 in and a leg of 7 in give b = √(625 − 49) = √576 = 24 in. The order of the subtraction matters: c² − a² is positive, while a² − c² is negative and has no real square root. The calculator rejects any hypotenuse that is not longer than the leg.
Pythagorean Theorem Examples with Step-by-Step Solutions
The 3 examples below cover a whole-number answer, a missing leg, and an answer with decimals and square roots. Each solution follows the same steps the calculator prints in its working panel.
Example 1: Finding the Hypotenuse
A rectangular picture frame measures 20 cm by 21 cm. Find the length of the diagonal.
- Label the sides: a = 20 cm, b = 21 cm, c = the diagonal.
- Write the formula: c² = a² + b².
- Substitute and square: c² = 20² + 21² = 400 + 441 = 841.
- Take the square root: c = √841 = 29 cm.
The diagonal is 29 cm (11.42 in). 20, 21 and 29 are whole numbers, so 20-21-29 is a Pythagorean triple. Framers use the same measurement as a squareness test: two equal diagonals mean all 4 corners are 90°.
Example 2: Finding a Missing Leg
A 6.5 m ladder leans against a wall with its foot 2.5 m from the wall. Find how high up the wall the ladder reaches.
- Label the sides: c = 6.5 m (the ladder), b = 2.5 m (the ground), a = the height.
- Write the formula: a² = c² − b².
- Substitute and square: a² = 6.5² − 2.5² = 42.25 − 6.25 = 36.
- Take the square root: a = √36 = 6 m.
The ladder reaches 6 m (19 ft 8 1/4 in) up the wall.
Example 3: Solving with Decimals and Square Roots
A right triangle has legs of 1.5 cm and 3.5 cm. Find the hypotenuse in exact form and as a decimal.
- Square and add: c² = 1.5² + 3.5² = 2.25 + 12.25 = 14.5.
- Write the total as a fraction: 14.5 = 29/2.
- Take the square root and rationalize: c = √(29/2) = √29 ÷ √2 = √58 ÷ 2.
- Convert to a decimal: c ≈ 3.8079 cm.
The hypotenuse is √58/2 cm, about 3.8079 cm (1.4992 in). Keep the exact form through a multi-step problem and round only on the last line. Fractions and roots follow the same rules:
- Fractions: legs of 3/4 and 1 give c² = 9/16 + 16/16 = 25/16, so c = 5/4.
- Square roots: legs of √2 and √7 give c² = 2 + 7 = 9, so c = 3.
Type both forms straight into the calculator: 3/4, 1 1/2, √7 and 2√3 are all valid inputs.
How to Check if Three Sides Form a Right Triangle
To check if three sides form a right triangle, square the two shorter sides, add them, and compare the total with the square of the longest side. Equal values mean the triangle has a 90° angle.
Converse of the Pythagorean Theorem
The converse of the Pythagorean theorem states that a triangle with sides a, b and c, where a² + b² = c², is a right triangle. The 90° angle sits opposite side c.
Test 9, 40 and 41: 9² + 40² = 81 + 1,600 = 1,681, and 41² = 1,681. The two totals match, so 9-40-41 is a right triangle. Builders use the converse to check right angle construction: marks at 3 ft and 4 ft along two walls sit exactly 5 ft apart (0.91 m, 1.22 m and 1.52 m) when the corner is square.
Identifying Acute, Right, and Obtuse Triangles
Comparing a² + b² with c² sorts every triangle into 1 of 3 types, with c as the longest side:
- Acute triangle: a² + b² > c². Every angle is under 90°. The sides 7, 8, 9 give 113 > 81.
- Right triangle: a² + b² = c². One angle is exactly 90°. The sides 6, 8, 10 give 100 = 100.
- Obtuse triangle: a² + b² < c². One angle is over 90°. The sides 4, 6, 9 give 52 < 81.
Same test, three results
Lengths that fail the triangle inequality form no triangle at all. The two shorter sides must add up to more than the longest side: 2, 3 and 6 fail the test, since 2 + 3 = 5 is less than 6.
What Are Pythagorean Triples?
A Pythagorean triple is a set of 3 positive whole numbers a, b and c that satisfy a² + b² = c². The smallest triple is 3, 4, 5. A primitive triple has no common factor, and multiplying a primitive triple by any whole number gives another triple: 3-4-5 becomes 6-8-10, 9-12-15 and 30-40-50.
Common Pythagorean Triples Chart
| Triple (a, b, c) | a² + b² = c² | Type |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | Primitive |
| 5, 12, 13 | 25 + 144 = 169 | Primitive |
| 8, 15, 17 | 64 + 225 = 289 | Primitive |
| 7, 24, 25 | 49 + 576 = 625 | Primitive |
| 20, 21, 29 | 400 + 441 = 841 | Primitive |
| 12, 35, 37 | 144 + 1,225 = 1,369 | Primitive |
| 9, 40, 41 | 81 + 1,600 = 1,681 | Primitive |
| 11, 60, 61 | 121 + 3,600 = 3,721 | Primitive |
| 6, 8, 10 | 36 + 64 = 100 | 3-4-5 × 2 |
| 10, 24, 26 | 100 + 576 = 676 | 5-12-13 × 2 |
How to Generate Pythagorean Triples
To generate Pythagorean triples, use Euclid's formula. Pick 2 whole numbers m and n with m > n > 0, then:
Every primitive triple comes from one pair of m and n.
| m | n | a = m² − n² | b = 2mn | c = m² + n² |
|---|---|---|---|---|
| 2 | 1 | 3 | 4 | 5 |
| 3 | 2 | 5 | 12 | 13 |
| 4 | 1 | 15 | 8 | 17 |
| 4 | 3 | 7 | 24 | 25 |
| 5 | 2 | 21 | 20 | 29 |
| 5 | 4 | 9 | 40 | 41 |
| 6 | 1 | 35 | 12 | 37 |
The triple is primitive when m and n share no common factor and exactly one of them is even. The pair m = 3, n = 1 breaks the second rule and gives 8, 6, 10, a multiple of 3-4-5. The full list sits in the Pythagorean triples guide.
Real-Life Applications of the Pythagorean Theorem
The Pythagorean theorem turns any layout with a right angle into a distance problem. There are 8 common real-life applications, each with a worked number:
- Construction squaring. The 3-4-5 rule checks a corner with a tape measure. Larger slabs use 6-8-10 ft or 9-12-15 ft for a more accurate check.
- Ladder placement. A 20 ft ladder with its base 5 ft from the wall reaches √(400 − 25) ≈ 19.36 ft (5.90 m) up the wall.
- TV and screen size. A 55-inch 16:9 TV measures 55 in across the diagonal, about 47.9 in (121.8 cm) wide and 27.0 in (68.5 cm) tall.
- Ramp length. The Americans with Disabilities Act (ADA) sets a maximum ramp slope of 1:12. A 30 in rise needs a 360 in run, and the ramp surface measures √(360² + 30²) ≈ 361.2 in (30.1 ft or 9.18 m).
- Baseball diamond distance. The bases sit 90 ft apart, so the throw from home plate to second base covers √(90² + 90²) ≈ 127.28 ft (38.80 m).
- Fence and gate bracing. A 4 ft × 6 ft gate needs a cross-brace of √(16 + 36) = √52 ≈ 7.21 ft, or 7′ 2 9/16″.
- Guy wires and flagpoles. A guy wire from the top of a 12 m pole to an anchor 5 m from the base measures √(144 + 25) = 13 m.
- Distance between two coordinates. The points (−2, 1) and (4, 9) are √(6² + 8²) = 10 units apart. Maps, GPS software and computer graphics use the same distance formula.
3D problems use the theorem twice. The diagonal of a rectangular prism (a box) is d = √(l² + w² + h²). A 70 cm × 45 cm × 25 cm suitcase holds a rod up to √(4,900 + 2,025 + 625) = √7,550 ≈ 86.9 cm (34.2 in) long. The "3D box diagonal" mode solves this in one step.
Common Pythagorean Theorem Mistakes to Avoid
There are 7 common mistakes when solving right triangles with the Pythagorean theorem:
- Using the theorem on a non-right triangle. a² + b² = c² holds only with a 90° angle. Other triangles need the law of cosines.
- Treating a leg as the hypotenuse. The hypotenuse is the longest side and sits opposite the 90° angle.
- Adding before squaring. (3 + 4)² = 49, while 3² + 4² = 25.
- Forgetting the square root. c² = 25 means c = 5, not 25.
- Subtracting in the wrong order. A leg is √(c² − b²). √(b² − c²) has no real value.
- Mixing units. Convert 1 ft 6 in to 1.5 ft or 18 in before squaring. An equation with 6 ft and 30 in side by side gives a wrong answer.
- Rounding too early. Rounding √52 to 7.2 before the next step adds error. Keep 2√13 until the last line.
The Pythagorean Theorem Calculator handles 5 of these 7 mistakes on its own: it rejects a hypotenuse that is not the longest side, squares before adding, takes the square root, subtracts in the right order and keeps the exact radical until the final decimal. Feet-inch inputs such as 1' 6" are converted for you, and the right triangle calculator covers the cases where you know an angle instead of a second side.