Pythagorean Theorem Calculator
Find the hypotenuse or a missing leg of a right triangle, measure the distance between two points in 3D, or test whether three whole numbers form a Pythagorean triple — with exact radical answers, angles, area and every step shown.
Written by Suhaib Hassan. The theorem is Euclid’s Proposition I.47, and every worked example is re-derived by hand. Our methodology.
It squares the known sides, adds or subtracts, and takes the square root. Whole-number results are shown as exact values, and other roots as simplified radicals like 6√2.
One page for the four common jobs: hypotenuse, missing leg, 3D distance and triple checking — with the geometry drawn to scale.
—
Geometric proof: the squares on the sides
Euclid’s Proposition I.47: the square on the hypotenuse has the same area as the two squares on the legs added together.
Step-by-step working
—
Special right triangles
3-4-5 triangle ratio 3 : 4 : 5
The smallest Pythagorean triple. Builders use it to check that a corner is square: measure 3 along one edge and 4 along the other, and the diagonal must be exactly 5 (or any multiple, such as 9-12-15).
45°-45°-90° triangle ratio 1 : 1 : √2
Half of a square cut along its diagonal. The legs are equal and the hypotenuse is the leg multiplied by √2 (about 1.4142).
30°-60°-90° triangle ratio 1 : √3 : 2
Half of an equilateral triangle. The hypotenuse is twice the shortest leg and the other leg is the shortest leg times √3.
Euclid’s formula for triples m > n > 0
For whole numbers m > n > 0, the numbers a = m² − n², b = 2mn, c = m² + n² always form a triple. If m and n are coprime and of opposite parity, the triple is primitive.
This applies the theorem twice: first across the floor, then up the height.
Worked examples
Squaring a foundation
Marking a rectangle 3 m by 4 m, the diagonal should be exactly 5 m if the corner is a true right angle.
A diagonal off by even 2 cm means the corner is not square.
Screen size
A 16:9 television has a 55-inch diagonal. What are its width and height?
width = 55 × 16 ÷ 18.358 = 47.94 in
height = 55 × 9 ÷ 18.358 = 26.96 in
3D distance
Two points, (1, 2, 3) and (4, 6, 15).
d = √(9 + 16 + 144) = √169 = 13
A whole number, because (3, 4, 12, 13) is a Pythagorean quadruple.
What is the Pythagorean theorem?
In a right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides, the legs: a² + b² = c². It is a special case of the Law of Cosines, in which the term −2ab·cos C vanishes because cos 90° = 0.
How to use it
- Hypotenuse: c = √(a² + b²).
- Missing leg: a = √(c² − b²), and the hypotenuse must be the longest side.
- Angles: tan α = a ÷ b, so α = arctan(a ÷ b) and the other acute angle is 90° − α.
- Area and radii: area = ½ab; inradius = (a + b − c) ÷ 2; circumradius = c ÷ 2.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Sources
- Euclid, Elements, Book I, Proposition 47 (the Pythagorean theorem) and Proposition 48 (its converse).
- Maor, E. (2007). The Pythagorean Theorem: A 4,000-Year History. Princeton University Press.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics.
Frequently asked questions
Why does a² + b² = c² only work for right triangles?
The general rule is the Law of Cosines, c² = a² + b² − 2ab·cos C. For a right angle, cos 90° = 0 and the last term disappears. For an acute angle c² is smaller than a² + b²; for an obtuse angle it is larger.
What is a primitive Pythagorean triple?
A set of whole numbers (a, b, c) with a² + b² = c² whose greatest common divisor is 1, such as 3-4-5 or 5-12-13. Multiples like 6-8-10 are still triples but not primitive.
How do I find the distance between two points in 3D?
Square the differences in x, y and z, add them, and take the square root. It is the Pythagorean theorem applied twice, and it also gives the space diagonal of a box with edges Δx, Δy and Δz.
What does an exact radical answer like 6√2 mean?
When the number under the root is not a perfect square, the root is irrational. It can be simplified by pulling out square factors: √72 = √(36 × 2) = 6√2, which equals about 8.4853. The exact form avoids rounding.
Can the hypotenuse be shorter than a leg?
No. The hypotenuse is always the longest side of a right triangle, because c² = a² + b² is larger than either a² or b². When solving for a leg, the hypotenuse you enter must exceed the known leg.
Does it work for any units?
Yes, as long as all sides use the same unit. The result is in that unit; areas are in square units. The unit-equivalent panel converts the answer to other common lengths.
Related calculators
Continue with geometry.