Pythagorean Theorem Calculator

Solve any right triangle using the legendary a² + b² = c². Compute the hypotenuse or either leg, visualize the triangle, and explore detailed step‑by‑step solutions. Includes historical context, multiple proofs, and real‑world applications.

a =
b =
Enter positive numbers. The calculator will validate that the triangle is a valid right triangle.
? 3‑4‑5 : a=3, b=4, c=5
? 5‑12‑13 : a=5, b=12, c=13
? 8‑15‑17 : a=8, b=15, c=17
? 7‑24‑25 : a=7, b=24, c=25
? √2 triangle : a=1, b=1, c=√2
? 30‑60‑90 : a=1, b=√3, c=2
Privacy first: All calculations are performed locally in your browser. No data is sent to any server.

Understanding the Pythagorean Theorem

The Pythagorean theorem is one of the most fundamental and celebrated results in all of mathematics. It states that in a right triangle — a triangle containing a 90° angle — the square of the length of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the lengths of the other two sides (the legs). In algebraic form:

a² + b² = c²

where c is the hypotenuse, and a and b are the legs.

Named after the ancient Greek mathematician Pythagoras of Samos (c. 570 – c. 495 BC), this theorem has been known and used for millennia. However, evidence suggests that Babylonian and Indian mathematicians were aware of the relationship centuries earlier. The theorem is a cornerstone of Euclidean geometry and has countless applications in science, engineering, architecture, and everyday life.

The Theorem in Words

For any right triangle, the area of the square built on the hypotenuse is equal to the sum of the areas of the squares built on the other two sides. This geometric interpretation is often visualized with squares attached to each side of the triangle — a classic illustration that makes the theorem intuitively clear.

Why It Matters

  • Foundational: It underpins trigonometry, analytic geometry, and calculus.
  • Practical: Used in construction, navigation, computer graphics, and physics.
  • Unifying: Connects algebra and geometry in a beautiful and accessible way.
  • Educational: Serves as a gateway to higher mathematics for millions of students worldwide.

Historical Roots and Evolution

While the theorem bears Pythagoras's name, historical research reveals that the relationship was known to the ancient Babylonians as early as 1800 BC. The Plimpton 322 clay tablet contains a list of Pythagorean triples — integer solutions to a² + b² = c² — demonstrating that Babylonian scribes had a working knowledge of the theorem long before Pythagoras. Similarly, the Shulba Sutras (Indian texts from around 800–600 BC) describe the theorem in the context of altar construction.

Pythagoras and his followers are credited with the first formal proof of the theorem, though no written record survives. The earliest known proof is found in Euclid's Elements (c. 300 BC), where it appears as Proposition 47 of Book I. Since then, hundreds of distinct proofs have been discovered — including one by U.S. President James A. Garfield — making it one of the most-proved theorems in history.

How to Use This Calculator

  1. Choose your target: Select whether you want to find the hypotenuse (c) or one of the legs (a or b).
  2. Enter known values: Input the lengths of the two known sides. All values must be positive real numbers.
  3. Click "Calculate & Visualize": The tool computes the unknown side, displays the step‑by‑step solution, and draws the triangle with labeled sides and angles.
  4. Explore examples: Use the preset buttons to instantly load classic Pythagorean triples or special right triangles.

Step‑by‑Step Derivation

Given: a right triangle with legs a and b, and hypotenuse c.

Theorem: a² + b² = c²

To find the hypotenuse: c = √(a² + b²)

To find a leg: a = √(c² − b²)   or   b = √(c² − a²)

The theorem can be proven in numerous ways. One of the most elegant is the area rearrangement proof: arrange four identical right triangles inside a square to show that the area of the large square equals the sum of the areas of the smaller squares. This visual proof is often used in classrooms because it requires no algebra — just geometry and spatial reasoning.

Pythagorean Triples

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c². These triples have fascinated mathematicians for centuries. The smallest and most famous triple is (3, 4, 5). Others include (5, 12, 13), (8, 15, 17), and (7, 24, 25). Euclid provided a formula for generating all primitive triples: for integers m > n > 0, with m and n coprime and of opposite parity, set a = m² − n², b = 2mn, c = m² + n².

Pythagorean triples have practical applications in construction, surveying, and computer graphics. They also appear in number theory, where they relate to Fermat's Last Theorem and the study of elliptic curves.

