Pythagorean Theorem Calculator

Calculate the missing side of a right triangle using the Pythagorean theorem. Includes step-by-step solutions, diagrams, and a right triangle checker.

Find the missing side of a right triangle using the Pythagorean theorem (a² + b² = c²). Enter any two sides to calculate the third, or enter all three sides to check if they form a right triangle. Every calculation shows a full step-by-step solution with an interactive diagram.

Ad
Ad

About Pythagorean Theorem Calculator

The Pythagorean Theorem

In any right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides:

a² + b² = c²

This gives three formulas depending on which side you are solving for:

FindFormulaExample (a=3, b=4)
Hypotenuse (c)c = √(a² + b²)c = √(9 + 16) = √25 = 5
Leg aa = √(c² - b²)a = √(25 - 16) = √9 = 3
Leg bb = √(c² - a²)b = √(25 - 9) = √16 = 4

Worked Examples

Example 1: A ladder leans against a wall. The base is 6 feet from the wall and the ladder is 10 feet long. How high does it reach?

  • a = 6 (base), c = 10 (ladder = hypotenuse)
  • b = √(10² - 6²) = √(100 - 36) = √64 = 8 feet

Example 2: A TV is advertised as 55 inches (diagonal). It is 48 inches wide. What is the height?

  • c = 55 (diagonal), a = 48 (width)
  • b = √(55² - 48²) = √(3025 - 2304) = √721 = 26.9 inches

Example 3: Walking diagonally across a rectangular field that is 300m by 400m:

  • Diagonal = √(300² + 400²) = √(90,000 + 160,000) = √250,000 = 500m
  • The diagonal saves 200m compared to walking two sides (300 + 400 = 700m)

Common Pythagorean Triples

Pythagorean triples are sets of three whole numbers that satisfy a² + b² = c². Memorizing a few helps with quick mental calculations:

TripleCommon Multiples
3 - 4 - 5916256-8-10, 9-12-15, 12-16-20, 15-20-25
5 - 12 - 132514416910-24-26, 15-36-39
8 - 15 - 176422528916-30-34
7 - 24 - 254957662514-48-50
20 - 21 - 2940044184140-42-58
9 - 40 - 41811600168118-80-82

Any multiple of a Pythagorean triple is also a triple. The 3-4-5 triple (and its multiples) is by far the most commonly used in construction and everyday calculations.

The 3-4-5 Rule in Construction

Builders use the 3-4-5 triple to check right angles. To verify a corner is square: measure 3 feet along one wall, 4 feet along the other, and the diagonal should be exactly 5 feet. For larger areas, use multiples like 6-8-10 or 9-12-15 for better accuracy. This technique dates back thousands of years - ancient Egyptian rope-stretchers used knotted ropes in 3-4-5 ratios to survey land along the Nile.

Brief History

The theorem is named after the Greek mathematician Pythagoras (~570-495 BC), but the relationship was known much earlier. A Babylonian clay tablet (Plimpton 322, ~1800 BC) lists 15 Pythagorean triples. Ancient Indian and Chinese mathematicians also knew the theorem. Over 400 distinct proofs have been published, including one by US President James Garfield (1876) using a trapezoid construction.

Beyond Right Triangles

For non-right triangles, the Pythagorean theorem does not apply directly. Instead, use:

  • Acute triangle (all angles less than 90°): a² + b² > c² for all sides
  • Obtuse triangle (one angle greater than 90°): a² + b² < c² where c is opposite the obtuse angle
  • The law of cosines generalizes the theorem: c² = a² + b² - 2ab cos(C). When C = 90°, cos(C) = 0 and you get the Pythagorean theorem

For general triangle solving, the triangle calculator handles SSS, SAS, and ASA modes. For function plotting including geometric shapes, the graphing calculator provides a full coordinate system.

Converse of the Theorem

The converse is equally useful: if the three sides of a triangle satisfy a² + b² = c², the triangle must contain a right angle opposite the longest side. Euclid proved this as Proposition 48 of Book I of the Elements around 300 BC, immediately after the forward direction (Proposition 47). The "Is it a right triangle?" mode above uses the converse - it sorts the three inputs, treats the largest as the candidate hypotenuse, and checks whether the squared relationship holds within floating-point tolerance of 1e-8.

A practical consequence: any triangle with sides in a Pythagorean-triple ratio is guaranteed to be right-angled. Surveyors, carpenters, and masons rely on this to lay out square corners without a protractor. The forward theorem gives you lengths; the converse gives you angles.

Connection to the Distance Formula

The distance formula in coordinate geometry is the Pythagorean theorem applied to a right triangle drawn between two points. For points (x₁, y₁) and (x₂, y₂) in the plane:

d = √((x₂ - x₁)² + (y₂ - y₁)²)

The horizontal leg has length |x₂ - x₁|, the vertical leg has length |y₂ - y₁|, and d is the hypotenuse. This is why every course that introduces coordinate geometry teaches the Pythagorean theorem first. The formula extends to any number of dimensions - in 3D, add a z-squared term; in n dimensions, sum the squares of all n coordinate differences and take the square root. GPS positioning, computer graphics, and machine-learning distance metrics (Euclidean distance) all rest on this extension.

3D Extension: Space Diagonal of a Box

The theorem extends cleanly to three dimensions. For a rectangular box with edges of length a, b, and c, the main diagonal (corner to opposite corner through the interior) is:

d = √(a² + b² + c²)

Worked example: a removal box 60 cm wide, 40 cm deep, 30 cm tall has a longest internal diagonal of √(3,600 + 1,600 + 900) = √6,100 ≈ 78.1 cm. This matters when checking whether a long item (like a curtain rod or framed picture) will fit in a box or a car boot. Furniture retailers use the same calculation to pack flat-pack items so the longest dimension lies along the diagonal rather than the side.

