Ekuation

Math

Pythagorean Theorem Calculator

Solve a² + b² = c² for any missing side of a right triangle with free step-by-step solutions. Supports solving for the hypotenuse, either leg, and verifying whether three sides form a right triangle. Includes an interactive triangle diagram, angle computation, area and perimeter output, and automatic Pythagorean triple detection with primitivity classification.

Pythagorean Theorem Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

Ladder Against Wall

A 10-foot ladder leans against a wall with the base 6 feet away. How high does it reach?

Key values: Leg a = 6 ft · Hypotenuse c = 10 ft · Solve for leg b

TV Screen Diagonal

Find the diagonal of a TV with a 16:9 aspect ratio (width 40", height 22.5").

Key values: Width = 40 in · Height = 22.5 in · Find diagonal

Classic 3-4-5 Triangle

Verify that sides 3, 4, and 5 form a right triangle (the most famous Pythagorean triple).

Key values: Sides: 3, 4, 5 · Right triangle · Primitive triple

Documentation

What Is the Pythagorean Theorem?

The Pythagorean theorem is one of the most fundamental relationships in all of mathematics. It states that in any right triangle, the square of the hypotenuse (the side opposite the 90-degree angle) equals the sum of the squares of the other two sides, called legs:

a2+b2=c2a^2 + b^2 = c^2

Here, aa and bb are the legs and cc is the hypotenuse. This identity applies only to right triangles -- for other triangles, the generalization is the Law of Cosines.

The theorem is named after the ancient Greek mathematician Pythagoras of Samos (c. 570--495 BC), though the relationship was known to Babylonian mathematicians roughly 1,300 years earlier. The Plimpton 322 clay tablet (~1800 BC) records 15 Pythagorean triples in base-60 cuneiform, and the Indian Baudhayana Shulbasutra (~800 BC) states the theorem for constructing Vedic fire altars.


Formulas

Solving for the Hypotenuse

When both legs are known:

c=a2+b2c = \sqrt{a^2 + b^2}

Solving for a Leg

When the hypotenuse and one leg are known:

a=c2b2b=c2a2a = \sqrt{c^2 - b^2} \qquad b = \sqrt{c^2 - a^2}

Note: the hypotenuse cc must be larger than the known leg; otherwise the expression under the radical is negative and no real solution exists.

Converse of the Pythagorean Theorem

The converse lets you classify any triangle by comparing a2+b2a^2 + b^2 to c2c^2: equal means right, greater means acute, less means obtuse. For the full converse analysis, worked examples, and the 3-4-5 construction rule, see the Right Triangle Checker guide.

Distance Formula

The distance formula d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} is the Pythagorean theorem applied to coordinates. For the derivation, 3D extension, and applications in navigation, graphics, and ML, see the Distance Formula Calculator guide.

Relationship to the Law of Cosines

The Pythagorean theorem is a special case of the Law of Cosines. For any triangle:

c2=a2+b22abcos(C)c^2 = a^2 + b^2 - 2ab\cos(C)

When C=90°C = 90°, cos(90°)=0\cos(90°) = 0, and the formula reduces exactly to a2+b2=c2a^2 + b^2 = c^2.


Classic Proofs

The Pythagorean theorem may have more known proofs than any other theorem in mathematics -- Elisha Loomis cataloged 370 proofs, and Cut-the-Knot has collected over 100.

