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.
Inputs
Any 2 values
Solved via: Two legs (a, b)
Right triangle solved
C = 90°
Area = ½ × a × b
Drawn proportionally
Trigonometry
SOH-CAH-TOA ratios for angle A
Properties
Measures & derived values
Working
Step-by-step solution
- 1Find the hypotenuse via Pythagorean theorem
c = √(a² + b²) = √(3² + 4²) = √25 = 5
- 2Find angle A using arctan
A = arctan(a / b) = arctan(3 / 4) = 36.87°
- 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.
This single equation is the foundation for solving any right triangle given two sides. The three rearrangements are:
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:
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:
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:
| Given | Method | Key formula |
|---|---|---|
a + b | Pythagorean theorem | c = √(a² + b²) |
a + c | Pythagorean theorem | b = √(c² − a²) |
b + c | Pythagorean theorem | a = √(c² − b²) |
a + A | tan / sin | b = a/tan A, c = a/sin A |
a + B | tan / cos | b = a·tan B, c = a/cos B |
b + A | tan / cos | a = b·tan A, c = b/cos A |
b + B | tan / sin | a = b/tan B, c = b/sin B |
c + A | sin / cos | a = c·sin A, b = c·cos A |
c + B | cos / sin | a = 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:
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:
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).
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
Area, perimeter, and the altitude to the hypotenuse.
The area of a right triangle is half the product of the two legs:
The perimeter is the sum of all three sides:
The altitude from the right-angle vertex C to the hypotenuse (sometimes called the geometric mean altitude) is:
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):
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.