This same formula gives the magnitude of any 3D vector. For the 2D version, use the standard theorem. For the n-D version used in data science, sum all the squared components and take the square root.

Where the Theorem Shows Up in Real Life

FieldTypical UseWhy the Theorem Fits
ConstructionSquaring foundations, framing walls3-4-5 rule checks a true 90° corner without a protractor
NavigationStraight-line distance from bearingsConverts "5 miles north, 12 miles east" into 13 miles as the crow flies
SurveyingBaseline and offset measurementsHandles terrain where direct measurement is blocked
Computer graphicsPixel distance, vector lengthDistance between points is the 2D/3D hypotenuse
PhysicsResolving perpendicular force or velocity componentsResultant magnitude = √(Fx² + Fy²)
ElectronicsImpedance in an AC circuitZ = √(R² + X²) where R is resistance and X is reactance
Satellite navigationGPS trilateration fallback mathsDistance between receiver and satellite uses the 3D version
Machine learningEuclidean distance between feature vectorsk-nearest-neighbour and many clustering algorithms depend on it

How Many Proofs Are There?

Elisha Scott Loomis collected 370 distinct proofs in "The Pythagorean Proposition" (first edition 1928, second edition 1940), grouped into four categories: algebraic (109), geometric (255), quaternionic (4), and dynamic (2). Modern counts exceed 400. The most elegant is usually considered the "rearrangement proof" - cut two identical squares of side (a+b) into four right triangles plus either one square of side c or two squares of side a and b. Since the two dissections cover equal areas, c² must equal a² + b².

In 2023 two New Orleans high-school students, Calcea Johnson and Ne'Kiya Jackson, presented a trigonometric proof at the American Mathematical Society Southeastern Sectional Meeting - a category long thought impossible because trigonometry is built on the theorem itself. Their paper "Five or Ten New Proofs of the Pythagorean Theorem" appeared in The American Mathematical Monthly Vol 131 No 9 on 28 October 2024, drawing widespread coverage in The New York Times and Science News.

Common Mistakes When Applying the Theorem

  • Using the theorem on a non-right triangle: the formula only works when one angle is exactly 90°. For any other triangle, use the law of cosines. If you are not sure whether a triangle is right-angled, use the check mode above.
  • Mixing up hypotenuse and leg: c is always the longest side, opposite the right angle. Swapping c with a leg produces nonsensical results like a negative number under the square root.
  • Forgetting to square-root the final answer: the formula gives c² = 25, but the question asks for c = 5. Students often stop one step too early.
  • Unit mismatch: all three sides must be in the same unit. Mixing feet and inches without converting first is a very common source of error on construction sites.
  • Rounding early: if a = √2 and b = √3, compute c = √5 symbolically rather than rounding each side to 1.41 and 1.73 first. Early rounding can push the answer off by a few percent.
  • Assuming Pythagorean triples are the only right triangles: any right triangle satisfies the theorem, but most have irrational sides. Triples like 3-4-5 are special because all three sides happen to be whole numbers.

Practice Problems With Solutions

Use the calculator above to check your working on each:

  1. A rectangular TV screen is 40 in by 22.5 in. What is the diagonal? Answer: √(40² + 22.5²) = √2,106.25 ≈ 45.9 in. TV sizes are always quoted as the diagonal, so this is a 46-inch TV.
  2. A 25 ft ladder leans against a wall with the base 7 ft from the wall. How high does it reach? Answer: √(25² - 7²) = √576 = 24 ft. This is a 7-24-25 triple, one of the common integer triples.
  3. Two cyclists start from the same point. One rides 9 km north, the other rides 12 km east. How far apart are they? Answer: √(9² + 12²) = √225 = 15 km. This is a 3×(3-4-5) triple.
  4. A square has a diagonal of 10 cm. What is the side length? Answer: for a square, both legs equal s, so 2s² = 10², giving s = 10/√2 ≈ 7.07 cm. The diagonal of a unit square, √2, is the classic example of an irrational number.

Try these in the calculator to confirm the worked answers, then try variations of your own to build fluency. For quadratic-equation practice linked to the theorem (e.g. "find the leg x in a triangle where x² + (x+1)² = 25²"), the quadratic calculator handles the algebra once you have set up the equation.

All calculations run in your browser. No data is sent to a server.

Sources

Frequently Asked Questions

What is the Pythagorean theorem?

The Pythagorean theorem states that in a right triangle, the square of the hypotenuse (c) equals the sum of the squares of the other two sides (a and b). Written as a squared plus b squared equals c squared.

How do I find the hypotenuse?

Enter the two legs (a and b) and the calculator will compute c as the square root of (a squared plus b squared). For example, with legs 3 and 4, the hypotenuse is 5.

How do I find a missing leg?

Switch to Find a leg mode, enter the known leg and the hypotenuse, and the tool calculates the missing leg using a = square root of (c squared minus b squared).

What is a Pythagorean triple?

A Pythagorean triple is a set of three whole numbers that satisfy the theorem. Common triples include 3-4-5, 5-12-13, and 8-15-17. Any multiple of a triple (like 6-8-10) also works.

Can I check if three sides form a right triangle?

Yes. Switch to the check mode, enter all three sides, and the tool will verify whether the squared values satisfy the Pythagorean relationship.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/pythagorean-theorem-calculator/" title="Pythagorean Theorem Calculator - Free Online Tool">Try Pythagorean Theorem Calculator on ToolboxKit.io</a>