Skip to content

Pythagorean Theorem Calculator — Free Online Tool

Solve for any side of a right triangle using the Pythagorean theorem (a² + b² = c²) with instant step-by-step solutions and verification.

Solve For

Result

a² + b² = c²

5.0000

Step-by-Step

c = √(3² + 4²) = √(9 + 16) = 5.0000

Side a

3.0000

Side b

4.0000

Hypotenuse c

5.0000

Verification

3.0000² + 4.0000² = 25.00005.0000² = 25.0000

How to Use the Pythagorean Theorem Calculator

  1. Choose what to solve for: Use the radio buttons to select which side of the right triangle you want to find. Select "Solve for c (hypotenuse)" to find the longest side, or "Solve for a" or "Solve for b" to find one of the shorter legs. The input fields automatically adjust based on your selection.
  2. Enter the known values: Input the two side lengths you already know. When solving for the hypotenuse, enter both legs (a and b). When solving for a leg, enter the other leg and the hypotenuse. All values must be positive numbers. The hypotenuse must be longer than either individual leg for the calculation to work.
  3. Review the results: The calculator instantly shows the missing side value, a detailed step-by-step computation showing each mathematical operation, all three side lengths displayed together, and a verification section that confirms a² + b² equals c². Results update in real time as you modify inputs.

The default values are the classic 3-4-5 Pythagorean triple, which you can see verified in the results panel. Change the values to solve any right triangle problem you encounter.

Pythagorean Theorem Formulas

Standard Form

a² + b² = c²

Solve for Hypotenuse (c)

c = √(a² + b²)

Solve for Leg (a)

a = √(c² − b²)

Solve for Leg (b)

b = √(c² − a²)

Variables Explained

  • a (leg): One of the two shorter sides of the right triangle that form the right angle. In the standard orientation, this is typically the vertical side.
  • b (leg): The other shorter side of the right triangle forming the right angle. In the standard orientation, this is typically the horizontal side. The labels a and b are interchangeable.
  • c (hypotenuse): The longest side of the right triangle, located opposite the 90-degree angle. The hypotenuse is always longer than either leg individually but shorter than the sum of both legs.

Step-by-Step Example

Find the hypotenuse of a right triangle with legs a = 5 and b = 12:

  1. Write the theorem: a² + b² = c²
  2. Substitute known values: 5² + 12² = c²
  3. Calculate squares: 25 + 144 = c²
  4. Add: 169 = c²
  5. Take the square root: c = √169 = 13

The hypotenuse is 13 units. The set (5, 12, 13) is a well-known Pythagorean triple, meaning all three values are whole numbers that perfectly satisfy the theorem.

Practical Examples

Example 1: Tom's Ladder Placement

Tom needs to reach a window 15 feet above the ground. Safety guidelines recommend placing the ladder base 5 feet from the wall. He needs to determine the minimum ladder length required.

  • Wall height (a) = 15 feet, base distance (b) = 5 feet
  • c = √(15² + 5²) = √(225 + 25) = √250 ≈ 15.81 feet
  • Tom needs at least a 16-foot ladder

A 16-foot ladder will reach the 15-foot window with the base 5 feet from the wall. The actual ladder extends slightly beyond the window, which is recommended for safe climbing. Tom should also ensure the ladder angle is between 70 and 80 degrees for stability.

Example 2: Sarah's TV Size Verification

Sarah bought a 55-inch TV and wants to verify the stated size. She measures the screen width as 47.9 inches and the height as 27 inches. TV sizes are measured diagonally, so she uses the Pythagorean theorem.

  • Width (a) = 47.9 inches, Height (b) = 27 inches
  • Diagonal = √(47.9² + 27²) = √(2,294.41 + 729) = √3,023.41 ≈ 54.99 inches
  • The diagonal is approximately 55 inches, confirming the advertised size

The measured diagonal of 54.99 inches confirms the TV is indeed a 55-inch model. This method works for any rectangular screen, monitor, or display. The aspect ratio of modern TVs is 16:9, meaning the width-to-height ratio is always 16 to 9.

Example 3: James's Property Diagonal

James owns a rectangular lot that is 120 feet wide and 160 feet deep. He wants to install a diagonal walkway across the property and needs to know the exact length.

  • Width (a) = 120 feet, Depth (b) = 160 feet
  • Diagonal = √(120² + 160²) = √(14,400 + 25,600) = √40,000 = 200 feet
  • Walkway materials needed: 200 feet of pavers (3 feet wide = 600 sq ft of pavers)

