Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Right Triangle Calculator — any 2 values, fully solved.

Enter any two values (two sides, one side and one angle, or the hypotenuse and an angle) and the right triangle is solved completely. Includes the SVG diagram, trig ratios, area, perimeter, altitude to hypotenuse, and step-by-step working.

How it worksReal-time

Inputs

Any 2 values

Inputs2/2 filled

Solved via: Two legs (a, b)

a=
b=
c= hyp
opposite ∠Aopposite ∠Bhypotenuse
A=°
B=°
C=90°

Right triangle solved

C = 90°

6unit²

Area = ½ × a × b

12perimeter2.4alt. to c
a = 3b = 4c = 5A36.87°B53.13°C90°

Drawn proportionally

Side a
3
opposite ∠A
Side b
4
opposite ∠B
Side csolved
5
hypotenuse
Angle Asolved
36.8699°
degrees
Angle Bsolved
53.1301°
degrees
Angle Cfixed
90.0000°
right angle (fixed)

Trigonometry

SOH-CAH-TOA ratios for angle A

∠A = 36.87°
sin A
= a / c
0.6
cos A
= b / c
0.8
tan A
= a / b
0.75
csc A
= c / a
1.666667
sec A
= c / b
1.25
cot A
= b / a
1.333333

Properties

Measures & derived values

Area
6
unit²
Perimeter
12
units
Alt. to c
2.4
h = ab/c
Hypotenuse
5
c

Working

Step-by-step solution

Two legs (a, b)
  1. 1Find the hypotenuse via Pythagorean theorem
    c = √(a² + b²) = √(3² + 4²) = √25 = 5
  2. 2Find angle A using arctan
    A = arctan(a / b) = arctan(3 / 4) = 36.87°
  3. 3Find angle B from the angle sum A + B = 90°
    B = 90° − A = 90° − 36.87° = 53.13°

Field guide

What is a right triangle?

A right triangle is any triangle that contains exactly one 90° angle. The side opposite the right angle is always the longest side and is called the hypotenuse. The other two sides, those that form the right angle, are called legs. In this calculator, we label:

  • C: the vertex where the right angle sits (90°, always fixed)
  • a: the leg opposite angle A (horizontal in the diagram)
  • b: the leg opposite angle B (vertical in the diagram)
  • c: the hypotenuse opposite angle C
  • A and B: the two acute angles (A + B = 90°)

Because one angle is always 90°, a right triangle has only five unknowns instead of six. Any two of those five uniquely determine the triangle; you just need to know two things, and this calculator finds the rest.

The Pythagorean theorem.

The most famous result in all of geometry: in a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs.

a² + b² = c²

This single equation is the foundation for solving any right triangle given two sides. The three rearrangements are:

c = √(a² + b²) (find hypotenuse from both legs)
a = √(c² − b²) (find a leg from hypotenuse + other leg)
b = √(c² − a²) (find the other leg similarly)

Example (3-4-5): a = 3, b = 4 → c = √(9 + 16) = √25 = 5.

Trigonometric ratios: SOH-CAH-TOA.

When one side and one angle are known, the remaining sides are found using the three primary trig ratios. The mnemonic SOH-CAH-TOA captures all three:

SOH: sin A = opposite / hypotenuse = a / c
CAH: cos A = adjacent / hypotenuse = b / c
TOA: tan A = opposite / adjacent = a / b

The calculator uses these identities to solve for unknown sides and angles in every case. For example, if you know leg a and angle A:

b = a / tan A (from tan A = a / b)
c = a / sin A (from sin A = a / c)

All 9 valid input combinations.

With C fixed at 90°, there are C(5, 2) = 10 possible pairs of the five unknowns {a, b, c, A, B). One pair (A + B alone) only constrains the shape, not the size, so it cannot uniquely determine the triangle. The remaining 9 pairs all produce a unique solution:

GivenMethodKey formula
a + bPythagorean theoremc = √(a² + b²)
a + cPythagorean theoremb = √(c² − a²)
b + cPythagorean theorema = √(c² − b²)
a + Atan / sinb = a/tan A, c = a/sin A
a + Btan / cosb = a·tan B, c = a/cos B
b + Atan / cosa = b·tan A, c = b/cos A
b + Btan / sina = b/tan B, c = b/sin B
c + Asin / cosa = c·sin A, b = c·cos A
c + Bcos / sina = c·cos B, b = c·sin B

The calculator automatically detects which pair you’ve entered and applies the appropriate formula.

Special right triangles.

45°-45°-90° triangle (isoceles right triangle)

When both acute angles are 45°, the two legs are equal (a = b), and the hypotenuse is a = b times √2:

If a = b = 1 : c = √2 ≈ 1.4142
Angles: A = 45°, B = 45°, C = 90°

This triangle arises naturally from the diagonal of a square. If a square has side length s, its diagonal has length s√2, the hypotenuse of the 45-45-90 triangle formed by that diagonal.

30°-60°-90° triangle (half equilateral)

Bisecting an equilateral triangle produces a 30-60-90 triangle. The side ratios are fixed:

Short leg (30°) : Long leg (60°) : Hypotenuse = 1 : √3 : 2
If hypotenuse c = 2 : a = 1, b = √3 ≈ 1.7321

The 30-60-90 triangle appears in many geometry proofs and is used in architecture, engineering, and navigation.

Pythagorean triples

A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c². Every triple represents a right triangle with integer sides, which makes them particularly useful in construction and carpentry (the “3-4-5 method” for checking right angles).

abc
345
51213
81517
72425
202129
94041

Area, perimeter, and the altitude to the hypotenuse.

The area of a right triangle is half the product of the two legs:

Area = ½ × a × b

The perimeter is the sum of all three sides:

Perimeter = a + b + c

The altitude from the right-angle vertex C to the hypotenuse (sometimes called the geometric mean altitude) is:

h = a × b / c

This altitude has a beautiful property: it is the geometric mean of the two segments it creates on the hypotenuse (p and q, where p + q = c):

h² = p × q (geometric mean relation)

Real-world applications.

  • Construction & carpentry: the 3-4-5 method is used to set right angles on building foundations. A tape measure spans 3 ft along one wall, 4 ft along the other, and 5 ft diagonally. If the diagonal is exactly 5 ft, the corner is square.
  • Navigation: calculating the straight-line distance between two points given their horizontal and vertical separation (the legs), essentially Pythagorean theorem in 2D space.
  • Roof pitch: a roof’s rise and run form the legs of a right triangle; the rafter length is the hypotenuse.
  • Screen size: display screen size is measured diagonally, the hypotenuse of the right triangle formed by the screen’s width and height.
  • Physics: vector decomposition, resolving forces into horizontal and vertical components, and countless mechanics problems use right triangle trigonometry.

Disclaimer

This calculator solves the mathematical right triangle problem to 6+ decimal places of precision. All computations run in the browser with no data sent to any server. Inputs are limited to positive values between 0 and 1,000,000 for sides and 0° to 89.999° for angles.