Skip to content
ENExplore Calculators

Triangle Calculator

Solve any triangle from three known values using the sine and cosine rules.

About Triangle Calculator

For a right triangle, the Pythagorean theorem gives the hypotenuse c = √(a² + b²). The area is half the product of the two legs, and the two non-right angles are found with the arctangent of the leg ratio.

Formulas

Hypotenuse — Pythagorean theorem

c = √(a² + b²)

a
First leg (perpendicular side)
b
Second leg (perpendicular side)
c
Hypotenuse (side opposite the right angle)

Angles — Law of Sines (right triangle)

a / sin(A) = b / sin(B) = c / sin(90°) = c → A = arctan(a / b), B = 90° − A

A
Angle opposite leg a
B
Angle opposite leg b
C
Right angle (90°)

Area

Area = (a × b) ÷ 2

Perimeter

Perimeter = a + b + c

Worked example

With the default values below, Triangle Calculator returns Hypotenuse (c) of 5.0000. Change any input above and every figure here is recalculated in your browser.

Inputs used

Leg aaccepts 0–1,000,000 units
3 units
Leg baccepts 0–1,000,000 units
4 units

Results

Hypotenuse (c)
5.0000
Area
6.0000
Perimeter
12.0000
Angle opposite a (°)
36.87
Angle opposite b (°)
53.13

Step by step

  1. 1Apply the Pythagorean theorem to find the hypotenuse= 5.0000
  2. 2Find angle A using the Law of Sines: sin(A) = a / c= 36.87°For a right triangle sin(A) = a/c = tan(A)·cos(A); arctan(a/b) is equivalent and numerically stable.
  3. 3Angle B = 90° − A (angles in a triangle sum to 180°)= 53.13°
  4. 4Calculate the area= 6.0000
  5. 5Calculate the perimeter= 12.0000

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Does this work for non-right triangles?

This calculator assumes a right triangle (one 90° angle) defined by its two perpendicular legs. Other triangles need side-angle-side or law-of-cosines methods.

What units does it use?

It's unit-agnostic — enter both legs in the same unit and all outputs use that unit (area is in that unit squared).

Triangle Calculator – Calculate Hypotenuse (c) & Area