Pythagorean Theorem Calculator
Free pythagorean theorem calculator: solve a right triangle for the hypotenuse or a missing leg, plus area and perimeter, with worked steps and proofs.
Pythagorean Theorem Calculator
Background.
The Quanta pythagorean theorem calculator solves any right triangle in either direction: enter the two legs and it returns the hypotenuse, or enter the hypotenuse and one leg and it returns the missing leg, along with the triangle's area and perimeter for free. The theorem itself — a² + b² = c² — is the most famous equation in classical geometry and arguably the single most-used result in all of applied mathematics. It is what lets a carpenter check that a wall is square by measuring 3 feet along the floor, 4 feet up the wall, and 5 feet on the diagonal; it is how a surveyor turns two perpendicular tape measurements into a property's boundary length; it is the reason a 65-inch television is actually 56.6 inches wide and 31.9 inches tall once you account for its 16:9 aspect ratio; and it is the foundation under every distance formula, every vector magnitude, every Euclidean norm in machine learning, and every GPS triangulation algorithm.
The relationship was known to Babylonian scribes nearly a thousand years before Pythagoras was born — the cuneiform tablet Plimpton 322, dated to around 1800 BCE, lists fifteen Pythagorean triples — and was independently catalogued by mathematicians in ancient India (the Sulba Sutras), China (the Zhou Bi Suan Jing), and Greece, where Pythagoras's school is credited with the first general proof some time in the 6th century BCE. The most rigorous proof in the Western tradition is Proposition 47 of Book I of Euclid's Elements, written about 300 BCE, and that proof has been taught essentially unchanged for 2,300 years.
This page walks you through three of the cleanest proofs (rearrangement, similar triangles, and pure algebra), the integer-solution "Pythagorean triples" like 3-4-5 and 5-12-13 and 8-15-17 that have fascinated number theorists since Fermat, the impossible-geometry case that the calculator catches for you when someone enters a hypotenuse shorter than one of its legs, and a handful of practical applications — from roof pitch to screen diagonals to construction layout — where you'll find yourself reaching for this exact arithmetic in everyday life. Whether you arrived here to do a homework problem, to measure a room, to verify a contractor's framing, or simply to remember a theorem you last met in ninth grade, this calculator and the explainer below it cover every variant of the question.
What is pythagorean theorem calculator?
The Pythagorean theorem is a statement about right triangles: in any triangle that contains a 90-degree angle, the square of the length of the longest side (the hypotenuse) equals the sum of the squares of the lengths of the other two sides (the legs). Written compactly: a² + b² = c², where c is the side opposite the right angle. The theorem is named for the Greek philosopher and mathematician Pythagoras of Samos (~570–495 BCE), whose followers are credited with the first known general proof, but the relationship itself was demonstrably known to earlier civilizations — Babylonian scribes had a complete table of Pythagorean triples on the Plimpton 322 tablet around 1800 BCE, and the Indian Sulba Sutras (c. 800–500 BCE) gave the rule for constructing a square equal in area to two combined squares, which is exactly the theorem in geometric form. What makes the theorem foundational rather than just useful is that the converse is also true: if a triangle's sides satisfy a² + b² = c², then the triangle must have a right angle opposite the longest side. That converse, also proved by Euclid (Elements Book I, Prop. 48), is what allows the theorem to be used in reverse — to check whether a corner is square, to define perpendicularity in coordinate geometry, and to extend the entire idea of distance from triangles to vector spaces of any dimension. In modern mathematics the theorem generalizes far beyond triangles: the Euclidean distance between two points, the magnitude of a vector, the L² norm in machine learning, the metric of flat spacetime in special relativity, and the orthogonality conditions in Fourier analysis are all direct descendants of a² + b² = c².
How to use this calculator.
- Pick the mode at the top. "Hypotenuse (c)" is the most common — use it when you know the two legs and want the diagonal. "Missing leg" is the inverse — use it when you know the hypotenuse and one leg and want the other.
- In hypotenuse mode, enter leg a and leg b in the same unit (both inches, both metres, both feet — the theorem does not care which unit you use as long as you are consistent). The hypotenuse, area, and perimeter all update as you type.
- In leg mode, enter the hypotenuse c and exactly one of the two legs (a or b). Leave the side you want to solve for blank or at zero. The calculator returns the missing leg plus area and perimeter.
- Read the primary result (the hypotenuse in mode 1, the solved leg in mode 2) and the secondary breakdown. The breakdown echoes back all three sides so you can verify the triangle you actually solved is the one you meant to enter.
- If you enter a hypotenuse that is shorter than one of the legs, the calculator will flag it as impossible geometry — that combination of sides cannot form a right triangle. Increase the hypotenuse or decrease the leg until c is strictly greater than both a and b.
- Use the area and perimeter outputs for downstream problems — flooring estimates, fencing, paint coverage, sheet-metal cuts — without having to re-derive them from the side lengths.
The formula.
The core formula is a² + b² = c², and the calculator simply rearranges it depending on which side is missing. To solve for the hypotenuse, take c = √(a² + b²); to solve for a missing leg given the hypotenuse and the other leg, take a = √(c² − b²) or b = √(c² − a²). Three short proofs are worth knowing. Rearrangement proof: take four identical right triangles and arrange them inside a larger square so the hypotenuses form an inner square. The big square has side (a+b) and area (a+b)². The four triangles cover area 4 × (½ab) = 2ab. What remains is the inner square of side c with area c². So (a+b)² = 2ab + c². Expand the left side: a² + 2ab + b² = 2ab + c². Subtract 2ab from both sides: a² + b² = c². Similar-triangles proof: drop a perpendicular from the right angle onto the hypotenuse. This creates two smaller right triangles that are each similar to the original. From the ratios of corresponding sides, a² = c·p and b² = c·q, where p and q are the segments the perpendicular cuts the hypotenuse into. Add: a² + b² = c·(p + q) = c·c = c². Algebraic / coordinate proof: place the right angle at the origin with the legs along the positive x and y axes. The endpoints of the legs are (a, 0) and (0, b). The distance between them by the Pythagorean distance formula is √((a−0)² + (0−b)²) = √(a² + b²), which is exactly c. The area output is the standard right-triangle area, (a × b) ÷ 2, because the two legs are perpendicular and thus serve directly as base and height. The perimeter output is simply a + b + c, the sum of all three sides. Internally the calculator rejects negative or zero side lengths (a real triangle cannot have a side of length zero) and rejects any leg-mode input where c² ≤ a² or c² ≤ b², because in that case no right triangle exists with those measurements.
A worked example.
The classic 3-4-5 right triangle. Selecting hypotenuse mode and entering a = 3 and b = 4 returns c = 5, area = 6, and perimeter = 12. The arithmetic: c = √(3² + 4²) = √(9 + 16) = √25 = 5. Area = (3 × 4) ÷ 2 = 6 square units. Perimeter = 3 + 4 + 5 = 12 units. The 3-4-5 triangle is the smallest "Pythagorean triple" — a set of three whole numbers that satisfy the theorem exactly — and it is the one carpenters, masons, and stage-set builders have used for millennia to lay out perfect right angles in the field. Stretch a tape 3 units along one line, 4 units along the other, and if the diagonal between the endpoints measures exactly 5 units the corner is square. The same trick scales: 6-8-10, 9-12-15, 30-40-50 all work, because multiplying every side of a Pythagorean triple by the same positive number gives another Pythagorean triple. If instead you knew the hypotenuse was 5 and one leg was 3, switching to leg mode and entering c = 5, a = 3 returns b = 4 — the inverse problem, solved by the same theorem read in reverse.
Frequently asked questions.
What is the Pythagorean theorem in simple terms?
How do I find the hypotenuse of a right triangle?
How do I find a missing leg when I know the hypotenuse?
Who actually discovered the Pythagorean theorem?
What is a Pythagorean triple?
Does the Pythagorean theorem only work for right triangles?
How is the Pythagorean theorem used in real life?
What is the converse of the Pythagorean theorem and why does it matter?
Why does the calculator say my triangle is impossible?
How is the Pythagorean theorem extended to three dimensions?
References& sources.
- [1]Euclid, Elements, Book I, Proposition 47 — the first surviving rigorous proof of the Pythagorean theorem in the Western mathematical tradition (Heath translation, Cambridge University Press, 1908).
- [2]Robson, Eleanor. "Neither Sherlock Holmes nor Babylon: A Reassessment of Plimpton 322." Historia Mathematica 28 (2001): 167–206 — the definitive modern analysis of the Babylonian Pythagorean-triples tablet dated to ~1800 BCE.
- [3]Maor, Eli. The Pythagorean Theorem: A 4,000-Year History. Princeton University Press, 2007 — a peer-reviewed monograph tracing the theorem from Babylonian and Indian origins through Euclid, Islamic mathematicians, and modern generalizations.
- [4]Coxeter, H. S. M. Introduction to Geometry, 2nd edition. Wiley, 1969 — classic reference geometry textbook covering the Pythagorean theorem, its converse, similar-triangles and rearrangement proofs.
- [5]NIST Digital Library of Mathematical Functions, §4.14 — definitions and identities for trigonometric functions, where the Pythagorean theorem appears as the foundational identity sin²θ + cos²θ = 1.
- [6]Joyce, David E. Euclid's Elements, Clark University — online edition of the Elements with commentary on Book I, Propositions 47 and 48 (the theorem and its converse).
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled