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

abchαβ

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.

abcFamily
3453-4-5 (primitive)
68103-4-5 multiple
912153-4-5 multiple
512135-12-13 (primitive)
1024265-12-13 multiple
815178-15-17 (primitive)
724257-24-25 (primitive)
20212920-21-29 (primitive)
12353712-35-37 (primitive)
940419-40-41 (primitive)
11606111-60-61 (primitive)
28455328-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

1

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.

2

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.

3

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.

4

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.

5

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.

6

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. 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. 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. 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. 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. 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. 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.

abcCheck (a² + b²)
34525 = 25
51213169 = 169
81517289 = 289
72425625 = 625
202129841 = 841
1235371369 = 1369
940411681 = 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

The Pythagorean theorem states 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 is always the longest side. The theorem is named after the Greek mathematician Pythagoras of Samos (c. 570 – c. 495 BCE), though clay tablets show Babylonian mathematicians were applying integer right-angle triples like 3-4-5 and 5-12-13 more than a thousand years earlier. Today it powers surveying, navigation, engineering, computer graphics, and the distance formula in coordinate geometry.

Take both legs, square each one, add the squares, then take the positive square root: c = √(a² + b²). For example, with a = 3 and b = 4 the hypotenuse is √(9 + 16) = √25 = 5 — the classic 3-4-5 triangle. With a = 1 and b = 1 the hypotenuse is √2 ≈ 1.41421356 — the diagonal of a unit square. The Theorem tab on this page accepts coefficient + radicand inputs so you can type 2√5 directly and get a clean exact answer alongside the decimal form.

Rearrange the theorem to isolate the leg you want. If you know the hypotenuse c and one leg b, then a = √(c² − b²). If you know c and a, then b = √(c² − a²). The hypotenuse must always be longer than each leg — if it isn't, the geometry is impossible and the calculator will flag it. For example, with c = 13 and a = 5 the missing leg is √(169 − 25) = √144 = 12, giving the 5-12-13 triple.

A right triangle is a triangle that contains exactly one 90° angle. The two sides forming that right angle are called the legs (a and b); the third side, opposite the right angle, is the hypotenuse (c). The two non-right angles are always acute (less than 90°) and they must sum to 90° because every triangle's angles total 180°. Right triangles are the building blocks of trigonometry: sin, cos, and tan are defined as ratios of the right triangle's sides.

For a right triangle, the area is half the product of the two legs: A = (a · b) ÷ 2. The legs are perpendicular, so one acts as the base and the other as the height — no extra trigonometry needed. With a = 3 and b = 4 the area is (3 · 4) ÷ 2 = 6 square units. The Theorem tab returns area automatically once both legs are known (either entered directly or solved from the hypotenuse via the Pythagorean theorem).

The altitude (h) of a right triangle is the perpendicular distance from the right-angle vertex to the hypotenuse. For a right triangle with legs a, b and hypotenuse c, the altitude is h = (a · b) ÷ c. It's also the geometric mean of the two segments the altitude creates on the hypotenuse. Drawing the altitude divides the original right triangle into two smaller right triangles, each similar to the original — a fact used heavily in geometric proofs and in the relationship h² = pq, where p and q are the hypotenuse segments.

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c² exactly. The smallest is (3, 4, 5) — the classic triangle used by carpenters to square corners. Other famous primitives are (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29), (12, 35, 37), and (9, 40, 41). A primitive triple is one whose three values share no common factor greater than 1; every other triple is a multiple of a primitive (e.g. 6-8-10 is 2 × 3-4-5). The reference table on this page lists the most common triples.

Construction crews use the 3-4-5 method to square up foundations; carpenters use it to cut roof rafters from rise and run; surveyors triangulate distances and elevations; sailors and pilots compute cross-track error and dead-reckoning positions; and every 3D game, CAD package, and GPS receiver computes object distances using √(Δx² + Δy² + Δz²) — the 3D form of the theorem. Even MRI scanners and the structure of crystal lattices rely on right-triangle math behind the scenes.

Yes — the Pythagorean theorem extends to three dimensions in the natural way. The space diagonal of a rectangular cuboid with length l, width w, and height h is d = √(l² + w² + h²). The derivation is just the theorem applied twice: first to the base (face diagonal f = √(l² + w²)), then to the right triangle formed by f and h (space diagonal d = √(f² + h²)). The 3D tab on this page does both steps and also returns the surface area, the volume, and the angle the space diagonal makes with the base.

The distance formula gives the straight-line distance between two points (x₁, y₁) and (x₂, y₂) on a flat plane: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. It's literally the Pythagorean theorem with Δx as one leg and Δy as the other — the distance between two points is the hypotenuse of the right triangle formed by their horizontal and vertical separations. The Distance tab on this page also returns the midpoint ((x₁+x₂)/2, (y₁+y₂)/2), the slope (Δy/Δx), and the inclination angle of the line through the two points.