Pythagorean Theorem Calculator

Three modes: solve for any missing side of a right triangle (a²+b²=c²), list Pythagorean triples up to a limit, and calculate 3D distance between two points.

Guides & Reference

How It Works

Solve Triangle mode — any two sidesFinding missing side, checking right angle, construction, carpentry.

Enter any two sides (a, b for legs, or c for hypotenuse) and leave the third blank. The calculator applies a²+b²=c² or rearrangements. Also shows both acute angles in degrees (using arctan and arcsin), area = (1/2)×a×b, and perimeter = a+b+c. For a=3, b=4: c=5, angle A=36.87°, angle B=53.13°, area=6, perimeter=12.

c = √(a²+b²) | a = √(c²−b²) | angles via arctana=3,b=4 → c=5, A=36.87°, B=53.13°, area=6
Pythagorean Triples mode — listing all triplesNumber theory, geometry problems, construction (perfect right angles).

Enter a limit n. The calculator lists all primitive Pythagorean triples with hypotenuse ≤ n. A primitive triple has GCD(a,b,c)=1. All multiples are also triples. Generated using the parametric formula: a=m²−n², b=2mn, c=m²+n² where m>n>0, GCD(m,n)=1, and m−n is odd.

Primitive: a=m²−n², b=2mn, c=m²+n² (m>n, coprime, m−n odd)Limit 50 → (3,4,5),(5,12,13),(8,15,17),(7,24,25),(20,21,29)...
3D Distance mode — Euclidean distance in spacePhysics, 3D geometry, distance between GPS coordinates, engineering.

Enter coordinates (x₁,y₁,z₁) and (x₂,y₂,z₂). Distance = √((x₂−x₁)²+(y₂−y₁)²+(z₂−z₁)²). This extends the 2D formula by adding the z-component squared. The midpoint in 3D also displays: ((x₁+x₂)/2,(y₁+y₂)/2,(z₁+z₂)/2). Component distances Δx, Δy, Δz display separately.

d = √(Δx²+Δy²+Δz²) | 2D is z=0 special casePoints (1,2,3) and (4,6,3) → d=√(9+16+0)=5
Angles from the sidesTrigonometry, finding angles without a protractor.

From the solved triangle, angle A (opposite side a) = arctan(a/b). Angle B = 90° − A. Both angles display in degrees. For verification: sin(A)=a/c, cos(A)=b/c. Example: a=5, b=12, c=13 → angle A=arctan(5/12)=22.62°, angle B=67.38°. Verify: sin(22.62°)=5/13≈0.385 ✓.

A = arctan(a/b) | B = 90° − A | A+B = 90°a=5,b=12 → A=22.62°, B=67.38°
The 3-4-5 trick for right anglesConstruction, carpentry, laying foundations.

Any triangle with sides proportional to 3-4-5 is a right triangle. To create a perfect 90° corner: measure 3 units along one wall, 4 units along the other, and adjust until the diagonal is exactly 5 units. This trick works because 3²+4²=5². Scaling: 6-8-10, 9-12-15, 30-40-50. Carpenters have used this for thousands of years.

3²+4²=5² | Scales: (3k,4k,5k) for any k3-4-5: 9+16=25 ✓ | Scale 10: 30-40-50

Quick Reference

Verify these in the calculator above.

Solve

a=3,b=4 → c

5

Solve

a=5,b=12 → c

13

Leg

c=13,b=12 → a

5

Triple

a=8,b=15 → c

17

Triples

Smallest triple

(3,4,5)

3D dist

3D: (0,0,0) to (3,4,0)

5

3D dist

3D: (1,2,3) to (4,6,3)

5

Area

Area: a=3,b=4

6

Tips & Shortcuts

Leave one field blank in Solve Triangle mode — the calculator finds whichever side or leg is missing based on which field is empty.

Use Pythagorean Triples mode with limit=100 to get all classic triples including (3,4,5), (5,12,13), (8,15,17), and (7,24,25).

For 2D distance, use 3D Distance mode with z₁=z₂=0 — it reduces to √((x₂−x₁)²+(y₂−y₁)²) automatically.

The 3-4-5 proportion scales to any size: multiply all three by any number k to get another valid Pythagorean triple (3k,4k,5k).

Area of the right triangle = (1/2) × leg_a × leg_b — shown in the Solve Triangle results panel.

Common Mistakes

Squaring the hypotenuse instead of a leg

c² = a² + b² is for the hypotenuse. For a leg: a² = c² − b². Entering hypotenuse values into leg fields gives wrong results — the calculator labels each field clearly.

Expecting integer results for all triangles

Most right triangles do not have integer sides. Only Pythagorean triples (3-4-5, 5-12-13, etc.) give all-integer sides. For sides 5 and 7: c=√74≈8.602 — a decimal is correct.

Confusing the hypotenuse with the longest leg

The hypotenuse is always opposite the right angle and always the longest side. In a right triangle, the hypotenuse is c in a²+b²=c². Enter it in the c field, not the a or b field.

Applying the theorem to non-right triangles

a²+b²=c² only holds for right triangles. For oblique triangles, use the Law of Cosines: c²=a²+b²−2ab×cos(C). The Pythagorean theorem is a special case with C=90°.

Forgetting to check GCD when using triples

Primitive triples like (3,4,5) have GCD=1. Multiples like (6,8,10) are valid triples but not primitive. The Triples mode lists primitive triples — multiply by any integer for all valid triples.

Frequently Asked Questions

In a right triangle: a² + b² = c² where c is the hypotenuse (longest side, opposite the right angle). Enter any two sides to find the third. Example: a=3, b=4 → c=√(9+16)=5.

Hypotenuse c = √(a² + b²). Enter legs a and b, leave c blank. Example: a=5, b=12 → c=√(25+144)=√169=13. The 5-12-13 triangle is a Pythagorean triple.

Sets of three integers (a,b,c) satisfying a²+b²=c². Primitive triples: (3,4,5), (5,12,13), (8,15,17), (7,24,25). All multiples are also triples: (6,8,10), (9,12,15). Use Pythagorean Triples mode to list all triples up to any limit.

Leg a = √(c² − b²). Enter the hypotenuse and the known leg, leave the missing leg blank. Example: c=10, b=6 → a=√(100−36)=√64=8.

3D distance = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). This is the Pythagorean theorem applied twice. Switch to 3D Distance mode and enter coordinates of both points.

Check if a²+b²=c² where c is the largest side. For (6,8,10): 36+64=100=10² ✓. For (5,6,7): 25+36=61≠49 ✗ — not a right triangle. Use Solve Triangle mode: enter all three sides and check if the result is consistent.

Primitive triples with c below 50: (3,4,5), (5,12,13), (8,15,17), (7,24,25), (20,21,29), (9,40,41), (12,35,37), (11,60,61). Every primitive triple has one even number and one multiple of 3. Use Pythagorean Triples mode to generate the full list.

Related Calculators