Pythagorean Theorem Calculator

Free Pythagorean Theorem Calculator: find the hypotenuse c, leg a or b using a²+b²=c². Calculates all 3 angles, area, perimeter, altitude to hypotenuse,...

?????? ?????????

a2+b2=c2c=(a2+b2)a=(c2b2)a² + b² = c² | c = √(a²+b²) | a = √(c²-b²)
a, b=a, b — The two legs (sides forming the right angle). Enter any two known sides to find the third.
c=c — Hypotenuse: the side opposite the 90° angle, always the longest side. c = √(a²+b²).
α, β=α, β — The two acute angles. α = arctan(a/b), β = arctan(b/a) = 90° − α. α + β + 90° = 180°.
A=A — Area of the right triangle: A = ½ × a × b. Also A = ½ × c × h_c where h_c is the altitude to the hypotenuse.

How to Use the Pythagorean Theorem Calculator

This calculator supports four modes — choose which sides or values you know and the tool derives everything else about the right triangle:

  • Mode 1 — Find Hypotenuse (c): Enter legs a and b. Computes c = √(a²+b²), all three angles (α, β, 90°), area, perimeter, altitude to hypotenuse h_c, inradius r, and circumradius R, plus a Pythagorean triple check.
  • Mode 2 — Find Leg a: Enter hypotenuse c and leg b. Computes a = √(c²−b²), then all derived properties. Verifies c > b; otherwise the inputs are geometrically impossible.
  • Mode 3 — Find Leg b: Enter hypotenuse c and leg a. Computes b = √(c²−a²), symmetric to Mode 2.
  • Mode 4 — Generate Pythagorean Triple: Enter integers m > n > 0. Generates the primitive triple using Euclid's formula: a = m²−n², b = 2mn, c = m²+n², and verifies a²+b²=c² to full precision. Also shows the family of multiples (2× and 3×).

All results are click-to-copy. The interactive SVG diagram updates dynamically to show the triangle to scale with all labels.

The Pythagorean Theorem: History and Statement

Pythagorean Theorem Calculator infographic showing right triangle with legs a and b in teal and hypotenuse c in amber, the formula a²+b²=c² in large white text with colored square areas on each side, worked example 3²+4²=9+16=25 giving c=5, and 5 common Pythagorean triples (3,4,5)(5,12,13)(8,15,17)(7,24,25)(20,21,29) on dark navy premium background

The Pythagorean theorem states that in any right triangle — a triangle containing a 90° angle — the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the two legs:

a² + b² = c²

This is one of the most fundamental theorems in all of mathematics. While it bears the name of the Greek mathematician Pythagoras (circa 570–495 BCE), evidence suggests it was known thousands of years earlier: Babylonian clay tablet Plimpton 322 (circa 1800 BCE) lists Pythagorean triples, and Egyptian builders used the 3-4-5 rope trick to create right angles. The theorem has over 370 known proofs — more than any other theorem in mathematics. U.S. President James A. Garfield discovered a novel proof in 1876 using a trapezoid.

The geometric interpretation is elegant: draw a square on each side of the right triangle. The area of the square on the hypotenuse equals the total area of the squares on the two legs. This was Euclid's original proof by area decomposition, presented in "Elements" Book I, Proposition 47.

Solving for Each Side: Complete Formulas

The theorem rearranges to solve for any missing side:

  • Find hypotenuse c (given a and b): c = √(a² + b²). Example: a=5, b=12 → c = √(25+144) = √169 = 13.
  • Find leg a (given c and b): a = √(c² − b²). Example: c=13, b=12 → a = √(169−144) = √25 = 5. Requires c > b.
  • Find leg b (given c and a): b = √(c² − a²). Symmetric: b = √(c² − a²). Requires c > a.
  • Verify a right triangle (given all three sides): Check a² + b² = c² where c is the largest side. If strictly equal → right triangle. If a²+b² > c² → acute triangle. If a²+b² < c² → obtuse triangle. The converse of the Pythagorean theorem is also true: if three sides satisfy a²+b²=c², the triangle IS right-angled.
  • Large numbers and precision: For very large inputs (e.g., a=1e8, b=1e8), use the formula c = a·√(1+(b/a)²) to avoid overflow. For a≫b: c ≈ a + b²/(2a) — the small-b approximation. Our calculator uses IEEE 754 double precision (15-17 significant digits), sufficient for inputs up to ~10¹⁵⁰.

Angles, Area, Perimeter, and All Triangle Properties

A right triangle with legs a, b and hypotenuse c has a complete set of derived properties:

  • Angles: The right angle is always 90° = π/2 rad. The other two angles: α = arctan(a/b) (angle opposite leg a), β = arctan(b/a) = 90° − α (angle opposite leg b). By definition: sin(α) = a/c, cos(α) = b/c, tan(α) = a/b. Example: (3,4,5) triple: α = arctan(3/4) ≈ 36.87°, β = arctan(4/3) ≈ 53.13°. Sum = 36.87° + 53.13° + 90° = 180° ✓.
  • Area: A = ½ × a × b. The two legs are perpendicular, so one leg is the base and the other is the height. Example: (3,4,5) → A = ½ × 3 × 4 = 6 square units. Formula in terms of hypotenuse and altitude: A = ½ × c × h_c (where h_c is the altitude from the right angle to the hypotenuse).
  • Perimeter: P = a + b + c. For the (3,4,5) triple: P = 12. The perimeter equals a + b + c and is also expressible as a + b + √(a²+b²).
  • Altitude to hypotenuse h_c: The altitude from the right-angle vertex to the hypotenuse is h_c = (a×b)/c. This is a crucial result — it creates two smaller similar triangles, each similar to the original. Example: (3,4,5) → h_c = 3×4/5 = 12/5 = 2.4. The two sub-triangles have legs (h_c, a²/c) and (h_c, b²/c).
  • Inradius (r): The radius of the inscribed circle (incircle) touching all three sides: r = (a + b − c)/2. This elegant formula works because for a right triangle, r = (perimeter/2) − c = (a+b+c)/2 − c = (a+b−c)/2. Example: (3,4,5) → r = (3+4−5)/2 = 1. The incircle center is at distance r from each side. Use our Arc Length Calculator to find the incircle's circumference (2πr).
  • Circumradius (R): For any right triangle, the circumscribed circle (circumcircle) has its center at the midpoint of the hypotenuse and radius R = c/2. This is the theorem of Thales: the hypotenuse of a right triangle inscribed in a circle is the circle's diameter. Example: (3,4,5) → R = 5/2 = 2.5. The circumcircle circumference = πc ≈ 15.708 for the (3,4,5) triple. Use our Midpoint Calculator to find the circumcircle center (midpoint of the hypotenuse).

Pythagorean Triples: Integer Solutions

Pythagorean Triples reference chart showing 10 common triples with area, perimeter and angles, plus Euclidn>0, a=m²-n², b=2mn, c=m²+n², with example m=2 n=1 gives (3,4,5), on dark navy background with teal borders and amber monospace text" />

A Pythagorean triple is a set of three positive integers (a, b, c) satisfying a²+b²=c². A primitive triple has GCD(a,b,c)=1 — no common factor. Every Pythagorean triple is either a primitive triple or a multiple of one.

Euclid's Formula generates all primitive triples: choose integers m > n > 0 where GCD(m,n)=1 and m,n have opposite parity (one even, one odd):

  • a = m² − n²
  • b = 2mn
  • c = m² + n²

Example: m=2, n=1: a=3, b=4, c=5. m=3, n=2: a=5, b=12, c=13. m=4, n=1: a=15, b=8, c=17. m=4, n=3: a=7, b=24, c=25.

The 10 most common Pythagorean triples and their properties:

  • (3, 4, 5): Area=6, Perimeter=12, Angles≈36.87°/53.13°/90°. The most famous, used in construction to verify right angles.
  • (5, 12, 13): Area=30, Perimeter=30. Unique property: area equals perimeter numerically.
  • (8, 15, 17): Area=60, Perimeter=40.
  • (7, 24, 25): Area=84, Perimeter=56.
  • (20, 21, 29): Area=210, Perimeter=70.
  • (9, 40, 41): Area=180, Perimeter=90. Note: 90 = 2×45, perimeter = 2×area/leg₁.
  • (12, 35, 37): Area=210, Perimeter=84.
  • (11, 60, 61): Area=330, Perimeter=132.
  • (28, 45, 53): Area=630, Perimeter=126.
  • (33, 56, 65): Area=924, Perimeter=154. Also 65 = 5×13 so (33,56,65) is non-primitive? Check: GCD(33,56)=1, GCD(56,65)=1 ✓ primitive.

There are infinitely many Pythagorean triples — Euclid's formula generates them all. Fermat's Last Theorem (proved by Andrew Wiles in 1995) shows that aⁿ + bⁿ = cⁿ has no positive integer solutions for n ≥ 3 — so Pythagorean-style triples exist only for the specific case n=2.

Real-World Applications of the Pythagorean Theorem

  • Construction and Architecture: The "3-4-5 rule" is used by builders to ensure walls are perfectly perpendicular. Mark 3 units along one wall, 4 units along the adjacent wall — the diagonal should be exactly 5 units. Any multiple works: (6-8-10), (9-12-15), etc. Surveyors use it to calculate distances across inaccessible terrain by measuring two perpendicular legs of a right triangle.
  • Navigation: GPS coordinates use the Pythagorean theorem extended to 3D: distance = √(Δx² + Δy² + Δz²). The distance between two points (x₁,y₁) and (x₂,y₂) on a map: d = √((x₂−x₁)² + (y₂−y₁)²) — this IS the Pythagorean theorem applied in the coordinate plane. Our Midpoint Calculator uses this same formula for segment analysis. See also our Point Slope Form Calculator for coordinate geometry.
  • Physics: Vector magnitudes use the Pythagorean theorem: |v| = √(vₓ² + vᵧ²) for 2D velocity vectors, |v| = √(vₓ² + vᵧ² + v_z²) in 3D. Impedance in AC circuits: Z = √(R² + X²) where R is resistance and X is reactance. The Pythagorean theorem governs orthogonal components throughout physics.
  • Computer Graphics: Distance between pixels: d = √((x₂−x₁)² + (y₂−y₁)²). Screen diagonal calculation (e.g., "27-inch monitor" refers to the diagonal of the screen): d = √(width² + height²). A 1920×1080 display: d = √(1920²+1080²) = √(3686400+1166400) = √4852800 ≈ 2202 pixels. For a 27-inch diagonal: PPI = 2202/27 ≈ 81.6 pixels per inch. Collision detection, ray tracing, and 3D rendering all rely on Pythagorean distance.
  • Carpentry and Staircase Design: Stair rise-run calculation: if a stair has a rise of 7 inches and run of 11 inches, the stringer (diagonal board) length for each step is √(7²+11²) = √(49+121) = √170 ≈ 13.04 inches. For a 14-step staircase: total stringer ≈ 14 × 13.04 ≈ 182.5 inches. The overall stringer also forms a right triangle: total rise = 14×7 = 98 in, total run = 14×11 = 154 in, diagonal = √(98²+154²) ≈ 183 in.
  • Astronomy: Stellar distances use the Pythagorean theorem in 3D space. The distance to a star at position (x,y,z) from Earth at origin: d = √(x²+y²+z²) light-years. The diameter of a galaxy viewed edge-on: if we know the true diameter D and the observed angle θ, the "depth" perpendicular to our line of sight uses Pythagorean geometry. The Event Horizon Telescope image of M87*'s black hole used interferometry with baselines computed via Pythagorean distances between telescopes on Earth.
  • Medicine and Imaging: CT scanners reconstruct 3D images by combining 2D slices. The voxel size in 3D: v = √(Δx²+Δy²+Δz²). Distance measurements in MRI images (tumor size, bone length) use the Pythagorean theorem. Dosimetry in radiation therapy: the distance from a radiation source to a point in tissue is calculated Pythagoreanly to apply the inverse-square attenuation law.

Extensions: 3D Pythagorean Theorem and Non-Euclidean Geometry

  • 3D Space Diagonal: For a rectangular box with dimensions l × w × h, the space diagonal is d = √(l²+w²+h²). This is the 3D Pythagorean theorem — apply it twice: first find floor diagonal √(l²+w²), then apply Pythagorean theorem again with height h: d = √(l²+w²+h²). Example: 3×4×5 box → floor diagonal = √(9+16) = 5, space diagonal = √(25+25) = √50 = 5√2 ≈ 7.071.
  • Generalized Pythagoras: The Law of Cosines generalizes the Pythagorean theorem to any triangle: c² = a² + b² − 2ab·cos(C). For C=90°, cos(90°)=0, recovering a²+b²=c². For acute triangles (C0 so c²90°), cos(C)a²+b². Use our Trigonometry Calculator for arbitrary triangle computations.
  • Spherical Pythagorean Theorem: On a sphere with radius R, the Pythagorean theorem becomes: cos(c/R) = cos(a/R)·cos(b/R), where a, b, c are arc lengths. This is used in spherical trigonometry for navigation on Earth's surface. For small triangles relative to R, this reduces to the flat Pythagorean theorem.
  • Hyperbolic Pythagorean Theorem: In hyperbolic geometry (negative curvature): cosh(c) = cosh(a)·cosh(b), where the ordinary √(a²+b²) relation is replaced by the hyperbolic cosine identity. Hyperbolic geometry models the intrinsic geometry of negatively curved surfaces like saddle shapes.
  • Hypotenuse Calculator — Specialized for hypotenuse and right-triangle problems with a comprehensive right-triangle solver that includes angle computation in degrees and radians, all trigonometric ratios (sin, cos, tan, csc, sec, cot), and the Law of Sines and Cosines for non-right triangles. The Hypotenuse Calculator is the companion tool for all sides of right-triangle analysis where the Pythagorean theorem is the core formula. Both tools confirm c=√(a²+b²) for legs a and b.
  • Trigonometry Calculator — Computes all six trigonometric functions (sin, cos, tan, csc, sec, cot) for any angle. The angles α and β derived from the Pythagorean theorem (α=arctan(a/b), β=arctan(b/a)) feed directly into trigonometric analysis. The Law of Cosines (c²=a²+b²−2ab·cos(C)) is the natural extension of the Pythagorean theorem to non-right triangles — the Trig Calculator applies it for any triangle configuration.
  • Midpoint Calculator — The circumcircle of any right triangle has its center at the midpoint of the hypotenuse (Thales' theorem: R=c/2). The Midpoint Calculator finds M=((x₁+x₂)/2, (y₁+y₂)/2) — the circumcircle center — and also computes the distance between two points d=√((x₂−x₁)²+(y₂−y₁)²), which is the Pythagorean theorem applied in coordinate geometry. These two tools are fundamentally linked through the distance formula.
  • Point Slope Form Calculator — The distance between two points in the coordinate plane d=√((x₂−x₁)²+(y₂−y₁)²) uses the Pythagorean theorem with legs Δx=x₂−x₁ and Δy=y₂−y₁. The Point Slope Form Calculator builds on this foundation: given a line through two points, it first computes this Pythagorean distance, then derives the line equation in all four forms. Line perpendicularity (m₁·m₂=−1) is also a consequence of the Pythagorean theorem applied to direction vectors.
  • Arc Length Calculator — Arc length s=rθ and sector calculations use the inscribed circle (inradius r=(a+b−c)/2) and circumscribed circle (circumradius R=c/2) of right triangles. The Arc Length Calculator computes the circumference of the incircle (2πr) and circumcircle (2πR=πc), connecting the Pythagorean theorem to circular geometry. In polar coordinates, infinitesimal arc length ds=√(r²+(dr/dθ)²)dθ is itself a Pythagorean formula in disguise.
🧮 Math calculator