Pythagorean Theorem Calculator

Find the missing side of a right triangle with a² + b² = c².

Pythagorean Theorem Calculator tool

Find
—
Missing side
—
Angles
—
Area
—
Perimeter

About the Pythagorean Theorem Calculator

The Pythagorean theorem, a² + b² = c², answers practical questions such as how high a ladder reaches up a wall or whether a corner is truly square. This calculator finds the hypotenuse or a missing side, giving exact square roots and decimals: a 5 m ladder with its foot 1.5 m from the wall reaches about 4.77 m high. It also gives both acute angles, the area and the perimeter. Builders use the 3-4-5 rule from the same theorem to check right angles on site.

To find the hypotenuse, square both legs, add them and take the square root: c = √(a² + b²). To find a leg, subtract instead: a = √(c² − b²), which only works when the hypotenuse is the longest side. When the result is an irrational square root of a whole number, the calculator also shows the exact simplified radical, such as √8 = 2√2, alongside the decimal, which is the form most teachers want.

Example: legs of 3 and 4 give c = √(9 + 16) = √25 = 5, the famous 3-4-5 triangle, with angles of about 36.87° and 53.13°, an area of 6 and a perimeter of 12. A ladder 13 m long with its foot 5 m from a wall reaches √(169 − 25) = 12 m up the wall. Legs of 1 and 1 give a hypotenuse of √2 ≈ 1.414214.

Whole-number solutions such as 3-4-5, 5-12-13 and 8-15-17 are called Pythagorean triples. For triangles without a right angle use the triangle calculator, for the distance between points the distance formula calculator, and for roots the square root calculator.

How to use the Pythagorean Theorem Calculator

  1. Choose the missing sidePick the hypotenuse c, or leg a or leg b.
  2. Enter the known sidesType the two sides you know, in any unit.
  3. Read the missing sideSee the decimal value and, where possible, the exact square root.
  4. See the whole triangleGet both acute angles, the area, the perimeter and the working.

Pythagorean Theorem Calculator features

  • Find the hypotenuse or either leg
  • Exact simplified radicals such as 2√2
  • Both acute angles in degrees
  • Area and perimeter
  • Checks that the hypotenuse is longest
  • Step-by-step working
  • Works in any unit

Common uses

  • Geometry and trigonometry homework
  • Ladder, ramp and roof pitch problems
  • Checking that corners are square in building work
  • Screen diagonal and TV size questions
  • Distances on maps and grids

The Pythagorean theorem in daily life: ladders, screens, rafters and history

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

The Pythagorean theorem says that in a right-angled triangle, the square of the longest side equals the sum of the squares of the other two. It is one of the most useful results in mathematics, appearing whenever a diagonal, a slope or a straight-line distance is involved. This guide covers ladders, screens, roofs and pixel density, worked examples, and the surprisingly international history of the theorem.

Ladders and safety

A ladder leaning against a wall forms a right triangle with the wall and the ground. Safety guidance commonly recommends placing the base one unit out from the wall for every four units of height, which corresponds to an angle of about 75 degrees. Pythagoras then gives the height a ladder reaches, or the length of ladder needed for a given height.

A worked example: how high does the ladder reach?

A 6-metre ladder stands with its base 1.5 metres from a wall. The height it reaches is the square root of 6² − 1.5², which is the square root of 36 − 2.25 = 33.75, about 5.81 metres. The ratio of 1.5 to 6 is exactly 1 to 4, so this placement also follows the safety guideline.

If a job needs a reach of 7 metres with the same ratio, the ladder must be about 7.2 metres long, so the 6-metre ladder is not enough, whatever the angle.

Screens and diagonals

Screen sizes are diagonals, so the width and height of a screen are connected by Pythagoras through its aspect ratio. For a 16:9 screen, the diagonal is the square root of 16² + 9², about 18.36 units, which is why the width is about 87% of the diagonal and the height about 49%.

