Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Growing AI Skill PRO

Enter Calculation

Formula

c=Side A2+Side B2c = \sqrt{\text{Side A}^{2} + \text{Side B}^{2}}

Example

c=32+42=5.00c = \sqrt{3^{2} + 4^{2}} = 5.00
Usage stats

Advertisement

Results

Side A: 3.00
Side B: 4.00
Hypotenuse (Side C): 5.00

Report an error on this page

What This Calculator Does

The Pythagorean Theorem Calculator finds the length of the hypotenuse — the longest side — of a right-angled triangle. You enter the two shorter sides that form the 90° angle, and the calculator instantly returns the third side. It works with any unit of measurement (metres, centimetres, inches, feet) as long as both sides use the same unit, and the result is rounded to two decimal places.

The Inputs

  • Side A — the length of one leg (a side touching the right angle).
  • Side B — the length of the other leg touching the right angle.

You do not enter the hypotenuse — that is what the tool calculates for you.

The Formula

The calculator uses the classic Pythagorean theorem:

$$c = \sqrt{\text{Side A}^{2} + \text{Side B}^{2}}$$

Internally it squares Side A and Side B, adds them together, then takes the square root of that sum. The answer (\(c\)) is the hypotenuse. The result is formatted to two decimal places, so a value like 5 is shown as 5.00.

Advertisement
Right triangle with legs a and b and hypotenuse c, right angle marked
The Pythagorean theorem relates the two legs (a, b) to the hypotenuse (c).

Worked Example

Suppose you enter:

  • Side A = 3
  • Side B = 4

The calculator squares each side: \(3^{2} = 9\) and \(4^{2} = 16\). It adds them to get 25, then takes the square root:

$$\sqrt{25} = 5$$

So the hypotenuse is 5.00. This is the well-known 3-4-5 right triangle.

A second example: with Side A = 6 and Side B = 8, you get

$$\sqrt{36 + 64} = \sqrt{100} = 10.00$$

Common Pythagorean Triples and Standard Right Triangles

A Pythagorean triple is a set of three whole numbers that satisfies \(a^2 + b^2 = c^2\), so the right triangle they describe has an exact integer hypotenuse. A triple is primitive when \(a\), \(b\) and \(c\) share no common factor greater than 1; multiplying any primitive triple by a whole number produces another valid triple with the same shape (the same angles).

Primitive triples and common multiples, with the identity checked
Leg a Leg b Hypotenuse c Type Check: a² + b² = c²
3 4 5 Primitive 9 + 16 = 25 = 5²
5 12 13 Primitive 25 + 144 = 169 = 13²
8 15 17 Primitive 64 + 225 = 289 = 17²
7 24 25 Primitive 49 + 576 = 625 = 25²
9 40 41 Primitive 81 + 1600 = 1681 = 41²
20 21 29 Primitive 400 + 441 = 841 = 29²
6 8 10 2 × (3-4-5) 36 + 64 = 100 = 10²
9 12 15 3 × (3-4-5) 81 + 144 = 225 = 15²
12 16 20 4 × (3-4-5) 144 + 256 = 400 = 20²
10 24 26 2 × (5-12-13) 100 + 576 = 676 = 26²

The 20-21-29 triple is unusual in that its two legs differ by only 1, so the triangle is very nearly isosceles — its acute angles are close to 44° and 46°.

The two special right triangles

Geometry and trigonometry also rely on two fixed-angle triangles. Unlike the triples above, their hypotenuses are irrational, so they are not Pythagorean triples and can never be written with three whole-number sides.

Special right triangles (side ratios, not integer triples)
Triangle Side ratio (short : long : hypotenuse) Decimal values Check
45°-45°-90° (isosceles) \(1 : 1 : \sqrt{2}\) 1, 1, ≈ 1.4142 \(1^2 + 1^2 = 2 = (\sqrt{2})^2\)
30°-60°-90° (half equilateral) \(1 : \sqrt{3} : 2\) 1, ≈ 1.7321, 2 \(1^2 + (\sqrt{3})^2 = 1 + 3 = 4 = 2^2\)

