🧮
🧮 Math & statistics

Right Triangle & Pythagorean Theorem Calculator

Results update as you type.

Your numbers

Understanding the right triangle and Pythagorean theorem calculator — concept and principle

Enter the two legs of a right triangle (the sides that form the 90° angle) and this calculator returns the hypotenuse, both acute angles, the area and the height from the right angle to the hypotenuse. It is the everyday tool for ladder and ramp lengths, roof pitch, screen diagonals, distances on a map grid and checking that a frame is square.

Pythagorean theorem with a 3-4-5 right triangleSquares on the legs hold 9 and 16 tiles, the square on the hypotenuse holds 25, so c = 5; area 6, height 2.4.3² + 4² = 5²: count the tiles93²164²255²9 + 16 = 25c = √25 = 5Area 3 × 4 ÷ 2 = 6Height 12 ÷ 5 = 2.4A 36.87° · B 53.13°
The two leg squares (9 + 16 tiles) exactly fill the hypotenuse square (25 tiles).

How it is calculated

Both legs must use the same unit; c and h are in that unit, the area in that unit squared, and the angles in degrees.

The principle

Place four copies of the right triangle inside a square of side a + b so that their hypotenuses form a tilted inner square of side c. The big square's area is (a + b)², which equals the four triangles (4 × ab/2 = 2ab) plus the inner square (c²). So a² + 2ab + b² = 2ab + c², hence a² + b² = c². The angles follow from the tangent, opposite ÷ adjacent. The height formula comes from computing the area two ways: ½ab with the legs as base and height, and ½ch with the hypotenuse as base.

Worked example

  1. Default inputs: a = 3, b = 4.
  2. Hypotenuse: c = √(9 + 16) = √25 = 5.
  3. Angle A = arctan(3 ÷ 4) = 36.86989765°; angle B = arctan(4 ÷ 3) = 53.13010235°. They add to 90°.
  4. Area: 3 × 4 ÷ 2 = 6.
  5. Height to the hypotenuse: 12 ÷ 5 = 2.4.
How Hypotenuse c changes with Leg bHow Hypotenuse c changes with Leg b2468101234568Example: 5Leg b
Each point is the calculator re-run with only “Leg b” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Leg bHypotenuse c
13.16227766
23.605551275
34.242640687
45
55.830951895
66.708203932
88.544003745

How to read the result

The hypotenuse is always the longest side but shorter than a + b. Equal legs give 45° angles and c = a√2 ≈ 1.414a. For a ramp, the angle opposite the rise is the slope angle; a 1 : 12 ramp (rise 1, run 12) is about 4.76°. The height to the hypotenuse is the shortest distance from the right-angle corner to the long side.

Common mistakes

Keep in mind: Real construction, ramp and roof work must follow local building codes and accessibility rules, and should be checked by a qualified professional; measured lengths always carry error.

Frequently asked questions

How do I find a leg if I know the hypotenuse?

Rearrange: b = √(c² − a²). With c = 13 and a = 5, b = √144 = 12.

How do I calculate a TV screen's diagonal?

The width and height are the legs; a 16:9 screen 120 cm wide is about 67.5 cm tall, so the diagonal is about 137.7 cm.

Does the theorem work in three dimensions?

Yes. A box's space diagonal is √(a² + b² + c²).

Sources: Heath, T. L. (trans.), The Thirteen Books of Euclid's Elements, Book I, Proposition 47 · Maor, E., The Pythagorean Theorem: A 4,000-Year History, Princeton University Press

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🧮 All math & statistics tools →🌍 Calculators by country →