Triangle Calculator
Solve a right triangle, or any triangle from three known sides.
Right Triangle Mode
Enter any two of the three sides (the two legs, or one leg and the hypotenuse), and the calculator finds the third side using the Pythagorean theorem, plus both non-right angles and the area. The two acute angles in a right triangle always sum to exactly 90°, since the total of all three angles in any triangle is 180° and one of them is already fixed at 90°.
Common Mistakes When Solving Triangles
A frequent mistake in right triangle problems is confusing which side is the hypotenuse, the hypotenuse is always the side directly opposite the right angle and is always the longest of the three sides, entering it into a "leg" field instead produces an invalid or misleading result. Another common mistake in SSS mode is entering side lengths that don't actually correspond to a real triangle, either through a measurement error or simple typo, which the triangle inequality check catches and flags rather than silently producing a nonsensical angle. A third mistake, particularly when solving by hand, is a sign or arrangement error in the Law of Cosines formula, since it's easy to mix up which side corresponds to which angle when rearranging the equation to solve for a specific unknown.
Three Sides (SSS) Mode
Given all three side lengths of any triangle, this mode finds all three angles using the Law of Cosines, and the area using Heron's formula, no need for the triangle to have a right angle.
Worked Examples
For a right triangle with legs 3 and 4, the Pythagorean theorem gives a hypotenuse of √(3² + 4²) = √(9 + 16) = √25 = 5, the classic 3-4-5 triangle. Angle A (opposite the leg of length 3) is found as arcsin(3/5) ≈ 36.87°, and angle B is the remaining 90 − 36.87 = 53.13°. The area is ½ × 3 × 4 = 6. For an SSS triangle with sides 5, 6, and 7, the Law of Cosines gives angle A ≈ 44.415°, angle B ≈ 57.122°, and angle C, the remaining angle, ≈ 78.463° (all three angles sum to 180°, as they must for any triangle). Using Heron's formula, the semi-perimeter s = (5+6+7)/2 = 9, and the area is √(9 × (9−5) × (9−6) × (9−7)) = √(9 × 4 × 3 × 2) = √216 ≈ 14.697, with a perimeter of 5 + 6 + 7 = 18.
Perimeter and Area: Two Different Kinds of Output
This calculator reports both linear measurements (the sides and, in SSS mode, the perimeter) and an area measurement, and it's worth keeping their units distinct when working with real measurements. If side lengths are entered in meters, the perimeter result is also in meters (a simple sum of three linear measurements), while the area result is in square meters, since area inherently combines two dimensions. This distinction matters for anyone using triangle calculations for real material or space planning, ordering enough fencing for a triangular plot depends on the perimeter figure, while ordering enough flooring, turf, or paint depends on the area figure, and mixing the two up leads to ordering the wrong quantity of material entirely.
The Pythagorean Theorem and Right Triangles
The Pythagorean theorem, a² + b² = c², describes a fixed relationship that holds for every right triangle: the sum of the squares of the two legs always equals the square of the hypotenuse (the side opposite the right angle, always the longest side). This relationship, attributed to the ancient Greek mathematician Pythagoras though known to earlier civilizations including the Babylonians, is one of the most fundamental results in geometry, and it's what allows this calculator's right triangle mode to solve for any missing side given the other two. Certain whole-number combinations that satisfy the theorem exactly, like 3-4-5 or 5-12-13, are called Pythagorean triples, useful reference triangles since all three sides come out as clean whole numbers rather than irrational decimals.
Why the Law of Cosines Generalizes the Pythagorean Theorem
The Law of Cosines, c² = a² + b² − 2ab·cos(C), reduces to the familiar Pythagorean theorem in the special case where angle C is exactly 90°, since cos(90°) equals 0, making the entire −2ab·cos(C) term disappear and leaving c² = a² + b². This is why the Law of Cosines is described as a generalization: it works for any triangle, right-angled or not, and the Pythagorean theorem is simply the specific case that applies when one angle happens to be a right angle. This is also why SSS mode can solve any valid triangle regardless of shape, while right triangle mode is a simpler, faster special case that only applies when a 90° angle is already known to exist.
The Triangle Inequality: Why Not Every Three Lengths Work
Not every combination of three positive numbers can form a real triangle, they need to satisfy the triangle inequality: the sum of any two sides must be strictly greater than the third side. Intuitively, if two sides are too short relative to the third, they simply can't stretch far enough to meet and close the triangle, imagine two short sticks trying to span the distance between the endpoints of a much longer third stick, at some point they physically can't reach. This is why SSS mode checks all three pairwise sum conditions before attempting to calculate angles, and displays an error rather than a nonsensical result when the entered lengths violate this basic geometric requirement.
Real-World Applications of Triangle Solving
Right triangle and general triangle solving show up constantly in practical measurement and design problems. Construction and carpentry use the 3-4-5 rule (and its multiples) to check that a corner is a true right angle without specialized tools, simply measuring 3 units along one wall and 4 along the perpendicular wall, then confirming the diagonal measures exactly 5 units. Surveying and navigation use triangulation, calculating unknown distances from known angles and a baseline distance, which relies on the same trigonometric relationships this calculator implements. Engineering and architecture use triangle calculations constantly for structural load analysis, roof pitch calculations, and truss design, since triangles are the only polygon shape that's inherently rigid, a property that makes them fundamental to structural design. Even everyday tasks like figuring out how long a ladder needs to be to safely reach a certain height at a safe base distance are direct right-triangle problems solvable with the same Pythagorean relationship covered here.
Frequently Asked Questions
Why does SSS mode sometimes show an error?
Three side lengths only form a valid triangle if the sum of any two sides is greater than the third (the triangle inequality). If your numbers don't satisfy this, no triangle can exist with those measurements.
Are the angles in degrees or radians?
All angles are shown in degrees, the more commonly used unit for this kind of geometry problem.
What is the Law of Cosines and why does SSS mode need it?
The Law of Cosines is a generalization of the Pythagorean theorem that works for any triangle, not just right triangles: c² = a² + b² − 2ab·cos(C). Rearranged to solve for an angle given three known sides, it lets the calculator find every angle of a triangle from just its three side lengths, without needing to know any angle in advance, which is exactly the SSS (side-side-side) scenario this mode is built for.
What is Heron's formula and why is it used for area in SSS mode?
Heron's formula calculates a triangle's area directly from its three side lengths, without needing to know any angle or height: Area = √(s(s−a)(s−b)(s−c)), where s is the semi-perimeter (half the sum of all three sides). It's used in SSS mode specifically because the standard ½ × base × height area formula requires knowing a height, which isn't directly given when only the three side lengths are known.
Why does right triangle mode only need two sides while SSS mode needs three?
A right triangle already has one angle fixed at exactly 90°, so the Pythagorean theorem only needs two of the three sides to solve for the third and derive the remaining angles. A general triangle, without a known right angle, has three independent degrees of freedom (loosely, its size and shape), which is why three side lengths are needed to fully determine it, two sides alone wouldn't be enough to pin down a unique triangle shape without also knowing an angle.
Can this calculator solve a triangle from angles instead of sides?
Not directly. Both modes here start from known side lengths, right triangle mode from two sides, SSS mode from three. Solving a triangle from a mix of known angles and sides (like ASA or SAS scenarios) uses related trigonometric methods, primarily the Law of Sines, which this specific calculator doesn't implement.