Pythagorean Theorem Calculator
Find the hypotenuse or a missing leg of a right triangle with a² + b² = c² shown step by step. Includes a 3D space-diagonal mode. Free, in your browser.
Pythagorean Theorem Calculator
Fill in any two sides — leave the one you want to find empty.
The space diagonal runs from one corner of a box to the opposite corner.
How to Use the Pythagorean Calculator
Enter two sides
For a right triangle, type any two of the three sides — the two legs (a and b) or one leg and the hypotenuse (c).
Leave the unknown blank
Leave the side you want to find empty. The calculator solves for it instantly using a² + b² = c².
Read the working
You get the answer with the formula filled in, so you can see exactly how the missing side was found — the hypotenuse or a leg.
Try the 3D mode
Switch to "3D box diagonal" to find the longest straight line inside a box from its length, width, and height — the theorem applied twice.
The Pythagorean Theorem
The Most Famous Equation in Geometry
The Pythagorean theorem is the rule that, in a right-angled triangle, the square of the longest side (the hypotenuse) equals the sum of the squares of the other two sides: a² + b² = c². It is probably the most recognisable equation in all of mathematics, and for good reason — it is the bridge between the lengths of a triangle and the right angle inside it, and from it flows the entire idea of distance. Knowing any two sides of a right triangle, you can always find the third: to find the hypotenuse, square the two legs, add them, and take the square root; to find a missing leg, subtract the known leg's square from the hypotenuse's square and take the root. This calculator does whichever you need automatically — just leave the unknown side blank — and shows the formula filled in so the method is clear, not hidden. It also enforces the one rule beginners forget: the hypotenuse is always the longest side, so it cannot be shorter than a leg.
What makes the theorem so useful is that "find the third side of a right triangle" is a question that hides inside an enormous range of practical problems. The straight-line distance between two points on a map or screen is a hypotenuse — which is exactly why the distance formula is just the Pythagorean theorem in disguise. Construction and carpentry rely on it constantly: the "3-4-5 rule" for squaring a corner is the theorem in its most famous whole-number form, since 3² + 4² = 5². Navigation, computer graphics, physics (resolving vectors into components), and even the diagonal of your television screen all come back to a² + b² = c². The theorem extends cleanly into three dimensions too: the longest diagonal through a box, corner to opposite corner, is found by applying the theorem twice, which the 3D mode here does for you from the length, width, and height.
"a² + b² = c² is the bridge between a right angle and a distance. Every straight-line distance you have ever measured is a hypotenuse in disguise."
Older Than Pythagoras
Although it carries Pythagoras's name from around 500 BC, the relationship was known and used much earlier — Babylonian clay tablets list Pythagorean triples (whole-number right triangles) more than a thousand years before him, and builders in Egypt and India used the 3-4-5 triangle to lay out right angles. What the Greeks added was proof: a demonstration that the relationship holds for every right triangle, not just the convenient whole-number ones, and that is the leap from a useful trick to a theorem. There are now hundreds of distinct proofs, including one by a future US president. For everyday work, though, the value is immediate and practical: whenever a right angle and two lengths meet, this calculator gives the third length instantly and privately in your browser, with the working shown — for homework, a building project, a design, or simple curiosity.
10 Facts About the Pythagorean Theorem
In a right triangle, a² + b² = c², where c is the hypotenuse.
The hypotenuse is always the longest side, opposite the right angle.
The 3-4-5 triangle is the most famous right triangle: 9 + 16 = 25.
The distance formula is just the Pythagorean theorem in disguise.
Whole-number right triangles are called Pythagorean triples.
Babylonians listed triples 1,000 years before Pythagoras.
Carpenters use the 3-4-5 rule to square a corner.
Applied twice, it gives the diagonal of a 3D box.
There are hundreds of proofs — one by a US president (Garfield).
It only holds for right-angled triangles — the Law of Cosines generalises it.
Frequently Asked Questions
- Enter the two legs (a and b) and leave the hypotenuse box empty. The calculator squares each leg, adds them, and takes the square root: c = √(a² + b²). For example, legs 3 and 4 give a hypotenuse of 5.
- Enter the hypotenuse and one leg, and leave the other leg empty. The calculator rearranges the formula to a = √(c² − b²). Remember the hypotenuse must be the longest side, so it has to be larger than the leg you enter, or the triangle is impossible.
- The hypotenuse is the side opposite the right angle, and it is always the longest of the three sides. The other two sides — the ones that meet at the right angle — are called the legs. The theorem only works when the triangle has a right angle.
- A Pythagorean triple is a set of three whole numbers that form a right triangle, like 3-4-5, 5-12-13, or 8-15-17. They are prized because everything comes out as whole numbers. The 3-4-5 triple is used by builders to check that a corner is square.
- The longest straight line inside a box — from one corner to the opposite corner — is found by applying the theorem twice, which simplifies to d = √(length² + width² + height²). Switch to 3D mode and enter the three dimensions; the calculator does the rest. It is useful for checking whether something fits diagonally inside a container.
- Yes — the straight-line distance between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical gaps between them. So the distance formula √((x₂−x₁)² + (y₂−y₁)²) is exactly the Pythagorean theorem applied to those gaps.
- The Pythagorean theorem only applies to right triangles. For triangles with any angles, use the Triangle Calculator, which uses the Law of Sines and Law of Cosines — the general versions that reduce to a² + b² = c² when the angle happens to be 90°.
- Yes. The calculation runs in your browser — nothing is uploaded, stored, or logged — and it works offline once loaded.
- Completely free, with no account, sign-up, or limit. It runs entirely in your browser and collects no data. Use it as often as you like.
- Yes. Any positive numbers work, whole or decimal — the calculator handles them and shows the result to high precision. Real measurements rarely come out as neat whole numbers, and the tool copes with that fine.
Related News
You may be interested in these recent stories from our newsroom.
No related news yet for this tool. Our editorial team publishes new pieces every week.
Browse all news →75 more free tools
Calculators, converters, security tools — no signup.