Skip to content
KazamTools

Pythagorean Theorem Calculator

Find any missing side of a right triangle, with the exact answer, the angles and the working.

By , Founder and editor-in-chiefUpdated

What do you want to find?

One of the two sides that meet at the right angle.

The other side at the right angle.

Try a classic triangle

a = 3b = 4c = 5αβ

Hypotenuse (c)

5

c = √(a² + b²)

3, 4, 5 is a Pythagorean triple: three whole numbers with a² + b² = c².
Leg a
3
Leg b
4
Hypotenuse c
5
Angle α (opposite a)
36.8699°
0.6435 rad
Angle β (opposite b)
53.1301°
0.9273 rad
Right angle
90°
Area
6 square units
a × b ÷ 2
Perimeter
12
a + b + c
Height to the hypotenuse
2.4
a × b ÷ c

How it was worked out

  1. a² + b² = c²
  2. c² = 3² + 4² = 9 + 16 = 25
  3. c = √25 = 5
  4. α = arctan(a ÷ b) = arctan(3 ÷ 4) = 36.8699°
  5. β = 90° − α = 53.1301°
  6. Area = a × b ÷ 2 = 3 × 4 ÷ 2 = 6 square units
  7. Perimeter = a + b + c = 12

Need the area of a triangle from three sides, or another shape? Use the area calculator. For the steepness of a line or a ramp, try the slope calculator.

How to use the Pythagorean Theorem Calculator

  1. 1Choose what to find: the hypotenuse c, leg a or leg b, or check whether three sides make a right triangle.
  2. 2Enter the two sides you know. Pick a unit if you want one shown.
  3. 3Read the missing side as a decimal and, where it is neat, as an exact surd such as 5√2.
  4. 4Check the angles, area and perimeter, and follow the step-by-step working.

The Pythagorean theorem

A right triangle has one angle of exactly 90°. The two sides that form that angle are the legs, usually called a and b. The side opposite the right angle is the hypotenuse, c. It is always the longest side.

The Pythagorean theorem links the three sides:

a² + b² = c²

In words: the square on the hypotenuse has the same area as the squares on the two legs put together. Rearranged, it gives a formula for whichever side is missing:

Hypotenuse: c = √(a² + b²)
Leg: a = √(c² − b²)  or  b = √(c² − a²)

When you find the hypotenuse you add the squares. When you find a leg you subtract. Mixing those up is the most common mistake.

How to use the calculator

  1. Pick Find c for the hypotenuse, or Find a or Find b for a leg.
  2. Enter the two sides you know. Decimals are fine.
  3. Read the answer. If it is not a whole number, you also get the exact surd (such as 5√2) when it simplifies neatly.
  4. The angles, area, perimeter and the height to the hypotenuse are worked out too, with every step shown.

The fourth option, Is it a right triangle?, takes three sides in any order and tells you whether they meet at a right angle.

Worked examples

Example 1: the hypotenuse

A right triangle has legs of 6 and 8.

  • c² = 6² + 8² = 36 + 64 = 100
  • c = √100 = 10

The angles are α = arctan(6 ÷ 8) ≈ 36.87° and β = 90° − 36.87° ≈ 53.13°. The area is 6 × 8 ÷ 2 = 24.

Example 2: a ladder against a wall

A 10 ft ladder leans against a wall with its foot 6 ft from the wall. How high does it reach? The ladder is the hypotenuse, so subtract:

  • a² = 10² − 6² = 100 − 36 = 64
  • a = √64 = 8 ft

Example 3: an answer that is not a whole number

Legs of 5 and 5 give c² = 25 + 25 = 50, so c = √50. Since 50 = 25 × 2 and √25 = 5, the exact answer is 5√2, which is about 7.0711. A triangle with two equal legs is a 45-45-90 triangle, and its hypotenuse is always the leg × √2.

Example 4: a TV screen

