Navigation
Calculators Pricing Blog About Contact
Get Started
Get Started Login
📐

Pythagorean Theorem Calculator

Solve for any side of a right triangle using the Pythagorean theorem a² + b² = c². Enter two sides to find the third.

Enter any two sides of a right triangle and leave the third blank. The calculator will solve for the missing side using the Pythagorean theorem a² + b² = c².

Leg of the triangle
Leg of the triangle
Longest side

What Is the Pythagorean Theorem?

The Pythagorean theorem is one of the most fundamental principles in all of mathematics. It describes the relationship between the three sides of a right triangle — a triangle that contains one 90-degree angle. In simple terms, the theorem states that the square of the hypotenuse (the longest side, opposite the right angle) is equal to the sum of the squares of the other two sides.

This relationship has been known for thousands of years and remains one of the most widely used formulas in geometry, engineering, physics, architecture, and everyday problem-solving. Whether you are calculating the diagonal of a room, determining the distance between two points on a map, or designing a structural support, the Pythagorean theorem provides the mathematical foundation to find the answer.

The theorem applies exclusively to right triangles. If a triangle does not contain a 90-degree angle, the Pythagorean theorem does not hold, and other formulas — such as the law of cosines — must be used instead. However, because right angles appear so frequently in the real world (walls meeting floors, corners of buildings, screen dimensions), the Pythagorean theorem has an enormous range of practical applications.

Key concept: A right triangle has exactly one 90-degree angle. The side opposite this right angle is called the hypotenuse, and it is always the longest side of the triangle. The other two sides are called legs.

The Pythagorean Theorem Formula

The Pythagorean theorem is expressed as a simple algebraic equation that relates the lengths of the three sides of a right triangle:

a² + b² = c²
Where a and b are the legs and c is the hypotenuse

In this formula, a and b represent the lengths of the two legs of the right triangle, and c represents the length of the hypotenuse. Because the equation involves squares, the order of a and b does not matter — you can assign either leg to either variable.

The formula can be rearranged to solve for any of the three sides:

c = √(a² + b²)
Solve for the hypotenuse when both legs are known
a = √(c² − b²)
Solve for a leg when the hypotenuse and the other leg are known

When solving for a leg, it is essential that the hypotenuse value is greater than the other known leg. If c is less than or equal to either a or b, the values do not form a valid right triangle, and the calculation will produce an error (you cannot take the square root of a negative number in real-number arithmetic).

How to Use the Pythagorean Theorem

Using the Pythagorean theorem involves three straightforward steps. Once you identify that you are working with a right triangle and know two of the three side lengths, solving for the unknown side is a matter of substitution and basic algebra.

Step 1: Identify the Right Triangle

Confirm that the triangle in question contains a 90-degree angle. The side directly opposite this right angle is the hypotenuse (c), and the two sides that form the right angle are the legs (a and b). In many real-world scenarios, the right angle is formed by vertical and horizontal surfaces — such as a wall and the ground, or the two edges of a rectangular screen.

Step 2: Determine Which Side to Solve For

Figure out which value is unknown. If you know both legs (a and b), you will solve for the hypotenuse (c). If you know the hypotenuse and one leg, you will solve for the other leg. Our calculator above makes this easy — simply enter the two values you know and leave the third field empty.

Step 3: Substitute and Calculate

Plug your known values into the appropriate rearrangement of the formula and compute the result. For instance, if a = 5 and b = 12, then c = √(25 + 144) = √169 = 13. Always double-check that your answer makes sense: the hypotenuse should be longer than either individual leg, and a leg should be shorter than the hypotenuse.

Common mistake: A frequent error is misidentifying which side is the hypotenuse. Remember, the hypotenuse is always opposite the right angle and is always the longest side. If your calculated hypotenuse is shorter than one of the legs, recheck your inputs.

Pythagorean Theorem Examples

Working through examples is the best way to build confidence with the Pythagorean theorem. Below are several examples covering different scenarios.

Example 1: Finding the Hypotenuse

Problem: A right triangle has legs of length 3 and 4. Find the hypotenuse.

Solution:

  • c² = a² + b² = 3² + 4² = 9 + 16 = 25
  • c = √25 = 5

This is the classic 3-4-5 right triangle, one of the most well-known Pythagorean triples.

Example 2: Finding a Leg

Problem: A right triangle has a hypotenuse of 13 and one leg of length 5. Find the other leg.

Solution:

  • b² = c² − a² = 13² − 5² = 169 − 25 = 144
  • b = √144 = 12

