Triangle Calculator

Enter three side lengths to calculate the area, perimeter, all interior angles, and triangle classification. Uses Heron's formula for area and the law of cosines for angle determination.

Report a Bug

Understanding Triangle Types: Sides and Angles

Triangles get sorted into categories two different ways, and each system tells you something useful about the shape you're working with. The side-based system is pretty straightforward. If all three sides match, you've got an equilateral triangle — every angle is exactly 60 degrees, and the whole shape has threefold rotational symmetry. If exactly two sides are the same length, that's an isosceles triangle. The two angles opposite those matching sides are also equal, which is a property that Euclid proved in the Elements and which ancient Greek students found so tricky they called it the "bridge of asses." When all three sides are different, you have a scalene triangle with no matching angles and no lines of symmetry.

The angle-based system looks at what's happening inside the triangle. A right triangle contains one 90-degree angle, and the side across from it (the hypotenuse) is always the longest. An acute triangle has every angle less than 90 degrees. An obtuse triangle has one angle that exceeds 90 degrees, making it look squished or stretched compared to the others.

Here's something that catches people off guard: these two classification systems are independent. You can absolutely have a right isosceles triangle — that's the classic 45-45-90 shape that shows up in woodworking squares and drafting tools. An obtuse isosceles triangle looks like a flattened arrowhead. The only pairing that's impossible is equilateral combined with right or obtuse, because having all sides equal forces all angles to be 60 degrees. This calculator identifies both the side type and the angle type for whatever measurements you enter, so you'll always get the full picture.

The Story Behind Heron's Formula

Heron of Alexandria lived around the first century AD, and he was one of those rare figures who blended theoretical math with hands-on engineering. The man built what amounted to a coin-operated vending machine, designed an early steam-powered device called the aeolipile, and wrote about everything from surveying techniques to the construction of war machines. His formula for triangle area appeared in a treatise called Metrica, which scholars thought was lost for centuries until a complete manuscript turned up in Istanbul in 1896.

What makes the formula so elegant is its simplicity for practical work. Land surveyors in the ancient world could measure three boundary lengths with ropes and stakes far more easily than they could construct a perpendicular height, which is what the base-times-height formula requires. Heron's approach lets you skip that perpendicular entirely — three measured sides go in, and the area comes out.

There's a decent argument that the formula is actually older than Heron himself. Archimedes, who predated Heron by about three centuries, may have known it based on fragments of his work on solid geometry. But attribution aside, the formula's lasting appeal comes from its versatility. It works for any triangle, no matter how obtuse or how close to degenerate (a flat line). It also connects beautifully to other mathematics — it turns out to be a special case of Brahmagupta's formula for the area of a cyclic quadrilateral, which you can verify by setting one side to zero. You can derive it from the cross product of two side vectors, from the law of cosines, or from a determinant formula used in distance geometry. For a result that looks so simple on the surface, it has remarkably deep roots.

The Law of Cosines and Finding Every Angle

Once you've got all three side lengths, the law of cosines gives you a clean path to every interior angle. The formula says c² = a² + b² − 2ab·cos(C), where C is the angle sitting opposite side c. Flip that around to solve for the angle and you get cos(C) = (a² + b² − c²) / (2ab). Plug in the numbers, hit the inverse cosine button, and you've got your angle in degrees.

If this reminds you of the Pythagorean theorem, that's no accident. When angle C happens to be exactly 90 degrees, cos(C) equals zero, and the formula collapses to c² = a² + b². The law of cosines is literally a generalization of Pythagoras, extended to handle triangles where no angle is a right angle.

Let's trace through the classic 3-4-5 triangle to see it work. For the angle opposite side a (which is 3): cos(A) = (16 + 25 − 9) / (2 × 4 × 5) = 32/40 = 0.8. Take the arccosine and you get about 36.87 degrees. For the angle opposite side b (which is 4): cos(B) = (9 + 25 − 16) / (2 × 3 × 5) = 18/30 = 0.6, giving about 53.13 degrees. The third angle is 180 minus those two, which works out to exactly 90 degrees. No surprise — 3-4-5 is the most famous right triangle there is.

This calculator applies the law of cosines three times to get all the angles, then checks the largest one: if it's 90 degrees (within rounding tolerance), the triangle is classified as right. Greater than 90 means obtuse. Less than 90 across the board means acute. That angle check, combined with the side comparison, gives you the complete classification.

Pythagorean Theorem and Its Surprising Reach

The Pythagorean theorem — a² + b² = c² for right triangles — is probably the most recognizable formula in all of geometry. Pythagoras gets the credit in Western tradition, but Babylonian mathematicians were working with it at least a thousand years before he was born. A clay tablet known as Plimpton 322, dated to roughly 1800 BC, lists Pythagorean triples with enough sophistication to suggest the scribes had a systematic method for generating them, not just a list they'd stumbled upon.

Pythagorean triples are sets of whole numbers that satisfy the theorem: (3, 4, 5) is the smallest, followed by (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any multiple of a triple works too — (6, 8, 10), (9, 12, 15), (15, 20, 25), and so on, infinitely. There's actually a formula that generates every primitive triple (ones where the three numbers share no common factor): pick two positive integers m and n where m is bigger, they have opposite parity, and they share no factors. Then a = m² − n², b = 2mn, c = m² + n². With m=2 and n=1, you get the 3-4-5 triple.

But the theorem's influence extends far beyond triangles. It defines distance in Euclidean space — the distance formula you learn in algebra class is just the Pythagorean theorem applied to a coordinate grid. It's embedded in every GPS calculation, every video game physics engine, and every architectural blueprint that uses diagonal measurements. The trigonometric identity sin²(θ) + cos²(θ) = 1 is the Pythagorean theorem restated for the unit circle. Even Einstein's special relativity uses a modified version of the theorem when computing spacetime intervals. When you plug three sides into this calculator and it identifies a right triangle, you're witnessing a mathematical relationship that humans have been using for nearly four thousand years.

Heron's Formula

A = √[s(s−a)(s−b)(s−c)] where s = (a+b+c)/2

Heron's formula calculates the area of a triangle when all three side lengths are known. The variable s is the semi-perimeter, equal to half the sum of the three sides. You then multiply s by (s minus each side), take the product of those four terms, and compute the square root. For a 3-4-5 triangle, s = (3+4+5)/2 = 6. The area is √(6×3×2×1) = √36 = 6 square units. This formula works for any valid triangle regardless of its shape or angle measures. The angles are then found using the law of cosines: cos(A) = (b² + c² − a²) / (2bc), and similarly for angles B and C.

Where:

  • s = Semi-perimeter: half the sum of all three sides
  • a, b, c = The three side lengths of the triangle
  • A = The area of the triangle in square units

Example Calculations

Classic 3-4-5 Right Triangle

The most well-known Pythagorean triple, forming a right triangle.

The semi-perimeter is s = (3 + 4 + 5) / 2 = 6. Applying Heron's formula: A = √(6 × 3 × 2 × 1) = √36 = 6 square units. The perimeter is simply 3 + 4 + 5 = 12. Using the law of cosines, the angles are 36.87° opposite the side of length 3, 53.13° opposite 4, and exactly 90° opposite the hypotenuse of length 5. Since all three sides differ and one angle is 90°, the classification is Scalene Right.

Equilateral Triangle with Side 10

A regular triangle where all sides and angles are equal.

With s = 30/2 = 15, Heron's formula gives A = √(15 × 5 × 5 × 5) = √1875 ≈ 43.3013 square units. All sides are equal, making it equilateral. The law of cosines yields cos(A) = (100 + 100 − 100) / (2 × 10 × 10) = 0.5, so each angle is arccos(0.5) = 60°. All angles are below 90°, confirming it is also acute.

Frequently Asked Questions

The triangle inequality states that the sum of any two sides must be greater than the third side. This must hold for all three combinations: a + b > c, a + c > b, and b + c > a. If any combination fails, the three lengths cannot form a closed triangle. For example, sides 1, 2, and 5 violate the inequality because 1 + 2 = 3, which is less than 5. This calculator checks the triangle inequality before computing results and displays an error if the entered sides cannot form a valid triangle.

The standard triangle area formula is base times height divided by two, which requires knowing the perpendicular height. Heron's formula avoids this by using only the three side lengths. It works because the three sides fully determine a triangle's shape and size up to reflection and rotation. Algebraically, Heron's formula can be derived by expressing the height in terms of the sides using the Pythagorean theorem and substituting back into the base-times-height formula. The result simplifies into the elegant square root expression involving the semi-perimeter.

Yes, the calculator accepts side lengths from 0.001 up to 999,999. The computations use standard floating-point arithmetic, which provides about 15 significant digits of precision. For extremely large triangles (sides in the hundreds of thousands) or extremely thin triangles (where two sides nearly equal the third), minor rounding may appear in the last decimal place, but results remain accurate for all practical purposes.

If you see an error message, your side lengths violate the triangle inequality. The most common cause is one side being longer than the sum of the other two. Check that a + b > c, a + c > b, and b + c > a all hold. Another common mistake is accidentally entering zero or a negative number for a side length. All three sides must be positive numbers for a triangle to exist.

The calculator is unit-agnostic. Whatever unit you use for the side lengths, the perimeter will be in that same unit and the area will be in that unit squared. If you enter sides in centimeters, the area is in square centimeters. If you enter sides in feet, the area is in square feet. Angles are always displayed in degrees. Just make sure all three sides use the same unit of measurement.

Related Calculators