Pythagorean Theorem Calculator

Enter any two sides of a right triangle and the theorem hands you the third, together with the area, perimeter, both acute angles, a scaled drawing, and a checker that tests whether any three sides form a right triangle at all.

What you get
  • Find any missing sideHypotenuse from two legs, or a leg from the hypotenuse.
  • Right-triangle checkerTest three sides against a² + b² = c².
  • Triple table built livePrimitive Pythagorean triples computed, not hardcoded.

What do you know?

Results update as you type

The two legs a and b meet at the right angle; the hypotenuse c sits opposite it and is always the longest side.

Runs entirely in your browser. Nothing you type is sent or saved

Pythagorean theorem guide

The theorem in one line

In any right triangle, the square of the longest side equals the squares of the other two sides added together. That is the whole statement, and everything on this page flows from it:

a2 + b2 = c2

a and b the legs that meet at the right angle · c the hypotenuse opposite it

The classic example makes it concrete. Legs of 3 and 4 give 3² + 4² = 9 + 16 = 25, and since the hypotenuse squared is 25, the hypotenuse is √25 = 5. The 3-4-5 triangle is the most famous of the Pythagorean triples, whole-number sets that satisfy the equation exactly, and rope stretches of 3-4-5 knots were used to mark square corners thousands of years before anyone wrote the theorem down.

Finding a missing leg

The equation rearranges just as happily in the other direction. When the hypotenuse and one leg are known, subtract instead of add:

b = √(c2 - a2)

equivalently a = √(c² - b²), whichever leg is missing

Worked example: a hypotenuse of 5 and a leg of 3 give b = √(25 - 9) = √16 = 4. The subtraction is why the hypotenuse must be the larger number: if c were smaller than a, the quantity under the root would turn negative, and a real triangle cannot have a side shorter than the one it must outstretch.

The converse: checking whether a triangle is right

The theorem also runs in reverse. If three side lengths satisfy a² + b² = c², the triangle containing them must have a right angle between the two shorter sides. That is the converse of the theorem, and it is how carpenters and surveyors check squareness: mark three lengths, pull the tape, and let the arithmetic decide.

The test rejects impostors cleanly. Sides 3, 4 and 6 give 3² + 4² = 25 but 6² = 36, and 25 ≠ 36, so no right angle is present: that triangle is obtuse, because its longest side stretches further than a right angle would allow. Sides shorter than perfect would signal an acute triangle. The checker mode of this calculator runs exactly this test and reports the two squared totals side by side.

What the hypotenuse is

The hypotenuse is the side opposite the right angle, and in every right triangle it is the longest side. Two facts follow that are worth keeping in mind when using any calculator like this one. First, the hypotenuse is always greater than either leg but always less than their sum, because a triangle's sides must close: for legs 3 and 4, c sits strictly between 4 and 7. Second, doubling every side doubles the hypotenuse, so a 6-8-10 triangle is just a scaled-up 3-4-5. Every multiple of a triple is a triple, which is why the table in the results shows the scaled versions alongside each primitive one.

The distance formula is the Pythagorean theorem

The distance formula from coordinate geometry looks like a separate piece of mathematics, but it is this theorem wearing coordinates. The horizontal separation between two points and the vertical separation form the legs of a right triangle; the straight-line distance is its hypotenuse:

d = √[(x2 - x1)2 + (y2 - y1)2]

each squared difference is one leg squared

Points (1, 2) and (4, 6) differ by 3 across and 4 up, so the distance is √(9 + 16) = 5, the same 3-4-5 triangle shifted onto a grid. The same idea powers GPS range estimates, game hit detection and every "as the crow flies" distance you have ever been shown on a map.

When the answer is irrational

Most right triangles are not triples. Legs of 1 and 1 give c = √2 = 1.4142135..., a number whose decimals run forever without repeating. This is not a rounding failure; the theorem genuinely produces irrational lengths, and legend has it their discovery so troubled the Pythagoreans that they tried to keep it secret. In practice, decide the precision your task needs before you round: a carpenter works in sixteenths of an inch, a surveyor in hundredths of a foot, and this calculator displays two decimals by default while computing at full precision internally.