TV sizes are the diagonal. A 55-inch screen with a 16:9 shape has a height-to-width ratio of 9 to 16. The diagonal of a 16 × 9 rectangle is √(256 + 81) = √337 ≈ 18.358. Scale it up to 55 inches by multiplying both sides by 55 ÷ 18.358:

  • Width ≈ 16 × 2.996 ≈ 47.94 in
  • Height ≈ 9 × 2.996 ≈ 26.96 in

Example 5: decimals

Legs of 2.5 m and 6 m: c² = 6.25 + 36 = 42.25, so c = √42.25 = 6.5 m. Decimals work exactly the same way.

Is it a right triangle? (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 not, the sum tells you what kind of triangle it is:

Compare x² + y² with z² (z = longest side) Triangle
x² + y² = z² Right (one angle is exactly 90°)
x² + y² > z² Acute (all angles under 90°)
x² + y² < z² Obtuse (one angle over 90°)

For example, 7, 24, 25: 49 + 576 = 625 = 25², so it is a right triangle. But 4, 5, 6: 16 + 25 = 41, which is more than 36, so it is acute. Three lengths only make a triangle at all if the two shorter ones add up to more than the longest.

The calculator compares typed decimals exactly, not with rounded floating-point numbers, so 0.3, 0.4, 0.5 is correctly reported as a right triangle.

Pythagorean triples

A Pythagorean triple is three whole numbers that fit a² + b² = c². A primitive triple has no common factor. Here are all 16 primitive triples with a hypotenuse up to 100:

c up to 29 c from 30 to 53 c from 54 to 73 c from 74 to 100
3, 4, 5 12, 35, 37 11, 60, 61 13, 84, 85
5, 12, 13 9, 40, 41 16, 63, 65 36, 77, 85
8, 15, 17 28, 45, 53 33, 56, 65 39, 80, 89
7, 24, 25 48, 55, 73 65, 72, 97
20, 21, 29

Multiply any of them by a whole number to get more: 3-4-5 gives 6-8-10, 9-12-15, 12-16-20 and so on. You can make primitive triples with Euclid’s formula: pick whole numbers m > n, one odd and one even, with no common factor. Then a = m² − n², b = 2mn and c = m² + n². With m = 2 and n = 1 you get 3, 4, 5; with m = 3 and n = 2 you get 5, 12, 13.

Special right triangles

Two right triangles come up so often that their side ratios are worth remembering:

Triangle Angles Sides (short leg : long leg : hypotenuse)
Isosceles right 45°, 45°, 90° 1 : 1 : √2
Half an equilateral 30°, 60°, 90° 1 : √3 : 2

Try them: legs 1 and 1 give √2 ≈ 1.4142. A leg of 1 and a hypotenuse of 2 give the other leg √3 ≈ 1.7321, with angles of 30° and 60°.

Simplifying the square root

To turn √n into a surd like k√m, find the largest perfect square that divides n:

  • √50 = √(25 × 2) = 5√2
  • √72 = √(36 × 2) = 6√2
  • √48 = √(16 × 3) = 4√3
  • √51 = √(3 × 17) cannot be simplified, so it stays √51

The calculator does this for you and shows the exact form next to the decimal whenever the numbers stay readable.

Where you will use it

  • Squaring a corner. Builders mark 3 units along one edge and 4 along the other. If the diagonal between the marks is exactly 5, the corner is square. Larger multiples such as 6-8-10 or 9-12-15 give better accuracy on big layouts.
  • Distance between two points. On a graph, the distance from (x₁, y₁) to (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (7, 10) it is √(36 + 64) = 10.
  • Diagonals. Screen sizes, the diagonal of a room or a sheet of plywood, and the brace across a gate.
  • Slopes and roofs. The length of a ramp or rafter is the hypotenuse of its rise and run.
  • 3D boxes. The space diagonal of a box is √(l² + w² + h²). A 3 × 4 × 12 box has a diagonal of √(9 + 16 + 144) = √169 = 13.

Common mistakes

  • Using the wrong side as c. The hypotenuse is always opposite the right angle and always the longest side. If your “leg” comes out longer than c, you have swapped them.
  • Adding instead of subtracting. For a missing leg, subtract: a² = c² − b².
  • Taking the square root too early. √(3² + 4²) is 5, but √3² + √4² is not; square, add, then take the root.
  • Using it on a triangle without a right angle. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos C.
  • Mixing units. Convert all sides to the same unit first. The area comes out in square units.

A little history

The theorem is named after the Greek mathematician Pythagoras (6th century BC), but the relationship was known much earlier. A Babylonian clay tablet known as Plimpton 322, from about 1800 BC, lists numbers that correspond to Pythagorean triples. Euclid’s Elements gives a proof as Book I, Proposition 47, and hundreds of different proofs have been published since.

For the area of any triangle, including one with three known sides, use the area calculator. The slope calculator finds the slope, angle and distance between two points, and the roofing calculator uses the same idea to turn a roof pitch into rafter lengths. For square roots and trig functions on their own, open the scientific calculator. Everything is calculated in your browser.

Cite this calculator

Using this calculator in an essay, report or article? Copy a ready-made reference. Check your teacher's or publisher's style guide for small differences.

APA
KazamTools. (2026, November 3). Pythagorean theorem calculator. Retrieved November 20, 2026, from https://kazamtools.com/math/pythagorean-theorem-calculator/
MLA
"Pythagorean Theorem Calculator." KazamTools, 3 Nov. 2026, https://kazamtools.com/math/pythagorean-theorem-calculator/. Accessed 20 Nov. 2026.
Chicago
KazamTools. "Pythagorean Theorem Calculator." Last modified November 3, 2026. Accessed November 20, 2026. https://kazamtools.com/math/pythagorean-theorem-calculator/.
Plain link
Pythagorean Theorem Calculator (KazamTools): https://kazamtools.com/math/pythagorean-theorem-calculator/
HTML link
<a href="https://kazamtools.com/math/pythagorean-theorem-calculator/">Pythagorean theorem calculator</a> by KazamTools

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse c is the longest side, opposite the 90° angle; a and b are the legs that form the right angle.

How do I find the hypotenuse?

Square both legs, add them and take the square root: c = √(a² + b²). With legs 6 and 8, c = √(36 + 64) = √100 = 10.

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse, then take the square root: a = √(c² − b²). With c = 13 and b = 12, a = √(169 − 144) = √25 = 5.

How do I check if a triangle is a right triangle?

Square the two shorter sides and add them. If the total equals the square of the longest side, the triangle has a right angle (this is the converse of the theorem). 5, 12 and 13 pass: 25 + 144 = 169 = 13². If the total is bigger, the triangle is acute; if smaller, it is obtuse.

What is a Pythagorean triple?

Three whole numbers that fit a² + b² = c², such as 3, 4, 5 or 5, 12, 13. Multiplying a triple by any whole number gives another one: 6, 8, 10 and 9, 12, 15 are both multiples of 3, 4, 5.

Why is the answer shown as 5√2?

Many hypotenuses are not whole numbers. √50 cannot be written as an exact decimal, but it simplifies to 5√2 because 50 = 25 × 2 and √25 = 5. The exact form is what most maths teachers expect; the decimal (about 7.0711) is what you measure with.

Does the Pythagorean theorem work for every triangle?

No, only for right triangles. For any other triangle use the law of cosines, c² = a² + b² − 2ab·cos C. When C is 90°, cos C is 0 and the law of cosines becomes the Pythagorean theorem.

Guides

Was this tool helpful?

Add this pythagorean theorem calculator to your website (free)

Copy this code into any web page. The tool stays free, has no ads inside it, and works on phones. Please keep the credit link under it.

Want a live preview or light and dark colours? Open this widget in the widget builder, where you can also browse every free calculator widget.