Skip to content
CalculatorAtlas

Triangle Calculator

Tested

Solve sides, angles and area of a triangle.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Given three sides, Heron's formula gives the area: s = (a + b + c) ÷ 2, A = √(s(s − a)(s − b)(s − c)), and the law of cosines gives each angle: cos A = (b² + c² − a²) ÷ 2bc. For sides 3, 4, 5: area 6, perimeter 12, angles 36.87°, 53.13° and 90°, a scalene right triangle.

Enter the three sides. The calculator returns area, perimeter, angles and the triangle type.

Related tools: Right Triangle Calculator: Solve a right triangle from its two legs: hypotenuse, angles, area and perimeter. Trigonometry Calculator: All six trigonometric functions of an angle. Law of Cosines Calculator: Third side of a triangle from two sides and the included angle (law of cosines).

How to use the Triangle Calculator

  1. Enter side a (above 0).
  2. Enter side b (above 0).
  3. Enter side c (above 0).
  4. Press Calculate to see the result, and use Reset to start again.
Inputs of the Triangle Calculator
InputWhat to enterAllowed values
Side aA number> 0
Side bA number> 0
Side cA number> 0

Formula and method

Formula

s = (a+b+c)/2; A = √(s(s−a)(s−b)(s−c)); cos A = (b²+c²−a²)/2bc

IEEE-754 double precision; shown to at most 6 decimal places.

Heron's formula for area and the law of cosines for angles; the triangle inequality is checked first.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Side a = 3; Side b = 4; Side c = 5.

Results of example 1
ResultValue
Area6
Perimeter12
Angle A36.869898°
Angle B53.130102°
Angle C90°
TypeScalene, right

Example 2

Inputs: Side a = 2; Side b = 2; Side c = 2.

Results of example 2
ResultValue
Area1.732051
Perimeter6
Angle A60°
Angle B60°
Angle C60°
TypeEquilateral, acute

Example 3

Inputs: Side a = 5; Side b = 5; Side c = 8.

Results of example 3
ResultValue
Area12
Perimeter18
Angle A36.869898°
Angle B36.869898°
Angle C106.260205°
TypeIsosceles, obtuse

The first line is the headline result (area). Below it the triangle Calculator lists perimeter, angle A, angle B, angle C and type, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Worked example

s = 6, so A = √(6 × 3 × 2 × 1) = √36 = 6. cos A = (16 + 25 − 9) ÷ 40 = 0.8, so A = 36.87°. Angle C is 90° because 3² + 4² = 5².

Valid triangles

Any two sides must add to more than the third (the triangle inequality). A degenerate triangle such as 1, 2, 3 is rejected. The type is scalene, isosceles or equilateral, and right, acute or obtuse by angle.

How the result changes with side a

Holding every other input at the first worked example, this table changes only side a. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with side a
Side aAreaPerimeterAngle A
1.52.48039210.514.361512°
361236.869898°
69.9215671582.819244°

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Side c: entering "3" shows "These sides cannot form a triangle: the two shorter sides must add up to more than the longest." beside that field and no result.

Choosing between the Triangle Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Triangle Calculator and similar calculators
CalculatorYou enterIt returns
[Right Triangle Calculator](/math/right-triangle-calculator/)leg a and leg bHypotenuse c
[Trigonometry Calculator](/math/trigonometry-calculator/)angle and unitsin
[Law of Cosines Calculator](/math/law-of-cosines-calculator/)side b, side c and included angle ASide a
[Pythagorean Theorem Calculator](/math/pythagorean-theorem-calculator/)find, leg a and other sideHypotenuse c
[45-45-90 Triangle Calculator](/math/45-45-90-triangle-calculator/)leg lengthLeg

Background: geometry measurements

Geometry results carry units that depend on the quantity: a perimeter or length is in linear units such as cm, an area or surface area is in square units (cm²) and a volume is in cubic units (cm³). Use one length unit for every input, because the calculator multiplies the numbers as given.

Flat (2D) shapes have an area and a perimeter; solids (3D) have a surface area and a volume. Two familiar checks: a circle of radius r has area πr² and circumference 2πr, and a sphere has volume (4/3)πr³ and surface area 4πr².

Assumptions and limitations

  • Degenerate triangles (a + b = c) are rejected
  • Right-triangle detection uses a 1e-9 relative tolerance

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for side c to confirm this.

Frequently asked questions

What is Heron's formula?

A formula for the area from the three sides alone.

Can I enter angles instead?

This page takes three sides.

What are the median and inradius?

Additional measures of a triangle that this page does not compute.

What does the Triangle Calculator calculate?

Area, perimeter, angles and type of a triangle from its three sides. It returns Area, Perimeter, Angle A, Angle B and Angle C.

What formula does the Triangle Calculator use?

s = (a+b+c)/2; A = √(s(s−a)(s−b)(s−c)); cos A = (b²+c²−a²)/2bc. Heron's formula for area and the law of cosines for angles; the triangle inequality is checked first.

What do I need to enter in the triangle Calculator?

You enter Side a, Side b and Side c.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Degenerate triangles (a + b = c) are rejected.

What are the limits of this calculator?

Degenerate triangles (a + b = c) are rejected. Right-triangle detection uses a 1e-9 relative tolerance.

What is an example of a triangle result?

With side a 3, side b 4 and side c 5, the area is 6.

Sources

  • Standard Euclidean geometry formulas (e.g. NIST Digital Library of Mathematical Functions §4, CRC Standard Mathematical Tables)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.