Pythagorean Theorem Calculator

Pythagorean Theorem Calculator. Enter any two sides of a right triangle — side a, side b, or hypotenuse c — and the Pythagorean Theorem Calculator finds the missing third side. Leave exactly one field blank, and you'll also get the triangle area calculated automatically using a² + b² = c². Also try the Volume Calculator.

Pythagorean Theorem Calculator inputs

One of the two legs of the right triangle

The other leg of the right triangle

The longest side, opposite the right angle

Results

Missing Side

--

Side a

--

Side b

--

Hypotenuse c

--

Triangle Area

--

Perimeter

--

Use this Pythagorean theorem calculator to get the missing side of a right triangle from the two sides you already know. You enter a pair of lengths, and the Pythagorean theorem returns the unknown side, so your third side comes with working you can check by hand. See also our use the Perimeter Calculator.

How to use the Pythagorean theorem calculator

Treat the calculator as a right triangle side calculator: pick the side you want to solve for, then enter your values for the other two sides. Put both measurements in the same unit. Decimals are fine: lengths must be above zero but needn't be positive integers. If one length is in feet and the other in inches, convert first.

  • Confirm the triangle has a square corner.
  • Label each side, using the same unit throughout.
  • Follow the calculation steps: square the known lengths, add or subtract, then take the square root.
  • Check that the hypotenuse is the largest number.

Find the hypotenuse from two legs

To find the hypotenuse, square the legs, add the results, and take the square root. Say leg a is 7.5 ft and leg b is 18 ft:

$$c = \sqrt{7.5^{2} + 18^{2}} = \sqrt{56.25 + 324} = \sqrt{380.25} = 19.5$$

Your sloped side is 19.5 ft. Without a calculator, bracket the root: \(19^{2}\) is 361 and \(20^{2}\) is 400.

Pythagorean theorem diagram with squares of 56.25 and 324 on the legs and 380.25 on the 19.5 ft hypotenuse
Leg squares add up to 380.25.

Solving for a missing leg

For a missing leg, subtract instead of adding. With side c equal to 26.5 cm and one leg equal to 14 cm, side a is the square root of what remains:

$$a = \sqrt{26.5^{2} - 14^{2}} = \sqrt{702.25 - 196} = \sqrt{506.25} = 22.5$$

A negative value under the root means c was typed into the calculator shorter than the leg.

Waterfall chart subtracting 196 from 702.25 to leave 506.25 for a 22.5 cm missing leg
Subtracting squares leaves 506.25.

Pythagorean theorem formula for any side

The theorem says the square of the hypotenuse equals the sum of the squares of the other two sides. The hypotenuse sits opposite the right angle, which measures 90 degrees. This Pythagorean equation is named after Pythagoras, the Greek thinker, and it anchors school geometry:

$$a^{2} + b^{2} = c^{2}$$

Rearranging it gives all three Pythagorean theorem formulas:

You needFormulaYou must know
Hypotenuse\(c = \sqrt{a^{2} + b^{2}}\)Both legs
First leg\(a = \sqrt{c^{2} - b^{2}}\)Hypotenuse and the second leg
Second leg\(b = \sqrt{c^{2} - a^{2}}\)Hypotenuse and the first leg

Why the longest side obeys it: an algebraic proof

Place four copies of one triangle inside a big square with edges \(a + b\). Their longest side, c, outlines a tilted square in the middle. The big area equals that middle area plus four triangles:

$$(a+b)^{2} = c^{2} + 4 \cdot \frac{ab}{2}$$

Expand the left side, cancel \(2ab\) from both sides, and \(a^{2} + b^{2} = c^{2}\) remains. This algebraic proof holds for any right-angled triangle. For other angles, the law of cosines from trigonometry adds a correction, \(c^{2} = a^{2} + b^{2} - 2ab\cos C\), which vanishes at a 90-degree angle. Pythagoras' theorem is that special case.

Right triangle solver examples with step-by-step results

A right triangle solver is most useful when its solution steps are visible. These step-by-step examples help students check homework; rounding happens only on the last line.

Ladder against a wall as a right triangle

You lean a 20 ft ladder on a wall with its foot 5.5 ft out along level ground. The wall is perpendicular to the ground, so the ladder is the hypotenuse: You might also find our Square Calculator useful.

$$h = \sqrt{20^{2} - 5.5^{2}} = \sqrt{369.75} \approx 19.23$$

The contact height is about 19.23 feet. This geometric result says nothing about whether the ladder angle is safe.

Screen, ramp and rectangle diagonal lengths

A diagonal splits a rectangle into two matching triangles, so the calculator treats each diagonal as a hypotenuse:

  • Screen: 52 by 29.25 inches gives a diagonal of 59.66 inches.
  • Ramp: a surface climbing 1.75 ft across 21 ft measures 21.07 ft, a 1:12 slope.
  • Square patio: 11 ft per edge gives a diagonal distance of 15.56 ft, the edge times \(\sqrt{2}\).

Squaring a shed floor with Pythagoras' theorem

You are about to deck a shed base measuring 11 ft 9 in by 15 ft 4 in on paper, but the lumber was cut to 11.75 ft by 15.25 ft. Before any sheet goes down, you need to know whether the corners are square.

First, tape both opposite pairs; each matches. Then open the Pythagorean theorem calculator, choose the hypotenuse, and enter 11.75 and 15.25 in the same unit. With true right angle corners, the line across the floor is the hypotenuse of a right triangle, so the Pythagorean theorem formula applies:

$$c = \sqrt{138.0625 + 232.5625} = \sqrt{370.625} \approx 19.2516$$

That is 19 ft 3.02 in, not 19 ft 2.5 in: decimal feet need multiplying by 12. Your tape reads 19 ft 3⅞ in on one diagonal and 19 ft 2³⁄₁₆ in on the other. The law of cosines puts the wider corner near 90.44°, leaving the short side about 1.08 in out of line.

You cross-check with a Pythagorean triple: marks at 9 ft and 12 ft along that corner should sit 15 ft apart, yet they span about 0.66 in more. Both tests agree, so you rack the frame until each diagonal reads 19 ft 3 in.

Long side enteredExpected diagonalChange
15.25 ft19.2516 ftBaseline
15 ft 4 in19.3177 ft+0.79 in
15.5 ft19.4503 ft+2.38 in

The table shows why your side lengths must be as built: using the drawing's figure would make the longer measurement of this crooked frame look almost right. The catch is that equal diagonals prove a rectangle only when opposite sides match; a trapezoid can pass that test. My own limit here is ⅛ inch between diagonals, and I'd recheck it after fastening the first sheet, since hammering can shift a corner.

Pythagorean triples and the 3-4-5 rule

A Pythagorean triple is a set of three whole numbers that satisfies the formula exactly. Any multiple of one also works, which is why a carpenter can mark 9, 12 and 15 ft to square a corner this way. Builders favor larger multiples because small tape errors matter less.

Base setTripledCheck on the base set
3-4-59, 12, 159 + 16 = 25
5-12-1315, 36, 3925 + 144 = 169
8-15-1724, 45, 5164 + 225 = 289

Memorizing these Pythagorean triples lets you spot clean answers before opening any calculator.

Pythagorean equation uses in construction and navigation

In construction, the horizontal run and vertical rise form the legs, and the sloped member is the hypotenuse. Roof rafters covering 14 ft horizontally while climbing 5.25 ft must be about 14.95 ft long before overhang. A stair stringer follows the same logic with total height and depth. Architects and any engineer checking a brace can start with a calculator, then apply building codes.

Distance between two points on a map

For the distance between two points, treat the differences between their coordinates as legs. From (2.5, −1) to (9, 4.5), the gaps are 6.5 and 5.5, so the straight line is \(\sqrt{72.5} \approx 8.51\) units. A calculator handles flat map navigation this way; GPS routes spanning large areas also correct for Earth's curve.

Pythagorean theorem mistakes and answer checks

Most wrong answers start with the wrong side in the wrong box. Run these checks before trusting any right triangle calculator:

  • The hypotenuse exceeds each leg but is less than their total.
  • You took the square root and didn't stop at \(c^{2}\).
  • You squared each length first instead of adding raw lengths.
  • The corner is a true right angle; otherwise the theorem fails.

Testing for a right angle with the converse

The converse lets you test three measured sides. Let the largest be c and compare the squares of the legs, added together, with \(c^{2}\):

ComparisonTriangle angles
\(a^{2} + b^{2} = c^{2}\)Right
\(a^{2} + b^{2} > c^{2}\)Acute
\(a^{2} + b^{2} < c^{2}\)Obtuse

Sides 11, 17 and 20 give 410 against 400, so that shape is acute. A right angle would need c near 20.25. An equilateral triangle can never pass, since each of its corners is 60°. Check out our Triangle Calculator as well.

Zone bar showing a longest side of 20 in the acute range, below the 20.25 right angle point for sides 11 and 17
Where 20 falls for sides 11 and 17.