Pythagorean Theorem Calculator
Find the hypotenuse, a missing leg, or verify a Pythagorean triple for any right triangle.
📐 What is the Pythagorean Theorem?
The Pythagorean theorem is one of the most fundamental relationships in all of mathematics. It states that in any right triangle - a triangle containing exactly one 90-degree angle - the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides, known as the legs. Expressed as a formula: a² + b² = c², where a and b are the legs and c is the hypotenuse.
The theorem bears the name of the ancient Greek philosopher and mathematician Pythagoras of Samos (c. 570–495 BC), although the relationship was known to Babylonian, Indian, and Chinese mathematicians centuries earlier. The Babylonians used Pythagorean triples as far back as 1900–1600 BC (as seen on the clay tablet Plimpton 322), while the Sulba Sutras of ancient India documented the same relationship around 800–600 BC. What Pythagoras contributed was a formal logical proof within the framework of Greek deductive geometry.
The theorem is foundational to Euclidean geometry and underlies virtually every field of science, engineering, and technology. It is used in architecture to find rafter lengths from a roof's rise and run, in navigation to compute straight-line distances from component directions, in physics to find the magnitude of a resultant vector, in computer graphics to calculate the pixel distance between two points, and in surveying to lay out square corners using the 3-4-5 method. The theorem extends naturally into higher dimensions: in 3D, the space diagonal of a box with dimensions a, b, c is d = √(a² + b² + c²).
This calculator supports three modes: Find Hypotenuse (compute c given both legs a and b), Find Missing Leg (compute one leg given the hypotenuse and the other leg), and Verify Triple (check whether three numbers form a Pythagorean triple). Each mode returns the result along with the triangle area and perimeter where applicable, plus a step-by-step formula note so you can follow the working.
Formulas
Formula 1 - Find the Hypotenuse (c):
Square both legs, add the results together, then take the positive square root. Example: legs 3 and 4 give c = √(9 + 16) = √25 = 5.
Formula 2 - Find a Missing Leg (a):
Rearrange the theorem by subtracting b² from both sides: c² − b² = a², then take the square root. The known leg must be strictly shorter than the hypotenuse, otherwise the calculation is undefined.
Formula 3 - Find a Missing Leg (b):
Identical rearrangement, solving for the other leg. Example: hypotenuse 13, known leg 5 gives b = √(169 − 25) = √144 = 12.
Additional results - Area and Perimeter:
How to Use This Calculator
Steps to Calculate
Example Calculations
Example 1 — Find the Hypotenuse of a 3-4-5 Triangle
Right triangle with legs a = 3 and b = 4
Example 2 — Find a Missing Leg (Hypotenuse 13, Leg 5)
Right triangle: hypotenuse c = 13, known leg = 5, find the missing leg
Example 3 — Verify the 5-12-13 Pythagorean Triple
Are 5, 12, and 13 a Pythagorean triple?
Example 4 — Construction Check with 6-8-10 (Scaled 3-4-5)
Builder's right-angle check: legs a = 6 and b = 8 - what must the diagonal be?
Frequently Asked Questions
🔗 Related Calculators
What is the Pythagorean theorem and how does it work?
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the other two sides (the legs): a² + b² = c². It was known to Babylonian and Indian mathematicians over 2,500 years ago and formally proven by Pythagoras of Samos around 570–495 BC. The theorem is foundational to all of Euclidean geometry.
How do I find the hypotenuse of a right triangle?
Square both legs, add them together, then take the square root. Formula: c = √(a² + b²). Example: legs 3 and 4 → c = √(9 + 16) = √25 = 5. This works for any right triangle regardless of size or units.
How do I find a missing leg of a right triangle?
Rearrange the theorem: a = √(c² − b²) where c is the hypotenuse and b is the known leg. Example: hypotenuse 13, one leg 5 → missing leg = √(169 − 25) = √144 = 12. The leg must always be shorter than the hypotenuse.
What are Pythagorean triples?
Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². The smallest is 3-4-5 (9 + 16 = 25). Other common triples include 5-12-13, 8-15-17, 7-24-25, and 20-21-29. Any multiple of a triple (e.g. 6-8-10, 9-12-15) is also a triple. There are infinitely many Pythagorean triples.
Can the Pythagorean theorem be used in 3D?
Yes. The 3D extension is: d = √(a² + b² + c²) for the space diagonal of a cuboid (rectangular box). For a cuboid with dimensions 3×4×12, the space diagonal = √(9 + 16 + 144) = √169 = 13. The theorem is applied in two steps: find the floor diagonal first, then apply it again with the height.
What is the converse of the Pythagorean theorem?
The converse states: if a² + b² = c² for the sides of a triangle, then the triangle must be a right triangle with the right angle opposite side c. This is used in construction to verify 90° corners (3-4-5 method) and to classify triangles. If a² + b² > c² the triangle is acute; if a² + b² < c² it is obtuse.
How was the Pythagorean theorem proven?
Over 370 proofs exist. The classic geometric proof arranges four copies of the right triangle inside a large square to show that the area of the outer square (c²) equals the combined areas of the two inner squares (a² + b²). President James Garfield published a unique proof using a trapezoid in 1876. The theorem also follows directly from the dot product definition in linear algebra.
What is the Pythagorean theorem used for in real life?
Construction (checking corners are square using 3-4-5), navigation (finding straight-line distances from north-south and east-west components), architecture (rafter length from rise and run), surveying, physics (resultant vector magnitude), computer graphics (pixel distance calculations), and engineering. It is one of the most applied formulas in all of science and engineering.
Does the Pythagorean theorem work for all triangles?
No. It only applies to right triangles (triangles with exactly one 90° angle). For non-right triangles, use the Law of Cosines: c² = a² + b² − 2ab·cos(C). The Pythagorean theorem is the special case of the Law of Cosines when angle C = 90° (since cos 90° = 0).
What is the difference between legs and hypotenuse in a right triangle?
The two sides that form the right angle are called legs (or catheti), labelled a and b. The side opposite the right angle - always the longest side - is the hypotenuse, labelled c. In the 3-4-5 triangle, 3 and 4 are legs and 5 is the hypotenuse. The hypotenuse is always longer than either individual leg but shorter than their sum.