Pixel density uses the same calculation: a 24-inch monitor with 1920 × 1080 pixels has a diagonal of the square root of 1920² + 1080², about 2,203 pixels, so its density is about 92 pixels per inch.

Roof rafters

The length of a roof rafter is the hypotenuse of a triangle formed by the horizontal run and the vertical rise. A roof with a run of 4 metres and a rise of 1.5 metres needs rafters of the square root of 16 + 2.25, about 4.27 metres, before allowing for any overhang beyond the wall. Carpenters calculate this before cutting, since rafters are expensive to replace.

Straight-line distances

On any grid where directions are at right angles, such as a city map or a set of coordinates, the straight-line distance between two points uses the theorem. Walking 300 metres east and 400 metres north puts you 500 metres from the start in a straight line. In three dimensions, the theorem extends naturally, giving the diagonal of a box or a room.

Checking right angles

Builders use the converse of the theorem to check corners: if the sides of a triangle satisfy a² + b² = c², the angle opposite c is a right angle. The 3-4-5 method marks 3 units along one side and 4 along the other; if the diagonal between the marks is 5, the corner is square. Larger multiples, such as 6-8-10 metres, give more accuracy on big foundations.

An international history

The theorem is named after Pythagoras, the Greek thinker of the 6th century BC, but it was known much earlier. A Babylonian clay tablet called Plimpton 322, from around 1800 BC, lists sets of numbers that form right triangles, and Indian texts known as the Sulba Sutras, used for constructing altars, state the relationship too. Euclid's Elements, around 300 BC, gave one of the most famous proofs, and hundreds of different proofs have been published since.

Common mistakes

  • Using the theorem on triangles without a right angle.
  • Adding the sides instead of their squares.
  • Treating the longest side as a leg instead of the hypotenuse.
  • Forgetting to take the square root at the end.

Related tools

For triangles without a right angle, use Triangle Calculator. For coordinates, try Distance Formula Calculator, and for roof work, Roofing Calculator.

Stair stringers

The sloping boards that support a staircase, called stringers, are the hypotenuse of a triangle formed by the total rise and the total run. A staircase rising 2.7 metres over a horizontal run of 3.6 metres needs stringers about 4.5 metres long, the square root of 2.7² + 3.6². These numbers form a scaled 3-4-5 triangle, which makes the right angle at the foot easy to check on site.

Running cables and pipes diagonally

A diagonal route between two corners is shorter than going along two walls. Across a room measuring 4 by 3 metres, the diagonal is 5 metres, while following the walls takes 7 metres. Electricians, plumbers and garden designers use this to estimate cable, pipe or path lengths, though in practice routes often follow walls for neatness and access, so both figures are useful when ordering materials.

Limits

Results are exact where the roots simplify and rounded decimals otherwise. Real measurements carry their own errors.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, a² + b² = c², where c is the hypotenuse opposite the right angle and a and b are the legs. It lets you find any side from the other two.

How do I find the hypotenuse?

Square the two legs, add them and take the square root. For legs 6 and 8: 36 + 64 = 100, and √100 = 10. The hypotenuse is always the longest side.

How do I find a missing leg?

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

What are Pythagorean triples?

Sets of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple, such as 6-8-10, is also a triple.

Does the Pythagorean theorem work for all triangles?

Only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab cos C, which reduces to Pythagoras when the angle C is 90°.

How do builders use the 3-4-5 rule?

To check a corner is square, measure 3 units along one side and 4 along the other. If the diagonal between the marks is exactly 5 units, the corner is a right angle.

How do I find the angles of a right triangle?

Use trigonometry: the angle opposite leg a is arctan(a ÷ b), and the other acute angle is 90° minus that. For 3 and 4, the angles are about 36.87° and 53.13°.

Can I use the Pythagorean theorem in 3D?

Yes. The space diagonal of a box with sides a, b and c is √(a² + b² + c²), found by applying the theorem twice. A box measuring 3 × 4 × 12 has a diagonal of √169 = 13 units.