Skip to content

Pythagorean Theorem Calculator

Math & Calculators ·
·

Solve a right triangle for any side, hypotenuse from two legs, or one leg from the other and the hypotenuse.

Primitive Pythagorean triples up to c = 130

These are the primitive triples: whole-number side lengths with no common factor, so a² + b² = c² holds exactly. Any multiple works too, which is why builders square corners with 3-4-5 scaled up to 6-8-10 or 30-40-50: same triangle, bigger tape measure.

a b c (hypotenuse)
3 4 5
5 12 13
8 15 17
7 24 25
20 21 29
12 35 37
9 40 41
28 45 53
11 60 61
16 63 65
a b c (hypotenuse)
33 56 65
48 55 73
13 84 85
36 77 85
39 80 89
65 72 97
20 99 101
60 91 109
15 112 113
44 117 125

What this solves

The Pythagorean theorem says a² + b² = c² for any right triangle, where c is the hypotenuse (the side opposite the right angle) and a, b are the two legs. Know two of the three sides and you can solve for the third.

The calculator handles all three cases. Pick which side to solve for, type in the other two, and the answer lands in the matching box. The equation panel shows the math worked out, so you can copy it for homework or sanity-check your inputs.

Three problem types

Both legs known, find the hypotenuse. The most common case in basic geometry. With a = 3 and b = 4, c = √(9 + 16) = √25 = 5, the classic 3-4-5 triangle.

Hypotenuse and one leg known, find the other leg. Rearrange to a = √(c² - b²). The hypotenuse has to be longer than either leg, or the math goes complex when the value under the root turns negative.

Same setup, solving for the opposite leg. Symmetric to the case above, just swap which leg you’re after.

Where it comes up off the page

Beyond classroom problems, this math shows up in a few reliable places:

  • Squaring a corner on a build. Mark 3 feet down one wall, 4 feet down the other, and the diagonal between the marks should read exactly 5 feet. Dead-on means the corner is 90 degrees. Off means you adjust until it lands.
  • Straight-line distance between two points. Latitude and longitude differences are the legs; the direct distance is the hypotenuse, as long as the span is short enough to ignore Earth’s curvature.
  • Screen and furniture diagonals. A 16:9 monitor with a 27-inch diagonal measures roughly 23.5 by 13.2 inches across and tall.

Integer-sided right triangles

A handful of right triangles come out to whole numbers on all three sides. The table above lists every primitive triple up to a hypotenuse of 130, opening with 3-4-5 and running through 5-12-13, 8-15-17, 7-24-25, and stranger ones like 20-99-101. “Primitive” means the three numbers share no common factor. Scale any of them and you get another valid triple: 6-8-10 and 9-12-15 are both just the 3-4-5 triangle enlarged. There are infinitely many primitives, and Euclid’s formula has been spitting them out from pairs of integers since roughly 300 BC.

Common mistakes

The big one: the hypotenuse must be the longest side. Enter a hypotenuse shorter than one of the legs and you’ll get an error or a complex result, so always check that c > a and c > b.

Second, the theorem only works on right triangles. Without a 90 degree angle, reach for the Law of Cosines instead: c² = a² + b² - 2ab·cos(C).

Third, keep your units consistent. Mixing feet for one leg and meters for the other produces a hypotenuse that means nothing.

Answers to common questions

What is the 3-4-5 rule?

It’s a builder’s trick for checking a square corner: measure 3 units along one edge, 4 along the other, and if the diagonal between those marks is exactly 5, the corner is a true 90 degrees. That’s the 3-4-5 triangle used as a field tool, no protractor needed. Multiples work the same way, so 6-8-10 or 9-12-15 give you a larger, easier-to-measure version.

How do I find b when I know a and c?

Rearrange to b = √(c² - a²). Square the hypotenuse, subtract the square of the known leg, and take the root. With c = 13 and a = 5, that’s √(169 - 25) = √144 = 12, the 5-12-13 triangle. The hypotenuse has to be the larger number, or you’ll get a negative under the root.

Is 6-8-10 a Pythagorean triple?

Yes. 6² + 8² = 36 + 64 = 100 = 10², so it satisfies the theorem. It isn’t primitive, though. It’s the 3-4-5 triangle scaled by 2, which is why it doesn’t appear in the primitives table above, since that list only holds triples with no shared factor.

What if my triangle isn’t a right triangle?

Then Pythagorean doesn’t apply. For oblique triangles, use the Law of Cosines (which generalizes it to any angle) or the Law of Sines (which ties ratios of sides to sines of the opposite angles).

Can I solve for an angle with it?

No, Pythagorean alone only relates side lengths, not angles. For angles in a right triangle, use trigonometry: sin(angle) = opposite/hypotenuse, cos = adjacent/hypotenuse, tan = opposite/adjacent.

Why does the calculator show four decimal places?

Because most real Pythagorean answers are irrational and square roots rarely land on whole numbers. Four decimals is precise enough for engineering and homework without cluttering the result.

Does the theorem work in 3D?

Yes, in the form d² = x² + y² + z². For the diagonal of a rectangular box, square each dimension, add them, and take the root. Same idea, one extra term.

pythagorean theorem geometry right-triangle math

Related Tools

More in Math & Calculators

Body Fat Calculator

Estimate body fat percentage using the US Navy circumference method, needs only a tape measure, no calipers or DEXA scan.

Breathing Exercise

A guided breathing pacer with a circle that grows and shrinks through inhale, hold, exhale, hold. Box 4-4-4-4, 4-7-8, or your own counts.

Calorie Calculator

Get your daily calorie target, BMR, TDEE, and macros, based on age, weight, height, activity, and whether you're cutting, maintaining, or bulking.

Compound Interest Calculator

Calculate compound interest with year-by-year breakdown

Crypto Profit Calculator

Work out crypto profit or loss from buy price, sell price, and quantity. Factor in exchange fees and see your ROI plus the break-even sell price.

Currency Converter

Convert between 35+ world currencies with sample exchange rates

Date Difference Calculator

Calculate the exact difference between two dates in multiple units

Days Until Calculator

Live countdown to any date with days, hours, minutes, and seconds

DCA Calculator

Model dollar-cost averaging. Enter a fixed amount per period, the number of buys or a price list, and a current price to see units, cost basis, and profit.

Dog Years Calculator

Convert dog age to human equivalent (or back) using the size-aware AVMA formula instead of the old "× 7" myth.

Discount Calculator

Find the sale price from a discount percentage, or work backwards from two prices to figure out what percent off you actually got.

Electricity Cost Calculator

Work out what each appliance costs to run. Enter watts, hours, and your kWh rate to see cost per day, month, and year, then total every device.

View all 73Math & Calculators