One proof in a sentence: four copies of any right triangle tile a big square of side a + b, leaving a tilted square of side c in the middle; rearranging the same four triangles leaves two squares of sides a and b instead, and since nothing was added or removed, the tilted square's area c² must equal a² + b². Hundreds of other proofs exist, more than for any other theorem in mathematics.

Using the calculator well

  • Pick the mode that matches the unknown: two legs and a missing hypotenuse belongs in "Find hypotenuse"; a hypotenuse and one leg belongs in "Find a leg". The "Check a triangle" mode ignores right angles entirely and just tests the three sides you give it.
  • The ladder problem: a 20-foot ladder with its base 12 feet from a wall reaches √(20² - 12²) = √256 = 16 feet up the wall. Any "how high does it reach" question is a missing-leg problem.
  • Screen sizes are hypotenuses: a 55-inch 16:9 television measures 47.94 inches wide and 26.96 inches tall, and √(47.94² + 26.96²) = √3,025.08 ≈ 55. The diagonal you shop by is the hypotenuse of the screen's own right triangle.
  • Units must match: enter both legs in the same unit and every output inherits it, with area in square units. Convert first, calculate second.
  • Read the substituted equation: the results panel rewrites a² + b² = c² with your numbers in place, which is the fastest way to spot a typo before trusting the answer.
  • Whole numbers are the exception: if you need a triple for a layout or a lesson, start from the table below rather than hunting for one; every primitive triple scales to any size by multiplication.

A short history

The mathematics is far older than its name. A Babylonian clay tablet known as Plimpton 322, dated around 1800 BC, lists a column of Pythagorean triples including some with four-digit sides, which means Babylonian scribes understood the relationship a millennium before Pythagoras lived. Chinese and Indian texts of similar age contain the same rule, the Chinese one stated as "the gou multiplied by itself, the gu multiplied by itself, added together, open the square and take the hypotenuse".

Pythagoras of Samos, teaching around 500 BC, is credited with the first general proof, and his school's discovery that √2 cannot be written as any fraction broke their number-based worldview and opened the door to irrational numbers. Euclid's Elements devoted an entire book, Book I Proposition 47, to a rigorous geometric proof, and the theorem has since been re-proven hundreds of times, by a young Albert Einstein among many others. It remains the most proven statement in all of mathematics.

Common questions

In a right triangle, the longest side squared equals the two shorter sides squared and then added: a² + b² = c². Equivalently, the square drawn on the hypotenuse has exactly the same area as the two squares drawn on the legs combined, which is how the Greeks pictured it.

Yes. The equation holds exactly when one angle is 90 degrees. For other triangles the law of cosines generalizes it: c² = a² + b² - 2ab·cos C, and the theorem is the special case where the angle C is 90 degrees so the correction term vanishes.

Because c² equals a² + b², which is strictly more than a² alone or b² alone whenever both legs are positive, so c beats each leg. If you find your computed "hypotenuse" is shorter than a leg, a swapped entry or a typo is the cause, and the calculator will flag the negative value under the square root.

It is a set of three whole numbers that satisfies the theorem exactly, like 3-4-5 or 5-12-13. Multiplying any triple by a whole number gives another triple, so 6-8-10 and 9-12-15 are scaled copies of the first. The results panel generates the small primitive triples live so you can pick one that fits your measurements.

Square the two shorter sides and add them, then square the longest side and compare. Equal totals mean a right triangle. For 3, 4, 6 the sums are 25 and 36, so it is not right. Use the "Check a triangle" mode and the two totals appear side by side with the verdict.

Because most square roots are irrational, meaning their decimals never end or repeat. Only triples produce whole-number hypotenuses; everything else, like the √2 that comes from 1-1 legs, is an exact number that decimal notation can only approximate. The calculator computes at full precision and rounds the display, so downstream calculations stay accurate.

Twice, actually. Apply it once to collapse two coordinates into a flat diagonal, then once more with the third coordinate to get the space diagonal: d² = x² + y² + z². A box of 2 by 3 by 6 has a space diagonal of √49 = 7, which is the theorem applied to the face diagonal and the remaining edge.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Two sides in. The third, proven.

Browse all math calculators