Education

Pythagorean Theorem Calculator

Last updated: June 19, 2026

Blake Boege
Written by Blake Boege · Founder, Calculator Answers

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.

bac
Result

Awaiting inputs

Was this helpful?

How it works

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:

  1. Square each leg
  2. Add them together
  3. 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:

  1. Square the hypotenuse
  2. Subtract the square of the known leg
  3. 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.

Real-world applications

The Pythagorean theorem isn't just a classroom exercise — it's 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 — 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. Here's one of the simplest visual proofs:

THE 'SQUARE WITHIN A SQUARE' PROOF:

  1. Draw a large square with side (a + b)
  2. Inside, draw four identical right triangles, each with legs a and b
  3. 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

  1. APPLYING IT TO NON-RIGHT TRIANGLES. The theorem ONLY works for triangles with a 90° angle. For other triangles, use the Law of Cosines.
  2. 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.
  3. 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.
  4. 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've made an error — usually treating a leg as the hypotenuse, or vice versa. The hypotenuse must be larger than either leg.
  5. 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.
  6. 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

Frequently asked questions

It states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. Mathematically: a² + b² = c², where c is the hypotenuse (the side opposite the 90° angle). It only works for right triangles.

Square both legs, add them, then take the square root. For legs of 3 and 4: 3² + 4² = 9 + 16 = 25, and √25 = 5. So the hypotenuse is 5. The calculator above does this instantly.

Square the hypotenuse, subtract the square of the known leg, then take the square root. For hypotenuse 13 and leg 5: 13² - 5² = 169 - 25 = 144, and √144 = 12. So the missing leg is 12.

Sets of three whole numbers that satisfy a² + b² = c². The most famous is 3-4-5. Others include 5-12-13, 8-15-17, 7-24-25, and 9-40-41. Any multiple of a triple also works (6-8-10, 9-12-15, etc.).

No, only right triangles (triangles with one 90° angle). For other triangles, use the Law of Cosines: c² = a² + b² - 2ab × cos(C), which reduces to the Pythagorean theorem when C = 90° because cos(90°) = 0.

Named after Pythagoras of Samos (around 570-495 BCE), a Greek philosopher and mathematician. However, the relationship was known to Babylonian, Indian, and Chinese mathematicians earlier. Pythagoras's school in Greece is credited with the first formal proof, which is why his name attached to it.

Constantly. Construction uses it to check square corners. Navigation uses it for distance calculations. TV/monitor sizes are diagonal measurements found with the theorem. Sports fields, ladder placements, cable lengths, and even GPS systems all rely on Pythagorean math.

That's normal and common. Most real-world measurements produce decimal hypotenuses. A 3×7 rectangle has a diagonal of √(3² + 7²) = √58 ≈ 7.6158. The calculator shows decimal results to 4 places by default; you can round to whatever precision you need.

The side length itself is always positive. If you set up the equation incorrectly (treating a leg as the hypotenuse, for instance), you might get a negative under the square root, which has no real solution. This is a signal that you've assigned the sides incorrectly — the hypotenuse must be longer than either leg.

The math is exact. The calculator uses standard arithmetic and the JavaScript Math.sqrt function, which is precise to about 15 decimal places. The 4-decimal display is just for readability — internally, the precision is much higher.