The diagonal walkway will be exactly 200 feet long. Interestingly, 120-160-200 is a multiple of the 3-4-5 Pythagorean triple (multiplied by 40). For area calculations for the walkway materials, try our area calculator.

Example 4: Elena's Roof Rafter Calculation

Elena is building a shed with a roof that rises 4 feet over a horizontal run of 6 feet. She needs to calculate the rafter length to cut the lumber correctly.

  • Rise (a) = 4 feet, Run (b) = 6 feet
  • Rafter = √(4² + 6²) = √(16 + 36) = √52 ≈ 7.21 feet
  • Adding 1 foot for overhang: 7.21 + 1 = 8.21 feet per rafter

Each rafter needs to be approximately 8.25 feet (8 feet 3 inches) to account for the calculated length plus overhang. Elena should cut the rafters from 10-foot lumber to leave room for angle cuts at both ends. The roof pitch is 4/6 or about 33.7 degrees, which provides good water drainage.

Pythagorean Triples Reference Table

Side a Side b Hypotenuse c a² + b²
3 4 5 9 + 16 = 25 25
5 12 13 25 + 144 = 169 169
6 8 10 36 + 64 = 100 100
7 24 25 49 + 576 = 625 625
8 15 17 64 + 225 = 289 289
9 12 15 81 + 144 = 225 225
9 40 41 81 + 1600 = 1681 1681
12 16 20 144 + 256 = 400 400
20 21 29 400 + 441 = 841 841

Tips and Complete Guide

History of the Pythagorean Theorem

While named after the Greek mathematician Pythagoras (c. 570-495 BCE), evidence of this theorem predates him by over a millennium. A Babylonian clay tablet known as Plimpton 322 (dating to about 1800 BCE) contains a list of Pythagorean triples, suggesting the Babylonians understood and applied the relationship. Ancient Indian mathematicians documented the theorem in the Sulba Sutras around 800 BCE. Chinese mathematicians proved it independently in the Zhoubi Suanjing around 1000 BCE. Despite its ancient origins, the theorem remains one of the most frequently used mathematical tools in modern engineering, physics, and computer science.

Applications in Coordinate Geometry

The Pythagorean theorem is the foundation of the distance formula in coordinate geometry. To find the distance between two points (x₁, y₁) and (x₂, y₂), you calculate d = √((x₂-x₁)² + (y₂-y₁)²), which is the Pythagorean theorem applied to the horizontal and vertical differences. This extends to three dimensions as d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²). Every GPS system, mapping application, and game engine uses this formula to calculate distances. Our distance calculator applies this formula for both 2D and 3D coordinates.

The 3-4-5 Method for Checking Right Angles

The most practical application of the Pythagorean theorem in construction is the 3-4-5 method. To check if a corner is a perfect right angle, measure 3 feet along one wall from the corner, 4 feet along the other wall, and then measure the diagonal between those two points. If the diagonal is exactly 5 feet, the corner is square. For larger projects, use multiples: 6-8-10, 9-12-15, or 12-16-20. Larger measurements give more accurate results because small measurement errors become proportionally smaller. Professional builders frequently use this method when laying foundations, framing walls, and installing tile.

Special Right Triangles

Two special right triangles appear frequently in mathematics and are worth memorizing. The 45-45-90 triangle has legs in a 1:1 ratio and a hypotenuse of √2 times the leg length. The 30-60-90 triangle has sides in a 1:√3:2 ratio. These ratios are derived directly from the Pythagorean theorem and trigonometry. The 45-45-90 triangle describes the diagonal of a square, while the 30-60-90 triangle describes half of an equilateral triangle. Recognizing these patterns can significantly speed up calculations in geometry, trigonometry, and standardized tests.

Common Mistakes to Avoid

  • Applying to non-right triangles: The theorem a² + b² = c² works only for right triangles. Using it on other triangles gives incorrect results. For non-right triangles, use the law of cosines instead.
  • Confusing legs with hypotenuse: The hypotenuse (c) is always the longest side and must be opposite the right angle. Labeling the wrong side as c leads to impossible results like taking the square root of a negative number.
  • Forgetting to take the square root: After calculating a² + b², remember that c² = a² + b², not c = a² + b². You must take the square root of the sum to find c.
  • Rounding too early: When solving multi-step problems, carry extra decimal places through intermediate calculations and round only the final answer. Early rounding accumulates error.
  • Assuming integer results: While Pythagorean triples produce whole numbers, most real-world problems yield irrational numbers. Legs of 4 and 7 give c = √65 ≈ 8.062, not a whole number.