Example 3: Non-Integer Result

Problem: A right triangle has legs of length 7 and 9. Find the hypotenuse.

Solution:

  • c² = 7² + 9² = 49 + 81 = 130
  • c = √130 ≈ 11.4018

Not all right triangles produce neat, whole-number answers. When the result is irrational, it is common to round to a practical number of decimal places.

Example 4: Real-World Scenario

Problem: A ladder leans against a wall. The base of the ladder is 6 feet from the wall, and the ladder is 10 feet long. How high up the wall does the ladder reach?

Solution: The ladder forms the hypotenuse (c = 10), the distance from the wall is one leg (a = 6), and the height up the wall is the other leg (b).

  • b² = 10² − 6² = 100 − 36 = 64
  • b = √64 = 8 feet

Real-World Applications

The Pythagorean theorem is far more than an abstract mathematical concept studied in school. It is applied constantly across a wide range of professions and everyday situations. Understanding where and how it appears in the real world underscores its importance.

Construction and Architecture

Builders use the Pythagorean theorem to ensure that corners are square (exactly 90 degrees). The classic "3-4-5 method" involves measuring 3 feet along one wall and 4 feet along the adjacent wall. If the diagonal between those two points measures exactly 5 feet, the corner is a perfect right angle. This technique has been used for centuries and remains a standard practice on modern construction sites.

Navigation and GPS

The distance between two points on a flat plane can be calculated using the Pythagorean theorem. If you know the difference in x-coordinates and y-coordinates between two points, the straight-line distance is the hypotenuse of the right triangle formed by those differences. GPS systems and mapping software rely on extensions of this principle to calculate distances between locations.

Screen Dimensions

Television and monitor sizes are measured diagonally. If you know the width and height of a screen, the Pythagorean theorem gives you the diagonal measurement. For example, a monitor that is 16 inches wide and 12 inches tall has a diagonal of √(256 + 144) = √400 = 20 inches.

Physics and Engineering

In physics, the Pythagorean theorem is used to resolve vectors into components and to calculate resultant forces. Engineers use it to design ramps, bridges, roof trusses, and any structure involving triangular support. The theorem also plays a role in electrical engineering when calculating impedance in AC circuits.

Art and Design

Graphic designers and artists use the Pythagorean theorem to calculate proportions, ensure symmetric layouts, and determine distances within their compositions. It is also essential in 3D modeling, where the theorem extends to three dimensions as d = √(x² + y² + z²).

Common Pythagorean Triples

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy the equation a² + b² = c². These triples represent right triangles with whole-number side lengths. They are especially useful because they allow for exact calculations without irrational numbers or rounding.

Primitive triples are Pythagorean triples where the three numbers share no common factor other than 1. Any Pythagorean triple can be generated by multiplying a primitive triple by a positive integer. For example, multiplying the (3, 4, 5) triple by 2 gives (6, 8, 10), which is also a valid Pythagorean triple.

Here are some of the most commonly encountered Pythagorean triples:

  • (3, 4, 5) — The most famous triple. 9 + 16 = 25.
  • (5, 12, 13) — Frequently used in geometry problems. 25 + 144 = 169.
  • (8, 15, 17) — A less obvious triple. 64 + 225 = 289.
  • (7, 24, 25) — Useful in advanced problems. 49 + 576 = 625.
  • (9, 40, 41) — A larger primitive triple. 81 + 1600 = 1681.
  • (20, 21, 29) — Notable because the two legs differ by just 1. 400 + 441 = 841.
  • (11, 60, 61) — Another triple with consecutive values for b and c. 121 + 3600 = 3721.

Multiples of these primitive triples also form valid Pythagorean triples. For instance, doubling (3, 4, 5) gives (6, 8, 10), tripling it gives (9, 12, 15), and so on. There are infinitely many Pythagorean triples, and mathematicians have developed formulas to generate them systematically. One classic method, attributed to Euclid, generates all primitive triples using two positive integers m and n where m > n: a = m² − n², b = 2mn, c = m² + n².

History of the Pythagorean Theorem

The Pythagorean theorem is named after the ancient Greek mathematician Pythagoras of Samos (c. 570 – c. 495 BCE), who is traditionally credited with its first formal mathematical proof. However, the relationship described by the theorem was known to various civilizations long before Pythagoras.

Ancient Babylon (c. 1800 BCE)

Clay tablets from ancient Mesopotamia, such as the famous Plimpton 322 tablet, contain lists of Pythagorean triples dating to around 1800 BCE — more than a thousand years before Pythagoras was born. This demonstrates that Babylonian mathematicians understood the relationship between the sides of a right triangle and could generate accurate triples, though it is unclear whether they had a formal proof of the theorem.

Ancient India (c. 800 – 600 BCE)

The Indian mathematical text Sulba Sutras, written between approximately 800 and 600 BCE, contains explicit statements of the Pythagorean theorem along with geometric constructions that rely on it. The Baudhayana Sulba Sutra, one of the oldest of these texts, includes what many scholars consider the earliest known statement of the theorem in general form.

Ancient China (c. 1000 – 200 BCE)

In China, the Pythagorean theorem is known as the Gougu theorem (the "Gou-Gu" refers to the two shorter sides of the right triangle). The Chinese mathematical text Zhoubi Suanjing (c. 1000 BCE) includes a discussion of the 3-4-5 triangle, and the later Jiuzhang Suanshu (Nine Chapters on the Mathematical Art, c. 200 BCE) applies the theorem to a variety of practical problems.

Pythagoras and the Greeks

Pythagoras founded a philosophical and mathematical school in southern Italy around 530 BCE. His school, the Pythagoreans, studied mathematics as a path to understanding the universe. While the Pythagoreans are credited with the first formal proof of the theorem, the exact nature of this proof has been lost to history. The earliest surviving proof appears in Euclid's Elements (c. 300 BCE), where it is presented as Proposition 47 of Book I.

Modern Era

Over the centuries, hundreds of distinct proofs of the Pythagorean theorem have been discovered. The mathematician Elisha Scott Loomis cataloged 367 proofs in his 1927 book The Pythagorean Proposition. Famous contributors of proofs include U.S. President James Garfield, who published an original proof in 1876 using a trapezoid construction, and Leonardo da Vinci, who devised a proof based on congruent quadrilaterals. The theorem remains one of the most proven results in all of mathematics, reflecting its deep and universal significance.

Did you know? The Pythagorean theorem can be extended to three dimensions. For a rectangular box with sides of length a, b, and c, the space diagonal d is calculated as d = √(a² + b² + c²). This extension is used in 3D graphics, physics simulations, and spatial analysis.

Frequently Asked Questions

The Pythagorean theorem states that in a right triangle, the square of the hypotenuse (the side opposite the 90-degree angle) is equal to the sum of the squares of the other two sides. It is written as a² + b² = c², where a and b are the legs and c is the hypotenuse.
Enter any two of the three side values (side a, side b, or hypotenuse c) into the calculator and leave the third field blank. Click Calculate, and the tool will solve for the missing side and show the step-by-step solution. The calculator works for finding the hypotenuse or either leg.
A Pythagorean triple is a set of three positive integers that satisfy the Pythagorean theorem (a² + b² = c²). Common examples include (3, 4, 5), (5, 12, 13), and (8, 15, 17). Any multiple of a Pythagorean triple is also a valid triple — for example, (6, 8, 10) is a multiple of (3, 4, 5).
No. The Pythagorean theorem only applies to right triangles — triangles that have exactly one 90-degree angle. For non-right triangles, you would need to use the law of cosines: c² = a² + b² − 2ab·cos(C), which generalizes the Pythagorean theorem to any triangle.
In a right triangle, the hypotenuse is opposite the largest angle (90 degrees). A fundamental property of triangles is that the longest side is always opposite the largest angle. Since no other angle in a right triangle can be 90 degrees or more, the hypotenuse is always the longest side.
Yes. The Pythagorean theorem extends to three dimensions. For a rectangular box with edges a, b, and c, the length of the space diagonal is d = √(a² + b² + c²). This is commonly used in 3D graphics, physics, and spatial distance calculations.
While the theorem is named after the Greek mathematician Pythagoras (c. 570–495 BCE), the relationship was known to earlier civilizations. Babylonian clay tablets from around 1800 BCE contain Pythagorean triples, and Indian texts (Sulba Sutras) from around 800 BCE state the theorem explicitly. Pythagoras is credited with providing the first formal mathematical proof.

Embed this Calculator

Copy the code below and paste it into your website's HTML. Your visitors can use this calculator for free.

px × px
<iframe src="https://calculatorteam.com/embed/pythagorean-theorem-calculator" width="100%" height="600" style="border:none;border-radius:12px;" loading="lazy" title="Pythagorean Theorem Calculator"></iframe>

Report an Issue

Let us know what's wrong with this calculator. We'll review and fix it as soon as possible.