Geometry • Core Flagship Pillar

Pythagorean Theorem Calculator

Calculate the hypotenuse (c = √(a² + b²)) or missing leg (a = √(c² - b²)) of any right-angled triangle, verify integer Pythagorean triples, and visualize geometric dimensions with an interactive SVG right triangle canvas.

|
Last Updated: September 2026
|
Verified Euclidean Mathematical Proof

Enter Leg Lengths (a and b)

units
units
Popular Pythagorean Triples
Dynamic Right Triangle Visualizer
Hypotenuse (c)
5.00
c² = 25
Area (½ab)
6.00
sq units
Perimeter
12.00
total units
Angles (α, β)
36.87°, 53.13°
+ 90° right angle
∑

Step-by-Step Mathematical Derivation

Direct Answer & Overview
Verified Educational Guide

How to Calculate the Pythagorean Theorem

In any right-angled Euclidean triangle, the square of the hypotenuse c equals the sum of the squares of legs a and b: a² + b² = c². To solve for the hypotenuse, calculate c = √(a² + b²). To solve for an unknown leg, calculate a = √(c² − b²).

Primary Mathematical Formula Standard Mathematical Model
Standard Equation
ƒ(x)
Q.E.D.
a2+b2=c2  ⟹  c=a2+b2,a=c2−b2a^2 + b^2 = c^2 \implies c = \sqrt{a^2 + b^2}, \quad a = \sqrt{c^2 - b^2}
Evaluated with exact mathematical formulation • Rigorously verified
Exact Formula
Input Parameters
Required
1
Leg a (Base length) and Leg b (Height length) OR Hypotenuse c and one known leg
2
Positive numerical dimensions in consistent units (cm, m, in, ft)
Expected Outputs
Calculated
Hypotenuse length c or missing leg dimension
Interior acute angles (α and β), total perimeter, area (½ab), and Pythagorean triple status
Worked Numerical Example
Instant Verification
Right triangle with leg a = 3 and leg b = 4
→ c = √(3² + 4²) = √(9 + 16) = √25
c = 5 (3-4-5 Primitive Pythagorean Triple)

Fundamental Formula (a² + b² = c²) & Triangle Anatomy

The Pythagorean Theorem is one of the foundational relationships in Euclidean geometry. It establishes that for every triangle possessing a 90° right angle, the area of the square constructed on the hypotenuse (c²) is precisely equal to the sum of the areas of the squares constructed on the two adjacent perpendicular legs (a² + b²).

Leg a (Adjacent / Base)

The horizontal or base perpendicular leg forming the 90° vertex with leg b.

Leg b (Opposite / Height)

The vertical perpendicular leg. Together with leg a, legs enclose the right angle vertex C.

Hypotenuse c (Longest Side)

The side directly opposite the 90° angle. It is strictly the longest side in any right triangle (c > a and c > b).

Standard Algebraic Equation
a² + b² = c²

How to Calculate Hypotenuse vs. Missing Legs

Depending on which two dimensions are known, the Pythagorean Theorem provides distinct algebraic equations for computing the missing third side:

Solving for Hypotenuse (c)

When both perpendicular legs (a and b) are given:

c = √(a² + b²)
  1. Square leg a (a²) and square leg b (b²).
  2. Add the two squares together (a² + b²).
  3. Take the positive square root of the sum.

Solving for Missing Leg (a or b)

When the hypotenuse (c) and one leg are known:

a = √(c² − b²), b = √(c² − a²)
  1. Square the hypotenuse (c²) and the known leg (b²).
  2. Subtract the leg square from hypotenuse square (c² − b²).
  3. Take the positive square root of the difference.

Classic Mathematical Proofs of a² + b² = c²

Over 370 distinct mathematical proofs have been recorded for the Pythagorean Theorem, ranging from Euclidean geometry to algebraic rearrangements and differential equations:

Proof by Algebraic Square Expansion

Consider a large square of side (a + b) enclosing 4 identical right triangles of area ½ab around an interior tilted square of side c:

Total Area = (a + b)² = a² + 2ab + b²
Sum of Parts = 4 × (½ab) + c² = 2ab + c²
a² + 2ab + b² = 2ab + c² ==> a² + b² = c²

Euclid’s Windmill Proof (Elements Book I, Proposition 47)

Euclid demonstrated the theorem by dropping an altitude from the right angle to the hypotenuse, splitting the square on the hypotenuse into two rectangles whose respective areas equal the squares on the two adjacent legs using triangle congruences.

Pythagorean Triples & Euclid’s Generating Formula

A Pythagorean Triple consists of three positive integers (a, b, c) satisfying a² + b² = c². If gcd(a, b, c) = 1, the triple is called primitive.

Primitive Triple (a, b, c) Leg Squares (a² + b²) Hypotenuse Square (c²) Area (½ab)
(3, 4, 5)9 + 16 = 25256 sq units
(5, 12, 13)25 + 144 = 16916930 sq units
(8, 15, 17)64 + 225 = 28928960 sq units
(7, 24, 25)49 + 576 = 62562584 sq units
(9, 40, 41)81 + 1600 = 16811681180 sq units
(11, 60, 61)121 + 3600 = 37213721330 sq units
(20, 21, 29)400 + 441 = 841841210 sq units
Euclid's Formula for Generating Triples

For any two integers m > n > 0:

a = m² − n², b = 2mn, c = m² + n²

3D Distance Formula & Space Diagonals

The Pythagorean Theorem generalizes directly to 3D Cartesian coordinates. To find the distance between two points (x₁, y₁, z₁) and (x₂, y₂, z₂), apply the 2D theorem twice sequentially:

d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]

For a rectangular box with length L, width W, and height H, the interior space diagonal is d = √(L² + W² + H²).

Real-World Applications of the Pythagorean Theorem

Carpentry & Construction (3-4-5 Rule)

Framers and bricklayers measure 3ft and 4ft along perpendicular foundation lines to ensure the 5ft diagonal guarantees a true 90-degree square corner.

Navigation & GPS Triangulation

Marine navigation and flight planning systems calculate straight-line Euclidean distances and crosswind drift vectors using Cartesian Pythagorean offsets.

Television & Display Screen Sizing

Televisions and monitors are marketed by their diagonal measurement. With a 16:9 aspect ratio, screen height and width are derived directly via the Pythagorean theorem.

Graded Step-by-Step Worked Examples

Example 1: Finding Missing Hypotenuse Basic

Problem: Find hypotenuse c if leg a = 6 cm and leg b = 8 cm.

1. c = √(a² + b²)
2. c = √(6² + 8²) = √(36 + 64) = √100
3. c = 10 cm (Multiple of 3-4-5 triple)
Example 2: Finding Missing Leg Intermediate

Problem: A 13-foot ladder leans against a vertical wall. If the base of the ladder is 5 feet from the wall, how high up the wall does it reach?

1. Knowns: Hypotenuse c = 13 ft, base leg a = 5 ft. Solve for vertical height b.
2. b = √(c² − a²) = √(13² − 5²) = √(169 − 25) = √144
3. b = 12 feet (5-12-13 Primitive Triple)

Common Pitfalls & Calculation Mistakes

Applying Theorem to Non-Right Triangles

The equation a² + b² = c² fails for acute or obtuse triangles. Always check that an exact 90° right angle is present before calculating.

Subtracting Under the Radical Incorrectly

When solving for a missing leg, you must subtract (c² − a²), not add. Adding results in a leg longer than the hypotenuse, which is geometrically impossible.

Confusing (a + b) with √(a² + b²)

√(a² + b²) ≠ a + b. The square root of a sum is strictly less than the sum of square roots (e.g. √(9 + 16) = 5 ≠ 3 + 4 = 7).

Fact-Checked & Verified • Computational Accuracy Standards
Updated August 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is the Pythagorean Theorem and what is the exact formula?
The Pythagorean Theorem is a fundamental principle in Euclidean geometry stating that in any right-angled triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the other two legs: a² + b² = c² (or c = √(a² + b²)).
How do you find a missing leg when given the hypotenuse and one side?
To solve for a missing leg (a or b), rearrange the formula by subtracting the square of the known leg from the square of the hypotenuse: a = √(c² − b²) or b = √(c² − a²). For example, if c = 10 and a = 6, then b = √(100 − 36) = √64 = 8.
What is a Pythagorean Triple?
A Pythagorean Triple consists of three positive integers (a, b, c) that perfectly satisfy a² + b² = c². The most famous primitive triples are (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), and (9, 40, 41). Any integer multiple of these triples (such as 6-8-10 or 9-12-15) also forms a valid right triangle.
Does the Pythagorean Theorem work for non-right triangles (acute or obtuse)?
No. The theorem strictly applies to right triangles with a 90° angle. For acute triangles, a² + b² > c²; for obtuse triangles, a² + b² < c². For general non-right triangles, you must use the Law of Cosines: c² = a² + b² − 2ab·cos(C).
How is the Pythagorean Theorem applied in three-dimensional (3D) space?
In 3D Cartesian coordinates or for rectangular prisms (boxes), the space diagonal d is computed by extending the theorem: d = √(x² + y² + z²). This calculates the straight-line distance between opposite corners across 3D space.
How do carpenters and builders use the 3-4-5 rule in construction?
Builders verify that corners are square (exact 90° right angles) by measuring 3 feet along one wall, 4 feet along the perpendicular wall, and checking if the diagonal distance between the marks is exactly 5 feet. If the diagonal is 5 feet, the corner is perfectly square.