Triangle Calculator

Enter the three side lengths of a triangle to calculate its perimeter, area, and interior angles.

Side lengths

Perimeter
18
Area
14.98
∠A (°)
44.4°
∠B (°)
57.1°
∠C (°)
78.5°
a
—
b
—
c
—
h_a
—
h_b
—
h_c
—
Median m_a
—
Median m_b
—
Median m_c
—
Inradius r
—
Circumradius R
—
Triangle type
—

S=ahₐ/2=bc·sin(A)/2; a/sin(A)=b/sin(B)=c/sin(C); hₐ=2S/a; mₐ=√(2b²+2c²−a²)/2; r=2S/P; R=abc/(4S); ∠≈90° (±10⁻¹⁰°).

Approximate results show up to 12 significant digits. Decimal fields use a dot, up to 12 digits on each side, an exponent from −24 to 24 and absolute values up to 10¹². Rational intermediate numerators and denominators are limited to 512 bits. Integer and scientific-notation exceptions are specified below. p=a+b+c; s=p/2; A=√(s(s−a)(s−b)(s−c)); a,b,c > 0; a+b>c; a+c>b; b+c>a.

How these triangle formulas work

Given three side lengths (a, b, c), this calculator uses Heron's formula to find the area: first compute the semi-perimeter s = (a + b + c) / 2, then area = √(s(s−a)(s−b)(s−c)).

The three interior angles are found with the law of cosines, which relates each angle to the lengths of the sides opposite and adjacent to it. The angles always add up to 180°.

Not every combination of three lengths forms a valid triangle — the triangle inequality requires that the sum of any two sides be greater than the third side.

Frequently asked questions

What is Heron's formula?

Heron's formula calculates a triangle's area directly from its three side lengths, without needing to know any angles: area = √(s(s−a)(s−b)(s−c)), where s is the semi-perimeter.

Why does my triangle show an error?

The three lengths you entered violate the triangle inequality — the sum of the two shorter sides must be greater than the longest side, or no triangle can be formed.

Do the three angles always add up to 180°?

Yes, for any triangle on a flat (Euclidean) plane, the interior angles always sum to exactly 180 degrees.

How we verified this calculator

The calculator is checked against 2 reference cases computed independently of its code. Last passed: .

# Inputs Expected result
1
Mode = Base and height
a = 10
Height hₐ = 4
Area: 20
a: 10
h_a: 4
2
Mode = Base and height
a = 2.5
Height hₐ = 0.3
Area: 0.375
a: 2.5
h_a: 0.3

How we test our calculators →

Also try:

Back to category →