Triple a b c Area Perimeter
3‑4‑5 3 4 5 6 12
5‑12‑13 5 12 13 30 30
8‑15‑17 8 15 17 60 40
7‑24‑25 7 24 25 84 56
20‑21‑29 20 21 29 210 70
9‑40‑41 9 40 41 180 90

Real‑World Applications

Case Study: Construction and Carpentry

Builders and carpenters use the Pythagorean theorem daily to ensure square corners and precise layouts. The "3‑4‑5 rule" is a classic technique: to check that a corner is square, measure 3 units along one wall, 4 units along the other, and verify that the diagonal is exactly 5 units. This simple application prevents crooked foundations and misaligned structures. Our calculator can instantly verify any set of measurements, saving time and reducing errors.

Case Study: Navigation and GPS

In navigation, the Pythagorean theorem is used to calculate direct distances between two points given their horizontal and vertical displacements. GPS receivers apply the theorem (in three dimensions) to compute your position from satellite signals. Pilots and sailors use it to plan routes and estimate travel times. Our interactive tool helps visualize these distance calculations in a simple, two‑dimensional setting.

  • Architecture: Designing roofs, staircases, and ramps.
  • Computer Graphics: Calculating distances, collision detection, and rendering.
  • Physics: Resolving vector components in mechanics and electromagnetism.
  • Surveying: Measuring land areas and distances across terrain.
  • Sports: Analyzing trajectories in baseball, golf, and soccer.

Common Misconceptions

  • "The Pythagorean theorem only works for right triangles." — Correct. It is exclusively valid for right triangles. For other triangles, use the Law of Cosines.
  • "The hypotenuse is always the longest side." — True, and it is always opposite the right angle.
  • "Any three numbers can form a right triangle." — False. They must satisfy a² + b² = c² (with c the largest).
  • "Pythagoras invented the theorem from scratch." — He formalized and proved it, but the relationship was known earlier in Babylon and India.

Visual Proofs of the Theorem

Euclid's Proof (Elements I.47)

Euclid's proof is a masterpiece of geometric reasoning. He constructs squares on each side of the right triangle and then uses congruence and area arguments to show that the square on the hypotenuse equals the sum of the other two squares. The proof is entirely visual and relies on the concept of equal areas of triangles within the squares.

Garfield's Trapezoid Proof

In 1876, James A. Garfield — then a U.S. Congressman, later President — published a proof using a trapezoid. He arranged two identical right triangles and a smaller right triangle to form a trapezoid, then computed the area in two different ways. The result is a concise algebraic proof that is accessible to high school students.

Area Rearrangement (Dissection Proof)

This proof uses four congruent right triangles arranged within a square. By comparing the area of the large square with the sum of the areas of the four triangles and the smaller central square, one obtains a² + b² = c². This is perhaps the most intuitive and visually appealing proof.

Frequently Asked Questions

It is used to find the length of a side in a right triangle when the other two sides are known. Applications include construction, navigation, computer graphics, physics, and everyday problem-solving.

No. The Pythagorean theorem applies only to right triangles. For non‑right triangles, use the Law of Cosines: c² = a² + b² − 2ab·cos(C).

A set of three positive integers (a, b, c) that satisfy a² + b² = c². Examples include (3,4,5), (5,12,13), and (8,15,17).

Results are computed with double‑precision floating‑point arithmetic, accurate to about 15 decimal digits. For most practical and educational purposes, this is more than sufficient.

The calculator validates all inputs. If you enter a negative value or a hypotenuse that is too small relative to a leg, a clear warning will appear. The triangle must be valid to compute results.

Explore authoritative resources such as Wolfram MathWorld, Khan Academy, or Euclid's Elements (Book I, Proposition 47).

Rooted in classical geometry and modern pedagogy — This tool is built upon the rigorous foundations of Euclidean geometry as established by Euclid and refined by generations of mathematicians. The interactive implementation follows best practices in educational technology, verified against multiple authoritative sources including MathWorld, the Khan Academy curriculum, and standard geometry textbooks. Reviewed by the GetZenQuery tech  team, last updated July 2026.

References: MathWorld: Pythagorean Theorem; Euclid, Elements I.47; Wikipedia: Pythagorean theorem; Coxeter, H.S.M. Geometry Revisited (1967).