Calculatormatics

Last updated: April 2026 · Reviewed by Calculatormatics Editorial Team

Triangle Calculator

A free triangle calculator that solves any triangle from a minimal set of inputs. Three modes are supported: right triangle (enter any two sides — the calculator finds the third by Pythagoras and the angles by trigonometry), SSS (three sides — uses the law of cosines to find each angle), and SAS (two sides plus the included angle — uses the law of cosines for the third side, then the law of sines for the remaining angles). Whichever input mode you pick, the calculator returns all three sides, all three angles, the area (computed via ½ab·sin(C) or Heron's formula s = (a+b+c)/2 → A = √[s(s−a)(s−b)(s−c)]), and the perimeter, with the formulas shown so you can check the working. The calculator also validates triangle inequality (a + b > c, etc.) and flags impossible inputs. Useful for geometry homework, surveying, drafting, woodworking, navigation, structural engineering, or any problem that involves finding the missing parts of a triangle from partial information. Pick a mode below and enter your known values.

Right Triangle (a² + b² = c²)

Enter any 2 sides. Leave the third blank. c = hypotenuse.

Leg a:3
Leg b:4
Hypotenuse c:5
Angle A:36.8699°
Angle B:53.1301°
Angle C:90°
Area:6
Perimeter:12
Given: a = 3, b = 4

Using Pythagorean theorem: c = √(a² + b²)
  c = √(3² + 4²)
  c = √(9 + 16)
  c = √25
  c = 5

Angles:
  A = arcsin(a/c) = arcsin(3/5) = 36.8699°
  B = arcsin(b/c) = arcsin(4/5) = 53.1301°
  C = 90°

Right Triangle Trigonometry

A right triangle has one 90° angle. The side opposite the right angle is the hypotenuse (c), the longest side. The other two sides are legs (a and b).

Pythagorean theorem: a² + b² = c²

The trigonometric functions relate angles to side ratios. For angle A (opposite side a, adjacent side b, hypotenuse c):

Function Formula Mnemonic
sin(A) opposite / hypotenuse = a/c SOH
cos(A) adjacent / hypotenuse = b/c CAH
tan(A) opposite / adjacent = a/b TOA

The mnemonic SOH-CAH-TOA helps remember these definitions. Inverse functions (arcsin, arccos, arctan) convert a ratio back to an angle.

Special Right Triangles

Type Angles Side ratio Example
45-45-90 45°, 45°, 90° 1 : 1 : √2 legs 5, 5 → hyp 5√2 ≈ 7.071
30-60-90 30°, 60°, 90° 1 : √3 : 2 short leg 3, long leg 3√3 ≈ 5.196, hyp 6
3-4-5 37°, 53°, 90° 3 : 4 : 5 3² + 4² = 9 + 16 = 25 = 5²

The Law of Sines

For any triangle with sides a, b, c opposite angles A, B, C:

a / sin(A) = b / sin(B) = c / sin(C)

The law of sines is used when you know:

The Law of Cosines

The law of cosines generalizes the Pythagorean theorem to non-right triangles:

c² = a² + b² − 2ab × cos(C)

Similarly: a² = b² + c² − 2bc × cos(A), and b² = a² + c² − 2ac × cos(B).

Use the law of cosines when you know:

Heron's Formula for Area

When all three sides are known, compute area without needing a height using Heron's formula:

  1. Compute semi-perimeter: s = (a + b + c) / 2
  2. Area = √(s × (s−a) × (s−b) × (s−c))

Example: Triangle with sides 5, 6, 7: s = 9, Area = √(9×4×3×2) = √216 ≈ 14.70. In construction, triangle area calculations help estimate material needs — see our Square Footage Calculator for room-level planning.

Frequently Asked Questions

What is the law of sines?

The law of sines states: a/sin(A) = b/sin(B) = c/sin(C), where a, b, c are the sides opposite angles A, B, C respectively. It is used to solve triangles when you know two angles and a side (AAS or ASA) or two sides and a non-included angle (SSA). The ratio of any side to the sine of its opposite angle is constant for a given triangle.

What is the law of cosines?

The law of cosines: c² = a² + b² − 2ab·cos(C), where C is the angle between sides a and b. It generalizes the Pythagorean theorem — when C = 90°, cos(90°) = 0, and the formula reduces to c² = a² + b². Use it for SSS (find angles from sides) or SAS (find the third side from two sides and the included angle).

How do you find the area of a triangle?

Several formulas exist: (1) Base-height: A = ½ × b × h, where h is perpendicular height. (2) Heron's formula: A = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2. (3) SAS formula: A = ½ab·sin(C) where C is the angle between sides a and b. (4) Coordinate formula: A = ½|x₁(y₂−y₃) + x₂(y₃−y₁) + x₃(y₁−y₂)| for vertices (x₁,y₁), (x₂,y₂), (x₃,y₃).

What are the triangle inequality rules?

For three lengths to form a valid triangle, the sum of any two sides must be greater than the third: a + b > c, a + c > b, and b + c > a. If any condition fails, no triangle exists. A degenerate case occurs when one side equals the sum of the other two (a + b = c), creating a "flat triangle" with zero area. For right triangles, additionally c must be greater than both a and b.

What are the types of triangles?

By sides: Equilateral (all sides equal, all angles 60°), Isosceles (two equal sides, two equal angles), Scalene (all sides different). By angles: Acute (all angles < 90°), Right (one angle exactly 90°), Obtuse (one angle > 90°). Special right triangles: 45-45-90 (legs equal, hypotenuse = leg × √2) and 30-60-90 (sides in ratio 1:√3:2).