Pythagorean Theorem Calculator
Solve right triangles instantly using the Pythagorean Theorem. Calculate missing sides, angles, area, perimeter, altitude, and trigonometric values with step-by-step solutions.
Solve a Right Triangle
Enter any two sides — leave the third blank to solve for it. Each side has a coefficient box and a radicand box under the √ — type 2 and 5 to enter 2√5.
Reference diagram
a, b — the two legs at the right angle. c — the hypotenuse, opposite the 90° corner. h — altitude from the right angle. α, β — acute angles.
Common Pythagorean Triples
Positive integer triples (a, b, c) where a² + b² = c² exactly. Tap any row to load it into the Theorem tab.
| a | b | c | Family |
|---|---|---|---|
| 3 | 4 | 5 | 3-4-5 (primitive) |
| 6 | 8 | 10 | 3-4-5 multiple |
| 9 | 12 | 15 | 3-4-5 multiple |
| 5 | 12 | 13 | 5-12-13 (primitive) |
| 10 | 24 | 26 | 5-12-13 multiple |
| 8 | 15 | 17 | 8-15-17 (primitive) |
| 7 | 24 | 25 | 7-24-25 (primitive) |
| 20 | 21 | 29 | 20-21-29 (primitive) |
| 12 | 35 | 37 | 12-35-37 (primitive) |
| 9 | 40 | 41 | 9-40-41 (primitive) |
| 11 | 60 | 61 | 11-60-61 (primitive) |
| 28 | 45 | 53 | 28-45-53 (primitive) |
Formula Library
Pythagorean theorem
a² + b² = c²
Legs a, b and hypotenuse c of every right triangle.
Missing hypotenuse
c = √(a² + b²)
Both legs known.
Missing leg
a = √(c² − b²)
Hypotenuse and one leg known.
Distance formula
d = √[(x₂−x₁)² + (y₂−y₁)²]
Pythagorean theorem on the coordinate plane.
Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2)
Average of the two endpoints.
Area
A = ab ÷ 2
Half the product of the legs.
Perimeter
P = a + b + c
Sum of every side.
Altitude to hypotenuse
h = ab ÷ c
Drops from the right angle perpendicular to c.
Angle α
α = arctan(a / b)
Acute angle opposite side a.
Angle β
β = 90° − α
Complementary acute angle.
Sine
sin θ = opp ÷ hyp
Ratio of opposite side to hypotenuse.
Cosine
cos θ = adj ÷ hyp
Ratio of adjacent side to hypotenuse.
Tangent
tan θ = opp ÷ adj
Ratio of opposite to adjacent leg.
45-45-90 ratio
1 : 1 : √2
Isoceles right triangle (half a square).
30-60-90 ratio
1 : √3 : 2
Half of an equilateral triangle.
3D space diagonal
d = √(l² + w² + h²)
Cuboid's body diagonal — two Pythagorean theorems chained.
What Is the Pythagorean Theorem?
The Pythagorean theorem says that in every right triangle the square of the hypotenuse equals the sum of the squares of the two legs — a² + b² = c². The legs a and b are the two sides that meet at the 90° angle; the hypotenuse c is the slanted side opposite the right angle, and it is always the longest of the three. Knowing any two sides automatically determines the third.
The theorem is named after the Greek mathematician Pythagoras of Samos (c. 570 – c. 495 BCE), though clay tablets show Babylonian mathematicians were using 3-4-5, 5-12-13, and other integer right-angle triples more than a thousand years earlier. Today it shows up in surveying, navigation, engineering, computer graphics, special and general relativity — anywhere the distance between two things has to be calculated from independent coordinates. This calculator pairs naturally with the scientific calculator, the slope calculator, and the circle calculator.
How the Calculator Works
Identify the right triangle
Every problem starts with a right triangle — two legs and a hypotenuse. The calculator marks the 90° corner explicitly and labels the legs a and b (interchangeable) and the hypotenuse c (always the longest side, opposite the right angle).
Pick which side is unknown
Enter any two of a, b, c — the calculator recognises the empty slot and picks the right rearrangement: c = √(a² + b²), a = √(c² − b²), or b = √(c² − a²). It also accepts coefficient + radicand inputs so you can type values like 2√5 directly.
Solve every related measurement
Once the third side is known, the angles fall out from arctan, and the area, perimeter, and altitude to the hypotenuse follow from straightforward identities. Sin, cos, and tan of both acute angles are reported too.
See every form of the answer
Sides appear in both exact (k√n) and decimal forms. Angles appear in degrees, degrees-minutes-seconds, and radians. The leg ratio is reduced to lowest terms when both legs are integers.
6 Ways to Use This Calculator
Solve any right triangle
Enter any two sides and the third drops out. The calculator returns angles, area, perimeter, altitude, leg ratio, and a labelled SVG diagram.
Apply the distance formula
Drop in two (x, y) coordinates to find the straight-line distance, midpoint, slope, and inclination — the Pythagorean theorem in coordinate dress.
Find a 3D space diagonal
Cuboid length, width, and height collapse to a single body-diagonal length via d = √(l² + w² + h²). The 3D tab also returns face-diagonal, volume, and surface area.
Solve a special right triangle
45-45-90 and 30-60-90 triangles have fixed side ratios (1 : 1 : √2 and 1 : √3 : 2). Provide any one side; the calculator returns the other two in exact radical and decimal form.
Explore with the live toolkit
Drag the sliders to vary the legs and watch the angles, area, perimeter, altitude, trig values, and five charts (side comparison, area vs hypotenuse, angle distribution, ratio analysis, a² + b² = c²) update in real time.
Check for Pythagorean triples
The calculator flags integer triples and lists the classic ones — 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 12-35-37, 9-40-41 — for tap-to-load reference.
Best Practices
Identify the hypotenuse first. The hypotenuse is always opposite the right angle and is the longest side. The two legs are interchangeable in a² + b² = c², but only c may be substituted for the hypotenuse. Getting this wrong is the single most common error students make on word problems.
Keep units consistent. A leg in metres and a hypotenuse in centimetres will return a meaningless result. Convert everything to the same unit — feet, metres, pixels, kilometres — before applying the theorem. The calculator treats every input as a pure number; the unit is whichever one you decide consistently.
Report exact and decimal forms together. The exact form (e.g. 2√5) carries the geometry; the decimal form (≈ 4.472) carries the practical measurement. The Solver tab returns both — copy the one that matches the document you're writing.
Why a² + b² = c² — A Visual Proof
Take a square of side (a + b) and dissect it two different ways. In the first dissection, place four copies of the right triangle (legs a, b; hypotenuse c) in the corners pointing inward; what's left over is a square of side c with area c². In the second dissection, place the same four triangles tightly along two adjacent edges; what's left over is two smaller squares, one of side a (area a²) and one of side b (area b²).
Both dissections cover exactly the same big square — and remove the same four triangles — so the leftover regions must have the same total area: a² + b² = c². This is the proof Euclid wrote down in Elements, Book I, Proposition 47, more than 2,300 years ago, and it remains one of the cleanest pieces of geometric reasoning in all of mathematics.
Why the Pythagorean Theorem Matters
Construction and carpentry
The 3-4-5 method squares up corners: lay out 3 units along one wall, 4 units along the next, and the diagonal between them is 5 units if and only if the corner is exactly 90°. Carpenters, masons, and DIY framers use it every day to keep slabs, decks, and door frames true.
Surveying and mapping
Long before GPS, surveyors triangulated unknown distances using right-triangle geometry. Map distances between two points on a grid, the height of a hill from horizontal sightings, the length of a property line across a stream — all are Pythagorean-theorem problems.
Navigation
Marine and aviation navigation reduces course corrections to right triangles: cross-track error, glide-slope distance, and dead-reckoning all use the theorem. Every GPS receiver applies it (in a 3D form) thousands of times per second to compute your position from satellite ranges.
3D modelling and CGI
Computer graphics, CAD packages, and game engines compute vertex distances, ray lengths, and normal vectors using √(Δx² + Δy² + Δz²) — the 3D Pythagorean theorem. Every pixel rendered on a curved 3D surface relies on this single identity at some point in the pipeline.
Where It Gets Tricky
Choosing the wrong side as c
The hypotenuse is always opposite the right angle and is the longest side. If you accidentally label a leg as c, every formula gives a wrong answer. When in doubt, look for the 90° corner and follow the slanted edge across the triangle.
Hypotenuse shorter than a leg
If you're solving for a leg and the entered hypotenuse is smaller than the known leg, the formula returns √(negative) — geometrically impossible. The calculator flags this rather than producing a complex number.
Irrational answers
Most right triangles have an irrational hypotenuse — 1² + 1² = 2, so c = √2 ≈ 1.41421356… The calculator preserves the radical form (e.g. 2√5) alongside the decimal, so you can copy whichever the application wants.
3D versus 2D distance
On a flat map, the distance between two points is √(Δx² + Δy²). In real 3D space (e.g. a quadrotor's flight path), you also need the height difference: √(Δx² + Δy² + Δz²). The 3D tab handles this — don't mistakenly use the 2D formula on a non-flat problem.
Core Formulas
Theorem
a² + b² = c²
The defining identity for every right triangle.
Hypotenuse
c = √(a² + b²)
Both legs known, hypotenuse unknown.
Missing leg
a = √(c² − b²)
Hypotenuse and one leg known.
Area
A = (ab) ÷ 2
Half the product of the legs.
Perimeter
P = a + b + c
Sum of every side.
Altitude
h = (ab) ÷ c
Perpendicular from the right angle to the hypotenuse.
Angle α
α = arctan(a ÷ b)
Acute angle opposite side a.
Angle β
β = 90° − α
Complementary acute angle.
Sine α
sin α = a ÷ c
Opposite over hypotenuse.
Cosine α
cos α = b ÷ c
Adjacent over hypotenuse.
Tangent α
tan α = a ÷ b
Opposite over adjacent.
Distance
d = √[(x₂−x₁)² + (y₂−y₁)²]
Coordinate-plane application of the theorem.
Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2)
Average of the two endpoints.
3D diagonal
d = √(l² + w² + h²)
Body diagonal of a cuboid.
45-45-90 sides
1 : 1 : √2
Isoceles right triangle (half-square).
30-60-90 sides
1 : √3 : 2
Half of an equilateral triangle.
Pythagorean triple test
a² + b² = c² (integers)
Primitive: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29.
Converse
if a² + b² = c² ⇒ 90°
Three sides matching the equation force a right triangle.
Common Mistakes
- 1
Forgetting to square — or to take a square root
The Pythagorean theorem involves both squaring (a² + b²) and a square root at the end. Skipping either step gives the wrong magnitude — usually by a factor of √2 or more.
- 2
Mixing up the hypotenuse and a leg
Always sit the hypotenuse alone on one side of the equation. c² = a² + b² is right; b² = a² + c² is right when solving for a leg, but only if c is the actual hypotenuse.
- 3
Adding sides instead of squares
The theorem does not say a + b = c. A leg of 3 and a leg of 4 don't give a hypotenuse of 7 — they give 5. The squares add, not the sides.
- 4
Using the theorem on a non-right triangle
a² + b² = c² holds only when the triangle has a 90° corner. For oblique triangles, use the law of cosines: c² = a² + b² − 2ab·cos C.
- 5
Rounding too early
Square roots of integers are usually irrational. Round only at the very end — rounding inside √() amplifies error and can throw off the answer by several digits.
- 6
Forgetting the 3D form in space problems
Two points in 3D (room corners, drone waypoints, MRI voxels) need d = √(l² + w² + h²), not the planar distance formula.
Real-Life Applications
Engineering
Structural engineers solve right triangles every time a truss, brace, or stringer is analysed. The diagonal load path on a roof rafter, the cable tension on a suspension bridge, and the deflection of a cantilever beam all reduce to right-triangle geometry.
Construction
From laying out foundations with the 3-4-5 method to cutting roof rafters using the rise-and-run ratio, construction crews rely on the Pythagorean theorem to keep buildings square, level, and the right shape.
Architecture
Architects use right-triangle math to design ramps that meet accessibility codes (ADA: 1:12 slope max), stairs (rise/run with the diagonal = string length), and pitched roofs (the rafter length is the hypotenuse of the rise-and-run triangle).
Surveying
Land surveyors apply the distance formula to compute boundary lengths from staked coordinates, the height of a cliff from a baseline and angle, and the area of irregular plots by triangulating into right triangles.
Navigation
Marine pilots compute cross-track error, intersect ranges to crossing points, and chart drift correction using right triangles. The same identity powers radar, GPS, sonar, and modern autopilots.
Computer graphics
Every video game, 3D model, and AR app uses √(Δx² + Δy² + Δz²) to compute distances between objects, normalise direction vectors, detect collisions, and render lighting. The Pythagorean theorem runs millions of times per frame.
Common Pythagorean Triples
A Pythagorean triple is a set of three positive integers (a, b, c) with a² + b² = c². Primitive triples are those where a, b, and c share no common factor greater than 1; every other triple is a multiple of a primitive one. They are the right triangles whose sides come out clean.
| a | b | c | Check (a² + b²) |
|---|---|---|---|
| 3 | 4 | 5 | 25 = 25 ✓ |
| 5 | 12 | 13 | 169 = 169 ✓ |
| 8 | 15 | 17 | 289 = 289 ✓ |
| 7 | 24 | 25 | 625 = 625 ✓ |
| 20 | 21 | 29 | 841 = 841 ✓ |
| 12 | 35 | 37 | 1369 = 1369 ✓ |
| 9 | 40 | 41 | 1681 = 1681 ✓ |
Methodology you can verify
Every result is computed live in your browser using double-precision arithmetic. Angles use Math.atan2 for full quadrant correctness; distances use the standard √(Δx² + Δy²) and its 3D extension; special-triangle ratios are exact (1 : 1 : √2 and 1 : √3 : 2). The radical-form expressions are recovered by checking small squarefree radicands against the squared decimal answer — only displayed when the match is exact to within 10⁻⁷. Read more on the methodology and editorial policy pages.
Frequently Asked Questions
Related Calculators
Pair the Pythagorean theorem calculator with other math tools for trigonometry, geometry, ratios, and coordinate analysis.
- Scientific CalculatorAdvanced trig, log, exponent, root, factorial, and memory functions.
- Slope CalculatorSlope, angle, distance, midpoint, intercepts, and the line equation with an interactive coordinate-plane graph.
- Percentage CalculatorCalculate % of a number, percentage change, and reverse percentages.
- Probability CalculatorTwo-event probabilities, unions, intersections, complements, normal distribution, confidence intervals, and step-by-step solutions across five integrated tools.