Right Triangle Calculator

Calculate missing sides, angles, area, perimeter, altitude, and trigonometric values for right triangles using the Pythagorean theorem and trigonometric functions.

Enter any 2 values

Give any 2 of the 5 values — two legs, a leg + hypotenuse, a leg + angle, or hypotenuse + angle. Angle C is always 90°.

units
units
units
°
°

Right triangle calculator

A right triangle has exactly one 90° angle. The two sides flanking the right angle are the legs (often labelled a and b), and the side opposite is the hypotenuse c — always the longest side. Because the angle at the right vertex is fixed, only two more independent measurements are needed to pin down the entire triangle.

This tab gives you any two values — two legs, a leg + the hypotenuse, a leg + an acute angle, or the hypotenuse + an acute angle — and returns the missing side, the missing angle, the area, the perimeter, the altitude to the hypotenuse, and the six trigonometric ratios (sin, cos, tan, csc, sec, cot) for the named acute angle.

How the right triangle solver works

Pythagorean theorem

When you give two legs, the hypotenuse is the square root of the sum of their squares: c = √(a² + b²). When you give a leg and the hypotenuse, the other leg is √(c² − leg²).

Trigonometric ratios

When you give a side and an acute angle, the other sides follow from sin θ = opposite / hypotenuse, cos θ = adjacent / hypotenuse, and tan θ = opposite / adjacent.

Angle relations

The two acute angles always sum to 90°, so giving one immediately gives the other: B = 90° − A. No need to solve for both.

Altitude to the hypotenuse

Drop a perpendicular from the right-angle vertex onto the hypotenuse and you split the triangle into two smaller similar triangles. The altitude is h = a·b / c.

Ways to use the right triangle solver

1

Building a roof or staircase

Given the run (horizontal) and rise (vertical), find the rafter length and pitch angle.

2

Sailing or aviation

Convert a heading and distance into north–south and east–west components.

3

Surveying

Find an inaccessible distance by sighting an angle from a known baseline.

4

Trigonometry homework

Generate the six trig ratios for any acute angle to validate textbook problems.

5

Pythagorean triples

Quickly verify whether (3, 4, 5), (5, 12, 13), (7, 24, 25), or any candidate triple forms a right triangle.

6

30-60-90 and 45-45-90 checks

Plug in the angle and the calculator returns the exact decimal expansions of √2/2, √3/2, and 1/2.

Best practices

Leg must be shorter than the hypotenuse

If you enter a leg larger than the hypotenuse, no right triangle exists. The solver returns a clear error.

Each acute angle is strictly < 90°

If you typed 90° as a non-right angle, the triangle would be degenerate. The solver enforces 0° < angle < 90°.

Watch units

Mixing inches and centimeters gives nonsense. Pick one unit for all three sides.

Tricky cases

When only two angles are given

Two angles alone determine the shape but not the size. The solver requires at least one side.

Floating-point noise near 0° or 90°

Trig values like tan(89.99°) become huge; treat extreme angles as approximations and double-check against the Pythagorean form.

Negative trig values

In a right triangle the acute angles are between 0° and 90°, so all six trig ratios are positive. Negative values indicate an angle outside the right-triangle range.

Right triangle formulas

Pythagorean theorem

a² + b² = c²

Sine

sin θ = opposite / hypotenuse

Cosine

cos θ = adjacent / hypotenuse

Tangent

tan θ = opposite / adjacent

Acute-angle sum

A + B = 90°

Area

Area = ½ · a · b

Perimeter

P = a + b + c

Altitude to hypotenuse

h = a · b / c

Common right-triangle mistakes

  • Mixing up opposite and adjacent

    Opposite always means "across from the angle"; adjacent means "next to the angle and not the hypotenuse". Drawing the triangle and labelling first prevents the swap.

  • Square-rooting the wrong difference

    If you know the hypotenuse and one leg, subtract squared values first, then square-root: √(c² − a²), not √(c − a)·√(c + a) (which is the same value but easy to compute wrong).

Frequently asked questions

A right triangle has exactly one 90° interior angle. The two sides adjacent to the right angle are the legs (often labelled a and b), and the side opposite is the hypotenuse c — always the longest side. The other two angles are acute and always sum to 90°.

For any right triangle with legs a and b and hypotenuse c, a² + b² = c². It's the most-used result in elementary geometry. Given any two of {a, b, c}, the third follows from one rearrangement: c = √(a² + b²), a = √(c² − b²), or b = √(c² − a²).

Use trigonometric ratios. If you know leg a and the angle A opposite it, the hypotenuse is c = a / sin A. If you know leg a and the angle B between it and the hypotenuse, then c = a / cos B.

Drop a perpendicular from the right-angle vertex to the hypotenuse. The length of this segment is h = a · b / c — the product of the two legs divided by the hypotenuse. It splits the original triangle into two smaller right triangles that are both similar to the original.

For an acute angle in a right triangle, sin = opposite / hypotenuse, cos = adjacent / hypotenuse, and tan = opposite / adjacent. The other three (csc, sec, cot) are their reciprocals. These six ratios depend only on the angle, not the triangle's size — that's the basis of trigonometry.

A set of three positive integers (a, b, c) satisfying a² + b² = c². The most familiar are (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any integer multiple of a triple is also a triple. They're useful for building right angles without trigonometry — measure off 3, 4, and 5 units along a rope and you have a square corner.

A 45-45-90 triangle has legs of equal length and hypotenuse √2 times the leg. A 30-60-90 triangle has sides in the ratio 1 : √3 : 2 (short leg : long leg : hypotenuse). Both come up constantly in geometry problems because their side ratios are exact closed-form expressions involving √2 and √3.