Frequently Asked Questions

The Pythagorean theorem states that in a right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides. Written as a formula: a² + b² = c², where c is the hypotenuse and a and b are the two legs. This theorem is attributed to the Greek mathematician Pythagoras, though evidence suggests it was known to Babylonian mathematicians over a thousand years earlier. It is one of the most fundamental and widely used results in all of mathematics.

To find the hypotenuse (c), substitute the two leg lengths into the formula c = √(a² + b²). For example, if the legs are 6 and 8: c = √(6² + 8²) = √(36 + 64) = √100 = 10. The hypotenuse is always the longest side of a right triangle and is always opposite the 90-degree angle. Our calculator performs this computation instantly when you select 'Solve for c' and enter the two leg values.

Yes. Rearrange the formula to solve for the unknown leg. If you know c and b, then a = √(c² - b²). If you know c and a, then b = √(c² - a²). For example, if the hypotenuse is 13 and one leg is 5: other leg = √(13² - 5²) = √(169 - 25) = √144 = 12. Our calculator supports solving for any of the three sides. Simply select which side you want to find and enter the two known values.

Pythagorean triples are sets of three positive integers that satisfy a² + b² = c². The most famous is (3, 4, 5). Other common triples include (5, 12, 13), (8, 15, 17), (7, 24, 25), and (9, 40, 41). Any multiple of a Pythagorean triple is also a triple. For example, (6, 8, 10) is simply (3, 4, 5) multiplied by 2. These triples are valuable in construction because they guarantee a perfect right angle without needing a protractor. The 3-4-5 method is commonly used by carpenters and builders.

No, the Pythagorean theorem applies only to right triangles (triangles with one 90-degree angle). For non-right triangles, you need the law of cosines: c² = a² + b² - 2ab·cos(C), where C is the angle opposite side c. When C = 90°, cos(90°) = 0, and the formula reduces to the standard Pythagorean theorem. For general triangle calculations including non-right triangles, use our <a href='/math/geometry/triangle-calculator' class='text-primary-600 hover:text-primary-800 underline'>triangle calculator</a>.

The Pythagorean theorem has countless practical applications. Construction workers use it to verify right angles and calculate diagonal measurements. Surveyors determine distances across terrain. Navigation systems calculate straight-line distances between coordinates. TV and monitor sizes are diagonal measurements calculated using the theorem. Architects use it for roof pitch calculations. Electricians calculate wire lengths for diagonal runs. Even video game developers use it to compute distances between objects on a screen.

The 3-4-5 rule is a practical application of the Pythagorean theorem used to create perfect right angles in construction. Measure 3 units along one wall, 4 units along the perpendicular wall, and if the diagonal between those endpoints measures exactly 5 units, the corner is a perfect 90-degree angle. Larger multiples like 6-8-10 or 9-12-15 provide greater accuracy for bigger projects. This technique has been used for thousands of years, dating back to ancient Egyptian rope stretchers who used knotted ropes to lay out right angles for building pyramids.

Yes, the Pythagorean theorem extends naturally to three dimensions. The distance between two points in 3D space is d = √(Δx² + Δy² + Δz²), which is essentially applying the theorem twice. First, find the diagonal across the base (√(Δx² + Δy²)), then treat that diagonal and the vertical distance as legs of another right triangle. This 3D extension is used in physics, computer graphics, GPS navigation, and engineering to calculate spatial distances. For 3D distance calculations, try our <a href='/math/geometry/distance-calculator' class='text-primary-600 hover:text-primary-800 underline'>distance calculator</a>.

To verify whether a triangle is a right triangle, check if the squares of the two shorter sides add up to the square of the longest side. If a² + b² = c² (where c is the longest side), the triangle is a right triangle. If a² + b² > c², the triangle is acute (all angles less than 90°). If a² + b² < c², the triangle is obtuse (one angle greater than 90°). For example, for sides 5, 12, 13: 5² + 12² = 25 + 144 = 169 = 13², confirming it is a right triangle.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources