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
- Enter side a (above 0).
- Enter side b (above 0).
- Enter side c (above 0).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Side a | A number | > 0 |
| Side b | A number | > 0 |
| Side c | A 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.
| Result | Value |
|---|---|
| Area | 6 |
| Perimeter | 12 |
| Angle A | 36.869898° |
| Angle B | 53.130102° |
| Angle C | 90° |
| Type | Scalene, right |
Example 2
Inputs: Side a = 2; Side b = 2; Side c = 2.
| Result | Value |
|---|---|
| Area | 1.732051 |
| Perimeter | 6 |
| Angle A | 60° |
| Angle B | 60° |
| Angle C | 60° |
| Type | Equilateral, acute |
Example 3
Inputs: Side a = 5; Side b = 5; Side c = 8.
| Result | Value |
|---|---|
| Area | 12 |
| Perimeter | 18 |
| Angle A | 36.869898° |
| Angle B | 36.869898° |
| Angle C | 106.260205° |
| Type | Isosceles, 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.
| Side a | Area | Perimeter | Angle A |
|---|---|---|---|
| 1.5 | 2.480392 | 10.5 | 14.361512° |
| 3 | 6 | 12 | 36.869898° |
| 6 | 9.921567 | 15 | 82.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.
| Calculator | You enter | It returns |
|---|---|---|
| [Right Triangle Calculator](/math/right-triangle-calculator/) | leg a and leg b | Hypotenuse c |
| [Trigonometry Calculator](/math/trigonometry-calculator/) | angle and unit | sin |
| [Law of Cosines Calculator](/math/law-of-cosines-calculator/) | side b, side c and included angle A | Side a |
| [Pythagorean Theorem Calculator](/math/pythagorean-theorem-calculator/) | find, leg a and other side | Hypotenuse c |
| [45-45-90 Triangle Calculator](/math/45-45-90-triangle-calculator/) | leg length | Leg |
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.
Related calculators
- 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).
- Pythagorean Theorem Calculator — Find the hypotenuse or a missing leg of a right triangle.
- 45-45-90 Triangle Calculator — Sides of a 45°-45°-90° triangle from one leg.
- 30-60-90 Triangle Calculator — Sides of a 30°-60°-90° triangle from the short leg.
- Triangle Area Calculator — Area of a triangle from base and height.
- SAS Triangle Calculator — Solve a triangle from two sides and the included angle.
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.