Pythagorean Theorem Calculator: Exact Answers & Steps

A 10-foot ladder stands with its foot 6 feet from a wall. How high up the wall does it reach? The ladder, the wall and the ground make a right triangle, so the Pythagorean theorem answers it: 6² + h² = 10², which gives h² = 64 and h = 8 feet.

Type any two sides of a right triangle below and leave the one you want empty. Answers stay exact (2√13, not only 7.2111), with both angles, the area, the perimeter and every step. Type all three sides to check for a right angle.

Pythagorean Theorem Calculator

Fill in any two sides to find the third. Fill in all three to check whether they make a right triangle. You can type 7, 2.5, 3/4, √2 or 2√3 (or sqrt(2)).

Hypotenuse c –
The triangle
Step by step

    Legs of 4 and 6, Worked by Hand

    The theorem says that in a right triangle, a² + b² = c². Here a and b are the two legs, the sides that meet at the right angle. The hypotenuse c is the side opposite the right angle.

    Take a right triangle with legs of 4 and 6:

    1. Square each leg: 4² = 16 and 6² = 36.
    2. Add the squares: c² = 16 + 36 = 52.
    3. Take the square root: c = √52.
    4. Simplify. 52 = 4 × 13, and 4 is a perfect square, so √52 = √4 × √13 = 2√13.
    5. Round only if you need a decimal: 2√13 ≈ 7.2111.

    Step 4 is where a hand answer and a calculator answer can look different. √52 and 2√13 are the same number, but many answer keys ask for the simplified form. To simplify a root, look for the biggest perfect square that divides the number under the root sign. The Square Root Calculator shows that search for any number.

    Leg or Hypotenuse: Add the Squares or Subtract Them

    The formula changes depending on which side is missing:

    You knowYou wantFormula
    Both legs, a and bHypotenuse cc = √(a² + b²)
    Leg a and hypotenuse cLeg bb = √(c² − a²)
    Leg b and hypotenuse cLeg aa = √(c² − b²)

    To find the hypotenuse, add the squares. To find a leg, subtract the smaller square from the bigger one.

    Mixing these up is the slip worth watching for. Take a leg of 5 and a hypotenuse of 13. Subtracting gives √(169 − 25) = √144 = 12, which is right. Adding by mistake gives √(169 + 25) = √194 ≈ 13.93. That answer is longer than the hypotenuse, and no leg can be. The hypotenuse is always the longest side of a right triangle.

    The calculator checks this: if the hypotenuse box holds a shorter number than a leg, it stops and says which number to look at. Equal numbers are refused too: a leg as long as the hypotenuse would leave the other leg with a length of 0.

    Exact Answer or Decimal?

    Many pairs of legs don’t produce a whole-number hypotenuse. When c² isn’t a perfect square, c is an irrational number: its decimal goes on forever without repeating. Legs of 4 and 6 give c² = 52, so c = 2√13 exactly, and any decimal is an approximation.

    That matters when you keep calculating. Round 2√13 to 7.21 and square it again and you get 51.9841, not 52. Use 7.2111 and you get about 51.99996. The more you round, the further the check drifts from 52. Working with 2√13 until the last step keeps the drift at zero.

    So the calculator gives both forms: the exact one (simplified radical, fraction or decimal, depending on what you typed) and a rounded decimal. The “Round to” menu sets 2, 3, 4, 6 or 8 decimal places. For more on choosing a precision, see how to round decimals.

    You can type exact values too. Lengths such as √2, 2√3, 3/4 and sqrt(5) are all accepted, which helps when one side comes from an earlier calculation. Legs of 1 and √3, for example, give a hypotenuse of exactly 2.

    Pythagorean Triples Worth Knowing

    A Pythagorean triple is three whole numbers that fit a² + b² = c². When you spot one, the answer comes out whole and you can skip the square root. These are the primitive triples (no common factor) with a hypotenuse under 70:

    LegsHypotenuseCheck
    3, 459 + 16 = 25
    5, 121325 + 144 = 169
    8, 151764 + 225 = 289
    7, 242549 + 576 = 625
    20, 2129400 + 441 = 841
    12, 3537144 + 1,225 = 1,369
    9, 404181 + 1,600 = 1,681
    28, 4553784 + 2,025 = 2,809
    11, 6061121 + 3,600 = 3,721
    33, 56651,089 + 3,136 = 4,225
    16, 6365256 + 3,969 = 4,225

    Multiply every number in a triple by the same amount and you get another one: 6, 8, 10 and 9, 12, 15 are both scaled-up 3, 4, 5 triangles. The calculator tells you when your sides form a triple and whether it’s primitive or a multiple. It does the same for decimals. Legs of 1.5 and 2 give a hypotenuse of exactly 2.5, the 3-4-5 shape halved.

    You can make as many triples as you like with Euclid’s formula. Pick two whole numbers m > n, then:

    • a = m² − n²
    • b = 2mn
    • c = m² + n²

    m = 2 and n = 1 give 3, 4, 5. m = 3 and n = 2 give 5, 12, 13. m = 4 and n = 1 give 15, 8, 17.

    People were listing triples long before Pythagoras. A Babylonian clay tablet known as Plimpton 322, dated to around 1800 BC and now held at Columbia University, has 15 rows built on them. Its first row gives 119 and 169, the short side and hypotenuse of the 119, 120, 169 triangle. Its biggest row gives 12,709 and 18,541, which belong with a long side of 13,500. Type 12709 and 13500 into the calculator and it confirms the hypotenuse is exactly 18,541.

    Is It a Right Triangle? Testing the Converse

    The theorem also works backwards. If the two shorter sides squared add up to the longest side squared, the triangle has a right angle. If they don’t, it doesn’t. Fill in all three boxes and the calculator runs this test:

    • 8, 15, 17: 64 + 225 = 289 = 17². A right triangle.
    • 6, 7, 9: 36 + 49 = 85, but 9² = 81. Not a right triangle. Because 85 is bigger than 81, the largest angle is a little under 90° (about 87.27°). That makes it acute.
    • 5, 7, 10: 25 + 49 = 74, but 10² = 100. Because 74 is smaller than 100, the largest angle is over 90° (about 111.8°). That makes it obtuse.
    • 2, 3, 7: these can’t make any triangle at all, because 2 + 3 is less than 7. The two short sides can’t reach each other.

    Builders use the converse to square a corner. Mark 3 feet along one wall and 4 feet along the other. If the marks are exactly 5 feet apart, the corner is 90°. On a bigger job the same check uses 6, 8 and 10, or 9, 12 and 15.

    The test is exact, so measured lengths that are rounded can fail it by a hair. If the check says no, look at the largest angle the calculator reports. A result of 89.98° says your measurements are close, while 80° says the corner really is off.

    Angles, Area and Perimeter From the Same Two Sides

    Two sides of a right triangle fix everything else. For legs of 4 and 6:

    • Angles: the angle opposite a is tan⁻¹(a ÷ b) = tan⁻¹(4 ÷ 6) ≈ 33.6901°. The other acute angle is 90° − 33.6901° ≈ 56.3099°. All three angles add up to 180°.
    • Area: half of one leg times the other, ½ × 4 × 6 = 12 square units. The legs act as base and height because they meet at 90°.
    • Perimeter: 4 + 6 + 2√13 = 10 + 2√13 ≈ 17.2111.
    • Height to the hypotenuse: if the hypotenuse is the base, the height is a × b ÷ c = 24 ÷ 2√13 = (12√13)/13 ≈ 3.3282.

    The calculator shows all of these with the triangle drawn to scale. It also flags two special shapes. Equal legs make a 45°–45°–90° triangle, where the hypotenuse is a leg times √2. A hypotenuse twice the shorter leg makes a 30°–60°–90° triangle, with sides in the ratio 1 : √3 : 2.

    Real Measurements: Ladders, Ramps, Screens, Maps and Rooms

    Setting up a ladder. OSHA’s construction rule for a ladder leaning on a support (29 CFR 1926.1053(b)(5)(i)) asks for the foot to be about one quarter of the ladder’s working length out from the top support. For a working length of 16 feet, that’s 4 feet out. Put 4 as a leg and 16 as the hypotenuse, and the top support works out at √240 = 4√15 ≈ 15.49 feet high.

    Building a ramp. The 2010 ADA Standards limit a ramp’s running slope to 1:12, and one run can rise no more than 30 inches. At 1:12, a 30-inch rise needs 360 inches of horizontal run. The sloped surface is then √(30² + 360²) = 30√145 ≈ 361.25 inches long, only about 1¼ inches more than the run. As a slope, 1:12 is a grade of about 8.33%, or 4.76°.

    Sizing a TV. Screen sizes measure the diagonal. A 16:9 screen has a diagonal of √(16² + 9²) = √337 for every 16 units of width, so:

    • width = diagonal × 16 ÷ √337
    • height = diagonal × 9 ÷ √337

    A 55-inch TV comes out about 47.94 inches wide and 26.96 inches tall, before the frame.

    Distance on a grid or map. The straight-line distance between two points is the hypotenuse of the triangle their coordinates make. From (2, 1) to (7, 13), the horizontal change is 5 and the vertical change is 12, so the distance is √(25 + 144) = 13. That is the distance formula, d = √((x₂ − x₁)² + (y₂ − y₁)²). It is the Pythagorean theorem with coordinates. The Slope Calculator gives this distance, the midpoint and the slope for any two points.

    The longest pole that fits in a room. For a room 12 by 10 by 8 feet, apply the theorem twice:

    1. The floor diagonal is √(12² + 10²) = √244 = 2√61 ≈ 15.62 feet.
    2. That diagonal and the 8-foot height make a second right triangle. The space diagonal is √(244 + 64) = √308 = 2√77 ≈ 17.55 feet.

    In one step: d = √(l² + w² + h²). The calculator handles the second step too: type √244 as one leg and 8 as the other. The Volume Calculator shows this space diagonal for any box, next to its volume.

    Why a² + b² = c² Works

    The theorem carries Pythagoras’s name, but none of his writing survives, so nobody knows whether he proved it himself.

    One of the clearest proofs needs only areas. Draw a big square with sides a + b. Inside it, place four copies of the right triangle so that their hypotenuses form a tilted square with side c in the middle.

    • The big square’s area is (a + b)² = a² + 2ab + b².
    • The same area is the tilted square plus the four triangles: c² + 4 × (½ab) = c² + 2ab.

    Set the two equal and take away 2ab from both sides. What’s left is a² + b² = c².

    Before You Trust the Answer: Four Checks

    • Is c the longest side? The hypotenuse must be longer than either leg. If your answer for a leg comes out longer than the hypotenuse, you added the squares when you should have subtracted.
    • Are the units the same? Convert first. A 5-foot leg and an 18-inch leg become 60 and 18 inches before you square anything. The calculator’s unit menu only labels the answer; it doesn’t convert.
    • Is there really a right angle? a² + b² = c² holds only for right triangles. For any other triangle, the law of cosines takes over: c² = a² + b² − 2ab·cos C. When C is 90°, cos C is 0 and the law of cosines turns back into the Pythagorean theorem.
    • Does it check out? Square your answer and run the sum again. With the exact form, the check comes out perfect: (2√13)² = 4 × 13 = 52 = 16 + 36.

    For a table of square roots you can check by eye, see square roots from 1 to 100.