Rearrangement Proof (Bhaskara's "Behold!")

Take four identical right triangles with legs aa and bb. Arrange them inside a large square of side (a+b)(a + b). In one configuration they leave a tilted square of area c2c^2 in the center; in the other they leave two smaller squares of areas a2a^2 and b2b^2. Since both configurations fill the same total area: c2=a2+b2c^2 = a^2 + b^2.

Garfield's Trapezoid Proof (1876)

The 20th US President, James Garfield, published this proof while still a Congressman. Arrange two copies of the right triangle to form a trapezoid with parallel sides aa and bb. Computing the trapezoid area two ways and setting them equal yields a2+b2=c2a^2 + b^2 = c^2.


Pythagorean Triples

A Pythagorean triple (a,b,c)(a, b, c) is a set of positive integers satisfying a2+b2=c2a^2 + b^2 = c^2—right triangles with integer sides. The most well-known is (3, 4, 5). Euclid's formula can generate all primitive triples.

For the generating formula, a table of common triples, properties, and the connection to Fermat's Last Theorem, see the Pythagorean Triple Calculator guide.


Real-World Examples

Example 1: Construction -- Squaring a 12×16 ft Room

A contractor measures the diagonal of a room to verify right angles. With walls of 12 ft and 16 ft:

c=122+162=144+256=400=20 ftc = \sqrt{12^2 + 16^2} = \sqrt{144 + 256} = \sqrt{400} = 20 \text{ ft}

If the measured diagonal is 20 ft, the corners are square. This is a (3, 4, 5) × 4 triple -- the classic "3-4-5 method" builders use daily.

Example 2: Ladder Safety -- OSHA 4:1 Rule

A 20-ft ladder is placed with its base 5 ft from the wall. How high does it reach?

b=20252=40025=37519.36 ftb = \sqrt{20^2 - 5^2} = \sqrt{400 - 25} = \sqrt{375} \approx 19.36 \text{ ft}

The contact angle is arctan(19.36/5) ≈ 75.5°, meeting OSHA's recommended safe angle. Correct ladder placement prevents hundreds of thousands of injuries annually.

Example 3: Screen Diagonal -- Verifying a 55-inch TV

A consumer measures the visible area of a TV as 48 in wide and 27 in tall:

c=482+272=2304+729=303355.07 inc = \sqrt{48^2 + 27^2} = \sqrt{2304 + 729} = \sqrt{3033} \approx 55.07 \text{ in}

The diagonal matches the marketed "55-inch" size. For 16:9 displays, width ≈ diagonal × 0.872 and height ≈ diagonal × 0.49.

Example 4: Student Homework -- Classic 5-12-13 Triangle

A right triangle has legs of 5 cm and 12 cm. Find the hypotenuse.

c=52+122=25+144=169=13 cmc = \sqrt{5^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13 \text{ cm}

This is the primitive Pythagorean triple (5, 12, 13) -- the second most commonly taught triple after (3, 4, 5).

Example 5: Sports -- Home Plate to Second Base

A baseball diamond is a square with 90-foot sides. The catcher's throw to second base crosses the diagonal:

c=902+902=16200=902127.28 ftc = \sqrt{90^2 + 90^2} = \sqrt{16200} = 90\sqrt{2} \approx 127.28 \text{ ft}

This ~127-foot throw is one of baseball's most demanding plays.


Common Misconceptions

  • a2+b2=(a+b)2a^2 + b^2 = (a + b)^2 -- The most common error. Squaring a sum is NOT the same as summing squares. (a+b)2=a2+2ab+b2a2+b2(a+b)^2 = a^2 + 2ab + b^2 \neq a^2 + b^2.
  • Forgetting the final square root -- Students sometimes report c2c^2 instead of cc.
  • Applying the theorem to non-right triangles -- The Pythagorean theorem holds only for right triangles. For other triangles, use the Law of Cosines.
  • Misidentifying the hypotenuse -- The hypotenuse is always opposite the right angle and is always the longest side. When the triangle is rotated, locate the right angle first.
  • Always solving for the hypotenuse -- The formula can be rearranged to solve for either leg: a=c2b2a = \sqrt{c^2 - b^2}.

Frequently Asked Questions

How do I find the hypotenuse of a right triangle?

Use c=a2+b2c = \sqrt{a^2 + b^2}, where aa and bb are the two legs. Square each leg, add the results, and take the square root.

How do I find a missing leg?

Use a=c2b2a = \sqrt{c^2 - b^2}. Subtract the square of the known leg from the square of the hypotenuse, then take the square root.

Does the Pythagorean theorem work for all triangles?

No. It applies only to right triangles (those with a 90-degree angle). For other triangles, use the Law of Cosines: c2=a2+b22abcos(C)c^2 = a^2 + b^2 - 2ab\cos(C).

What is a Pythagorean triple?

A set of three positive integers (a,b,c)(a, b, c) that satisfy a2+b2=c2a^2 + b^2 = c^2. Examples include (3, 4, 5), (5, 12, 13), and (8, 15, 17). A triple is primitive if the three numbers share no common factor.

Can I use the Pythagorean theorem in 3D?

Yes. The space diagonal of a rectangular box with dimensions ll, ww, and hh is d=l2+w2+h2d = \sqrt{l^2 + w^2 + h^2}. This applies the theorem twice in succession.

Who discovered the Pythagorean theorem?

While named after Pythagoras (~570--495 BC), the theorem was known to Babylonian mathematicians at least 1,300 years earlier (Plimpton 322 tablet, ~1800 BC) and independently by Indian mathematicians in the Baudhayana Shulbasutra (~800 BC) and Chinese mathematicians in the Zhoubi Suanjing.


References

  • Wolfram MathWorld. "Pythagorean Theorem." https://mathworld.wolfram.com/PythagoreanTheorem.html
  • Encyclopaedia Britannica. "Pythagorean theorem." https://www.britannica.com/science/Pythagorean-theorem
  • Cut-the-Knot. "Pythagorean Theorem and its many proofs." https://www.cut-the-knot.org/pythagoras/
  • Wikipedia. "Shulba Sutras." https://en.wikipedia.org/wiki/Shulba_Sutras
  • Conrad, K. "Pythagorean Triples." University of Connecticut. https://kconrad.math.uconn.edu/blurbs/ugradnumthy/pythagtriple.pdf

Disclaimer

This calculator is provided for educational and reference purposes. While we strive for accuracy, always verify critical measurements independently. For construction, engineering, or safety applications (such as ladder placement), consult professional guidelines and relevant safety standards (e.g., OSHA regulations). The calculator uses standard IEEE 754 floating-point arithmetic, which may produce minor rounding differences for very large or very small numbers.

Specialized Calculators

Choose from 5 specialized versions of this calculator, each optimized for specific use cases and calculation methods.

Related Calculators

6 Calculators

More Math calculators

Calculator Search

Search and find calculators