Pythagorean Theorem Calculator
Source: Euclid, Elements, Book I, Proposition 47 · Source verified August 20, 2026
A Pythagorean theorem calculator is a geometric tool that solves for the length of any side of a right-angled triangle using the formula a² + b² = c², where c is the hypotenuse and a and b are the legs. The theorem is a fundamental principle of Euclidean geometry. It is used extensively in architecture, engineering, navigation, and construction to calculate exact straight-line distances.
Find the hypotenuse or missing leg of any right triangle. Shows step-by-step solution, perimeter, area, and angles.
Quick Answer
Calculate the length of any missing side of a right triangle. Enter the lengths of any two sides to instantly solve for the third side using the Pythagorean theorem.
Awaiting inputs
—
How it works
Formula · a^2 + b^2 = c^2, where c is the hypotenuse. Solving for a leg subtracts from the hypotenuse: a = sqrt(c^2 - b^2).
The Pythagorean theorem (a² + b² = c²) lets you find any missing side of a right triangle if you know the other two.
Find Hypotenuse · c = √(a² + b²)
Find Leg · a = √(c² − b²)
What is the Pythagorean theorem?
The Pythagorean theorem is one of the most famous equations in mathematics. It describes the relationship between the three sides of a right triangle (a triangle with one 90° angle).
THE THEOREM: a² + b² = c²
Where:
- c is the hypotenuse, the longest side, opposite the right angle
- a and b are the two legs, the sides that form the right angle
NAMED AFTER: Pythagoras of Samos (around 570-495 BCE), an ancient Greek mathematician. The theorem was actually known to Babylonian and Indian mathematicians before Pythagoras, but his school in ancient Greece formally proved it, which is why his name stuck.
THE THEOREM ONLY WORKS FOR RIGHT TRIANGLES. For other triangles, use the Law of Cosines instead: c² = a² + b² - 2ab × cos(C).
The calculator above solves for any missing side when you know the other two. Choose what you want to find from the dropdown, enter the two known values, and it instantly shows the answer with step-by-step work.
How to use the Pythagorean theorem
FINDING THE HYPOTENUSE (c) when you know both legs:
- Square each leg
- Add them together
- Take the square root of the result
EXAMPLE: Legs are 3 and 4.
- 3² + 4² = 9 + 16 = 25
- √25 = 5
- The hypotenuse is 5
FINDING A LEG when you know the hypotenuse and other leg:
- Square the hypotenuse
- Subtract the square of the known leg
- Take the square root of the result
EXAMPLE: Hypotenuse is 13, one leg is 5.
- 13² - 5² = 169 - 25 = 144
- √144 = 12
- The other leg is 12
COMMON PYTHAGOREAN TRIPLES (sets of three whole numbers that satisfy a² + b² = c²):
- 3, 4, 5 (the most famous)
- 5, 12, 13
- 8, 15, 17
- 7, 24, 25
- 9, 40, 41
- 20, 21, 29
Multiples of these also work: 6, 8, 10 (double of 3-4-5), 9, 12, 15 (triple of 3-4-5), etc.
The distance formula is this theorem in coordinates
The distance formula is not a different rule that happens to resemble this one. It is this theorem, written for a coordinate plane. Put the triangle on axes and the two legs stop being called a and b and start being called the difference in x and the difference in y. The hypotenuse stops being called c and starts being called the distance. Nothing else changes, which is why d = √((x₂ − x₁)² + (y₂ − y₁)²) is just c = √(a² + b²) with longer names for a and b.
The diagram places the same right triangle on a coordinate plane. One point sits at (1, 2) and the other at (4, 6). The horizontal leg, labelled a, has length 3. The vertical leg, labelled b, has length 4, and a small square marks the right angle where they meet. The hypotenuse, labelled c, joins the two points. Since 9 plus 16 is 25, c is 5.
Working a side out by hand
Solving for the hypotenuse, with legs of 3 and 4:
- Square each leg. 3² = 9 and 4² = 16.
- Add them. 9 + 16 = 25.
- Take the square root. √25 = 5, so the hypotenuse is 5.
Solving for a missing leg runs the same steps in reverse, and the subtraction goes one way only. With a hypotenuse of 13 and one leg of 5: 13² = 169, 5² = 25, and 169 − 25 = 144, so the other leg is √144 = 12. The hypotenuse is always the square you subtract from, never the one you subtract.
Edge cases, and what the answer means
- A leg longer than the hypotenuse. There is no such triangle, so the calculator refuses rather than returning a number. In a right triangle the hypotenuse is opposite the largest angle, and so it is always the longest side. If your figures say otherwise, two sides have been swapped.
- A leg exactly equal to the hypotenuse. Also rejected, and for the same reason. It would leave the other leg at zero length, which is a straight line rather than a triangle.
- Answers that are not whole numbers. These are the normal case, not a problem. Legs of 3 and 4 give exactly 5, but legs of 2 and 3 give √13, which is 3.6056 to four places. Whole-number triples like 3-4-5 and 5-12-13 are rare enough to be worth naming.
- Right angles only. The theorem holds for right triangles and nothing else. For a triangle with no right angle you need the law of cosines, which reduces to this theorem when the angle happens to be 90 degrees.
This page solves for one missing side and stops there. If you also want the two acute angles, the area or the perimeter, the right triangle calculator takes any two known parts, including an angle rather than a side, and returns the rest of the shape. The isosceles right triangle, the 45-45-90 case, is simply that solver with two equal legs.
Your measurements stay in the page
Every side length you enter is processed by this page in your browser. The measurements and the result are not sent to a server, not stored after you close the tab, and not visible to anyone else. There is no account and nothing to sign up for.
Real-world applications
The Pythagorean theorem is not just a classroom exercise. It is used constantly in real applications:
CONSTRUCTION:
- Checking that walls are square (3-4-5 method: measure 3 feet along one wall, 4 feet along the adjacent wall, and the diagonal should be exactly 5 feet)
- Calculating roof rise and run
- Determining diagonal bracing lengths
- Stairs: rise² + run² = stringer length²
NAVIGATION:
- Finding straight-line distance between two points on a map
- Calculating ship or aircraft heading distance
- GPS systems use Pythagorean math for 2D distance estimation
DESIGN AND TECHNOLOGY:
- TV and monitor sizes (diagonal measurement). A 'full HD' 16:9 TV with 1920×1080 pixels has a diagonal of √(1920² + 1080²) ≈ 2203 pixels
- Calculating cable/wire lengths for installations
- Phone screen size advertising
SPORTS:
- Baseball: distance from home plate to second base (with 90 feet between bases)
- 90² + 90² = 16,200
- √16,200 ≈ 127.3 feet - Diagonal of a tennis court, soccer field, basketball court
DAILY LIFE:
- Will that ladder reach that high window? (ladder = c, distance from wall = a, height to reach = b)
- Can you fit a 70-inch TV through a 65-inch door? (depends on diagonal vs. door diagonal)
- Calculating shortcuts across rectangular spaces
PHYSICS:
- Vector addition (combining forces or velocities perpendicular to each other)
- Distance and displacement calculations
- The relationship between resistance, reactance, and impedance in electrical circuits
Proving the Pythagorean theorem
There are over 350 known proofs of the Pythagorean theorem. The oldest surviving written one is Euclid, Elements, Book I, Proposition 47, which is the source cited for this page: it proves the squares on the two legs together equal the square on the hypotenuse, using areas rather than algebra. Here is one of the simplest visual proofs:
THE 'SQUARE WITHIN A SQUARE' PROOF:
- Draw a large square with side (a + b)
- Inside, draw four identical right triangles, each with legs a and b
- The triangles form a smaller square in the center with side c (the hypotenuse)
The area of the big square = (a + b)²
The big square equals: the inner square + the four triangles
(a + b)² = c² + 4(½ab)
a² + 2ab + b² = c² + 2ab
a² + b² = c² ✓
OTHER NOTABLE PROOFS:
- President James Garfield (1881) discovered a proof using a trapezoid
- Einstein supposedly came up with his own proof as a child
- Some proofs use algebra; others use only geometry
- Indian mathematician Bhaskara provided a simple 'Behold!' proof with no words
The variety of proofs shows the theorem's foundational importance. It connects geometry, algebra, and trigonometry. Almost every advanced math topic builds on it.
Common mistakes
- APPLYING IT TO NON-RIGHT TRIANGLES. The theorem ONLY works for triangles with a 90° angle. For other triangles, use the Law of Cosines.
- CONFUSING THE HYPOTENUSE. The hypotenuse is always the LONGEST side, opposite the right angle. If you label the wrong side as c, you'll get incorrect results. The hypotenuse is never one of the sides forming the right angle.
- FORGETTING TO TAKE THE SQUARE ROOT. After computing a² + b², many students give that as the answer. You need to take the square root to get the actual side length.
- SQUARE ROOT GIVING NEGATIVE OR IMAGINARY NUMBERS. If you're solving for a leg and the math gives a negative under the square root, you have made an error, usually treating a leg as the hypotenuse, or vice versa. The hypotenuse must be larger than either leg.
- UNITS CONSISTENCY. All three sides must be in the same units. You can't have a in feet and b in inches without converting first.
- ASSUMING IT WORKS IN 3D. Pythagoras works in 2D. For 3D distance, use d = √(x² + y² + z²) which is the theorem extended, but solved differently.
Related Calculators
Related Calculators
More tools from Education



