Right triangle calculator

Enter the two sides next to the right angle and see both angles, the hypotenuse, the area and the perimeter, with the steps.

Answer in

The two sides next to the right angle of a right-angled triangle.

Fill in the fields; the answer appears here straight away.

How it works

  1. Enter the values

    Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.

  2. Instant answer

    The answer appears as you type, with the most important intermediate values.

  3. See the working

    Under "How it's worked out" you see the steps, handy for checking your own calculation.

How it works

For a right-angled triangle with legs a (opposite angle α) and b (adjacent to α):

  • tan(α) = a ÷ b, so α = tan⁻¹(a ÷ b)
  • β = 90° − α
  • c = √(a² + b²) (Pythagorean theorem)

With a = 3 and b = 4, the hypotenuse is 5 and α ≈ 36.87°.

Units

The angles come out in degrees or radians, whichever you choose. The sides can be in any unit, as long as both are in the same one. Only need one angle from a ratio? Use the arctan calculator.

Worked examples

  • The classic 3-4-5: legs 3 and 4 give a hypotenuse of 5, angles of 36.87° and 53.13°, area 6 and perimeter 12.
  • A gentle slope: a rise of 1 over a run of 12 gives α = tan⁻¹(1/12) ≈ 4.76°, a hypotenuse of √145 ≈ 12.04 and a perimeter of about 25.04.

Pythagorean triples

Some triangles have whole-number sides: 3-4-5, 5-12-13, 8-15-17 and any multiple of them, such as 6-8-10. Carpenters use 3-4-5 to check a square corner: measure 30 cm along one edge and 40 cm along the other, and the diagonal should be exactly 50 cm.

Roof pitch and ladders

A roof that rises 4 m over a half-span of 6 m has a pitch of tan⁻¹(4/6) ≈ 33.7° and a rafter of √52 ≈ 7.21 m. A ladder that touches a wall at 4 m height with its foot 1.5 m away is √(16 + 2.25) ≈ 4.27 m long, and stands at tan⁻¹(4/1.5) ≈ 69.4° with the ground. For one angle from a ratio, use the arctan calculator.

Frequently asked questions

What if I know the hypotenuse and one leg?

Find the other leg first with the Pythagorean theorem, b = √(c² − a²), and enter both legs. For c = 13 and a = 5, b = √(169 − 25) = 12.

Which leg should be a and which b?

Either one. Side a is opposite angle α, and side b is opposite angle β. Swapping the two simply swaps the two angles in the answer.

Can I use any units for the sides?

Yes, as long as both are in the same unit. The hypotenuse and perimeter come out in that unit, and the area in its square.

Does it work for triangles without a right angle?

No. For other triangles use the cosine rule with the [cosine](/en/math/cosine-calculator) and [arccos](/en/math/arccos-calculator) calculators.