Math · Live
Pythagorean Theorem Calculator,
solve for any side of a right triangle.
Enter any two sides of a right triangle and instantly find the third, hypotenuse or either leg. See a proportional diagram, full angle calculations, area, perimeter, and a step-by-step solution using a² + b² = c².
Inputs
Right triangle sides
Formula
a² + b² = c²
c = √(a² + b²)
Pythagorean triples
- a
- 3
- b
- 4
- c (hypotenuse)
- 5
- Area
- 6
- Perimeter
- 12
Hypotenuse c
a² + b² = c²
c = √(3² + 4²) = √25
Triangle diagram
Proportional right triangle
Leg a
3
Leg b
4
Hypotenuse c
5
Angle α (at A)
53.1301°
Between a and c
Angle β (at B)
36.8699°
Between b and c
Right angle
90.000000°
Between a and b
Area
6
½ · a · b
Perimeter
12
a + b + c
Step by step
Full solution walkthrough
- 1
Write the theorem
a² + b² = c²
- 2
Substitute values
3² + 4² = c²
- 3
Compute squares
9 + 16 = c²
- 4
Add
25 = c²
- 5
Take the square root
c = √25 = 5
- 6
Verify
3² + 4² = 25 ≈ 25 = 5² ✓
- 7
Angles
α = arctan(b/a) = 53.1301°, β = arctan(a/b) = 36.8699°, γ = 90°
- 8
Area
A = ½ × a × b = ½ × 3 × 4 = 6
- 9
Perimeter
P = a + b + c = 3 + 4 + 5 = 12
Geometry guide
The Pythagorean theorem: what it says and why it works.
The Pythagorean theorem is one of the oldest and most widely applied results in all of mathematics. It states that in any right triangle, a triangle containing exactly one 90° angle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the two legs:
where a and b are the legs and c is the hypotenuse. This relationship holds for every right triangle, regardless of its shape or size.
The three solve cases
The theorem can be rearranged to solve for any of the three sides:
- Find the hypotenuse c (given both legs):
c = √(a² + b²) - Find leg a (given b and c):
a = √(c² − b²)(valid only when c > b) - Find leg b (given a and c):
b = √(c² − a²)(valid only when c > a)
The constraint that c must exceed either leg follows directly from the theorem: if c ≤ b then c² − b² ≤ 0, and the square root of a non-positive number is not a real number. In geometric terms, the hypotenuse is always the longest side.
Pythagorean triples: exact integer solutions
A Pythagorean triple is a set of three positive integers (a, b, c) satisfying the theorem exactly, no irrational numbers involved. The most famous is 3–4–5:
Every Pythagorean triple can be generated from two positive integers m > n > 0 using Euclid’s formula:
Common Pythagorean triples you will encounter:
| Triple (a, b, c) | Verification | Common use |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | Carpentry, tiling |
| 5, 12, 13 | 25 + 144 = 169 | Surveying |
| 8, 15, 17 | 64 + 225 = 289 | Engineering |
| 7, 24, 25 | 49 + 576 = 625 | Navigation |
| 20, 21, 29 | 400 + 441 = 841 | Architecture |
| 9, 40, 41 | 81 + 1600 = 1681 | Advanced geometry |
| 6, 8, 10 | 36 + 64 = 100 | Scaled 3–4–5 |
| 12, 35, 37 | 144 + 1225 = 1369 | Roof framing |
Primitive vs. non-primitive triples
A triple is primitive when its three numbers share no common factor greater than 1 — gcd(a, b, c) = 1. 3–4–5 is primitive. 6–8–10 is not: it is exactly 2 × (3, 4, 5), a non-primitive (scaled) triple. Every Pythagorean triple is an integer multiple of exactly one primitive triple, so the primitives are the only ones that actually need generating — everything else is just a multiple of one of them.
Euclid’s formula only generates a primitive triple when its two parameters meet three conditions: m > n > 0, gcd(m, n) = 1 (coprime), and m and n have opposite parity (one even, one odd). Miss the parity condition and the formula still produces a valid triple — just not a primitive one. For example, m = 3, n = 1 are coprime but both odd:
(8, 6, 10) is a genuine triple (8² + 6² = 64 + 36 = 100 = 10²), but it is just 2 × (4, 3, 5) — non-primitive, precisely because the parity condition failed. Every (m, n) pair behind the table above — (2,1), (3,2), (4,1), (4,3), (5,2), (5,4), (6,1) — is coprime with opposite parity, which is exactly why each one produces a genuinely new primitive triple rather than a repeat or a scaled copy.
Deriving the angles
Once all three sides are known, the two non-right angles follow from basic trigonometry:
The two acute angles always sum to exactly 90° because all three angles of a triangle sum to 180°, and one angle is already 90°. This means knowing one acute angle instantly gives you the other: β = 90° − α.
For the classic 3–4–5 right triangle:
- α = arctan(4/3) ≈ 53.13°
- β = arctan(3/4) ≈ 36.87°
- 53.13° + 36.87° = 90° ✓
Area and perimeter of a right triangle
Because the two legs of a right triangle are perpendicular, one leg serves as the base and the other as the height. This simplifies the area formula to:
The perimeter is simply the sum of all three sides:
Proof: the rearrangement argument (no trigonometry needed)
The Pythagorean theorem has over 350 documented proofs — more than any other result in mathematics. One of the most accessible needs nothing but the areas of squares and triangles:
Take four exact copies of the right triangle (legs a and b, hypotenuse c) and arrange them inside one large square, one in each corner, each rotated a quarter turn from its neighbor. The outer square has side length a + b. The four hypotenuses, meeting edge to edge in the middle, trace out a smaller, tilted square with side c.
Now compute the big square’s area two different ways.
Directly, from its side length:
As the sum of its pieces — the four triangles (each area ½ab) plus the tilted inner square:
Both expressions describe the exact same area, so they are equal:
Subtract 2ab from both sides, and only a² + b² = c² remains — proved with nothing but two ways of measuring the same square, no trigonometry and no appeal to similar triangles required. This particular rearrangement is often credited to the 12th-century Indian mathematician Bhāskara II, said to have presented the diagram in his treatise Līlāvatī with a single word attached: “Behold!” (source).
A theorem older than Pythagoras
Despite the name, the relationship a² + b² = c² was known and used more than a thousand years before Pythagoras (c. 570–495 BCE) was born. The Babylonian clay tablet Plimpton 322 (c. 1800 BCE) lists columns of numbers that historians of mathematics read as Pythagorean triples — evidence that Old Babylonian scribes already had a systematic method for generating them, roughly 1,300 years before Pythagoras (source).
A more popular, and more contested, tradition credits ancient Egyptian surveyors — the harpedonaptai, or “rope-stretchers” — with using a 12-knot rope divided into 3, 4, and 5 equal segments to lay out right angles when re-surveying farmland after the Nile’s annual flood. The rope-stretchers themselves are well documented; whether they specifically relied on the 3–4–5 ratio is not — no surviving Egyptian papyrus states the relationship explicitly, so historians remain divided on how literally to take this account (source).
What Pythagoras and the Pythagoreans genuinely get credit for is not the numerical relationship itself, but the first known general proof — a demonstration that a² + b² = c² holds for every right triangle, not just the handful of whole-number examples earlier cultures had already tabulated.
Solving for one missing side: real examples
This calculator’s job is specifically the two-sides-in-one-side-out case — no angles required. That is a narrower, more common problem than fully solving a triangle (all three sides and both acute angles), which is what the Right Triangle Calculator handles. A few everyday situations are exactly this narrower problem:
- Squaring a corner (construction & carpentry): measure 3 ft along one wall and 4 ft along the adjacent wall; the missing side — the diagonal between those two points — must measure exactly 5 ft for the corner to be a true right angle. The 3–4–5 rule is nothing more than solving for c.
- The ladder problem: a 13-ft ladder leans against a wall with its base 5 ft from the wall. How high up the wall does it reach? The ladder is the hypotenuse, the ground distance is one leg, and the missing side is the other leg:
√(13² − 5²) = √144 = 12 ft. - Screen and monitor diagonals: manufacturers quote a display’s size as its diagonal. Given the width and height, the missing diagonal is one Pythagorean calculation away — a 16:9, 27-inch monitor has width ≈ 23.5 in and height ≈ 13.2 in, since 23.5² + 13.2² ≈ 27².
- Straight-line distance: given how far apart two points are horizontally and vertically, the direct distance between them is the missing hypotenuse — the same calculation behind GPS distance estimates and the coordinate-plane distance formula covered next.
The theorem in higher dimensions
The Pythagorean theorem extends naturally to any number of dimensions. In two dimensions (the plane), the distance between points (x₁, y₁) and (x₂, y₂) is:
In three dimensions, add a third term under the radical. In n dimensions, the distance between two points is the square root of the sum of the squares of all coordinate differences: the Euclidean distance formula, which is the direct generalisation of the Pythagorean theorem to n-dimensional space.
Worked examples
Find the hypotenuse: a = 9, b = 12. c = √(81 + 144) = √225 = 15. (This is 3 × the 3–4–5 triple.)
Find a leg: One leg = 7, hypotenuse = 25. other leg = √(625 − 49) = √576 = 24. (The 7–24–25 triple.)
Non-integer example: a = 1, b = 1. c = √2 ≈ 1.41421. This is the diagonal of a unit square — and one of the earliest proofs that irrational numbers exist.