Right-Angled Triangle Calculator

Find the missing side or angle of a right-angled triangle, with a diagram.

and
b = 4 a = 3 c = 5
Hypotenuse (c)
5
Angle A 36.87° · Angle B 53.13°
Updates as you type
Copied ✓
AdvertisementAd slot #1 · below the result

What it does

Give this calculator the two short sides (the legs) of a right-angled triangle and it returns the third side — the hypotenuse — along with the triangle's two other angles. The diagram redraws to scale as you type, so you can see the shape your numbers make. Nothing is sent to a server; the maths runs in your browser.

How it works

A right-angled triangle has one 90° corner. The two sides that meet at that corner are the legs, a and b; the side opposite the right angle is the hypotenuse, c, and it is always the longest side. The hypotenuse comes from Pythagoras' theorem:

Pythagoras' theorem
a² + b² = c²  →  c = √(a² + b²)

Square each leg, add the squares, then take the square root. The two non-right angles follow from basic trigonometry — each angle's tangent is the side opposite it divided by the side next to it (its adjacent leg):

The angles
angle A = atan(a ÷ b)  ·  angle B = 90° − angle A

Angle A sits opposite leg a and angle B opposite leg b. Because the three angles of any triangle add up to 180° and one of them is the 90° right angle, the other two must always add up to 90°.

leg b leg a hypotenuse c

Worked example

Take the legs a = 3 and b = 4. Square them and add: 3² + 4² = 9 + 16 = 25. The hypotenuse is the square root of that sum: c = √25 = 5. The angles are atan(3 ÷ 4) = 36.87° opposite leg a, and 90° − 36.87° = 53.13° opposite leg b. This is the famous 3-4-5 triangle.

Common uses

  • Building and DIY: setting out a true square corner. Builders use the 3-4-5 method — measure 3 units along one wall and 4 along the other; when the diagonal between the marks is exactly 5, the corner is a perfect right angle.
  • Roof pitch and ramps: the rise and the horizontal run are the two legs, and the rafter or ramp length is the hypotenuse.
  • Screens and displays: a screen's diagonal is the hypotenuse of its width and height — how a "27-inch" monitor is measured.
  • Navigation and maps: straight-line ("as the crow flies") distance from how far east and how far north you have travelled.
  • Schoolwork: checking GCSE and Key Stage 3 Pythagoras and trigonometry homework.

Frequently asked

What is the hypotenuse?

It is the side directly opposite the right angle, and it is always the longest of the three sides. In this tool it is the side labelled c, found from c = √(a² + b²).

How do I find an angle of a right-angled triangle?

Use the two legs. The angle opposite a given leg has a tangent equal to that leg divided by the other leg, so the angle is atan(opposite ÷ adjacent). For legs 3 and 4, the angle opposite the side of length 3 is atan(3 ÷ 4) = 36.87°.

What is a 3-4-5 triangle?

A right-angled triangle whose sides are exactly 3, 4 and 5 units — the smallest set of whole numbers that satisfy a² + b² = c² (9 + 16 = 25). Because the sides are whole numbers it is easy to mark out on site, which is why it is the standard trick for getting a square corner.

Does it matter which leg is a and which is b?

No. Swapping the two legs gives the same hypotenuse and simply swaps the two angles, because addition and the shape itself are unchanged.

Built and checked against known answers by BOSH Group — see how we build & verify our tools.

AdvertisementAd slot #2 · after the explainer