Note the difference in where the irrational number sits: in the 45°-45°-90° triangle the two legs are whole numbers and the hypotenuse is irrational, while in the 30°-60°-90° triangle the hypotenuse is a whole number (2) and the long leg \(\sqrt{3}\) is irrational. Because \(\sqrt{2}\) and \(\sqrt{3}\) are irrational, any decimal you enter or read back for them — 1.4142, 1.7321 — is a rounded approximation, so a calculated hypotenuse such as 1.41421356 is correct only to the digits shown.

Scaling these ratios works the same way as scaling a triple: a 45°-45°-90° triangle with legs of 7 has a hypotenuse of \(7\sqrt{2} \approx 9.8995\), and a 30°-60°-90° triangle with a short leg of 7 has a long leg of \(7\sqrt{3} \approx 12.1244\) and a hypotenuse of 14.

Advertisement

Length Unit Conversions for Mixed Measurements

The Pythagorean theorem is unit-agnostic: it works in any length unit, as long as both legs are expressed in the same unit. Problems in the field rarely arrive that way — a plan may give one dimension in feet and inches and another in millimetres — so the usual first step is converting everything to a single unit before entering Side A and Side B.

The inch-based values below are exact by international definition (the 1959 international yard and pound agreement fixed 1 inch = 25.4 mm exactly), so these are not approximations except where a decimal is truncated.

Length unit equivalents
Unit Inches Feet Millimetres Centimetres Metres
1 inch (in) 1 0.08333 25.4 2.54 0.0254
1 foot (ft) 12 1 304.8 30.48 0.3048
1 yard (yd) 36 3 914.4 91.44 0.9144
1 centimetre (cm) 0.393701 0.0328084 10 1 0.01
1 metre (m) 39.3701 3.28084 1000 100 1

Feet-and-inches to decimal feet or total inches

To convert a feet-and-inches measurement, multiply the feet by 12 and add the inches for total inches; divide the inches by 12 and add the feet for decimal feet:

$$\text{total inches} = (\text{feet} \times 12) + \text{inches} \qquad \text{decimal feet} = \text{feet} + \frac{\text{inches} }{12}$$

Common feet-and-inches conversions
Measurement Total inches Decimal feet Metres
3 ft 3 in 39 3.2500 0.9906
4 ft 9 in 57 4.7500 1.4478
5 ft 6 in 66 5.5000 1.6764
6 ft 4 in 76 6.3333 1.9304
8 ft 6 in 102 8.5000 2.5908
10 ft 0 in 120 10.0000 3.0480

Worked example with mixed units

A rectangular opening is 6 ft 4 in wide and 4 ft 9 in tall; you want the diagonal brace length. Convert both sides to inches first: 6 ft 4 in = (6 × 12) + 4 = 76 in, and 4 ft 9 in = (4 × 12) + 9 = 57 in. Then:

$$c = \sqrt{76^2 + 57^2} = \sqrt{5776 + 3249} = \sqrt{9025} = 95$$

The diagonal is 95 inches, which converts back to 95 ÷ 12 = 7.9167 decimal feet, or 7 ft 11 in (since 0.9167 × 12 = 11 in), or 95 × 0.0254 = 2.413 m. (This example is a scaled 3-4-5 triple: 76 = 19 × 4 and 57 = 19 × 3, so the exact answer 19 × 5 = 95 comes out whole.)

The output needs no conversion: the hypotenuse is returned in whatever unit both legs were entered in. Enter the legs in millimetres and the result is millimetres; enter them in inches and the result is inches. Convert only if you want the answer expressed in a different unit than you supplied — and never mix units between Side A and Side B, since the calculator has no way to detect the mismatch and will simply return a wrong number.

Frequently Asked Questions

Can I find a missing leg instead of the hypotenuse?
This calculator solves only for the hypotenuse from two legs. To find a missing leg when you already know the hypotenuse, you would rearrange the formula to \(a = \sqrt{c^{2} - b^{2}}\), which this tool does not do directly.

What units should I use?
Any unit works, but Side A and Side B must be in the same unit. The hypotenuse will be returned in that same unit.

Does it only work for right triangles?
Yes. The Pythagorean theorem applies only to right-angled triangles, where Side A and Side B meet at exactly 90°. For other triangles you would need the law of cosines instead.

Last updated:

Most popular in Physics and Engineering

View all Physics and Engineering calculators