About this tool
The Right Triangle Calculator solves any right triangle using the Pythagorean theorem. Enter two sides to find the missing side, all angles (via inverse trig), area, and perimeter.
About the Pythagorean theorem
The Pythagorean theorem is the most cited relationship in elementary geometry. It states that in any right-angled triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. While the theorem is named after the Greek mathematician Pythagoras of Samos (around 570 to 495 BCE), Babylonian clay tablet Plimpton 322 (around 1800 BCE) already lists Pythagorean triples, and the Indian text Baudhayana Sulba Sutra (around 800 BCE) records the equivalent statement and proof. The relationship underpins distance computation, vector magnitude, building construction, navigation, and the entire field of Euclidean trigonometry.
The calculator solves a right triangle from any two known quantities: two legs (SSS), a leg and the hypotenuse (LH), or a leg and the opposite acute angle (LA). It returns the missing side, both acute angles, the area, and the perimeter.
How the formulas work
Pythagoras: c^2 = a^2 + b^2 -> c = sqrt(a^2 + b^2) Solve leg: a = sqrt(c^2 - b^2) (c must be greater than b) Sine: sin(A) = opposite / hypotenuse = a / c Cosine: cos(A) = adjacent / hypotenuse = b / c Tangent: tan(A) = opposite / adjacent = a / b Area: A = (a x b) / 2 Perimeter: P = a + b + c Angle sum: A + B = 90 deg (the third angle is the 90)
- Legs: the two sides that meet at the right angle (a and b). Either can be horizontal or vertical depending on orientation.
- Hypotenuse: the side opposite the right angle. Always the longest side, always c.
- Acute angles: A is opposite leg a; B is opposite leg b. Both are strictly less than 90 degrees.
- Right angle: the third angle, always exactly 90 degrees in a right triangle.
Worked example: the 3-4-5 triangle
- Inputs: a = 3, b = 4. Both legs known.
- Hypotenuse: c = sqrt(3^2 + 4^2) = sqrt(9 + 16) = sqrt(25) = 5.
- Angle A: arctan(3 / 4) = 36.87 degrees.
- Angle B: arctan(4 / 3) = 53.13 degrees. Check: A + B = 90.
- Area: (3 x 4) / 2 = 6 square units.
- Perimeter: 3 + 4 + 5 = 12 units.
Pythagorean triples reference
| a | b | c | Notes |
|---|---|---|---|
| 3 | 4 | 5 | Primitive, smallest, carpenter's triangle |
| 5 | 12 | 13 | Primitive, common in vector problems |
| 8 | 15 | 17 | Primitive, A approximately 28 deg |
| 7 | 24 | 25 | Primitive, very narrow triangle |
| 20 | 21 | 29 | Primitive, near isosceles |
| 6 | 8 | 10 | Scaled 3-4-5 (multiple of 2) |
| 9 | 12 | 15 | Scaled 3-4-5 (multiple of 3) |
| 1 | 1 | sqrt(2) | 45-45-90 isosceles right triangle |
| 1 | sqrt(3) | 2 | 30-60-90 special triangle |
Common pitfalls
- Confusing which side is the hypotenuse. The hypotenuse is always opposite the right angle. If you solve for c using a^2 + b^2 = c^2 but a value is actually the hypotenuse, you get a negative under the square root.
- Applying Pythagoras to a non-right triangle. The theorem requires exactly one 90-degree angle. For a scalene, acute, or obtuse triangle use the law of cosines: c^2 = a^2 + b^2 - 2ab cos(C).
- Forgetting unit consistency. If a is in metres and b is in centimetres, you cannot square and add them. Convert to a single unit first.
- Rounding too early. Compute c in full precision, then round only the final answer. Rounding intermediate sqrt values cascades into 2 to 5 percent angle error.
- Mixing degrees and radians. JavaScript trig functions return radians. The calculator converts to degrees for display. If you copy a 0.785 value thinking it is degrees, it is actually 45 degrees (in radians).
- Inverse-sine domain error. arcsin only accepts inputs in [-1, 1]. If you pass a / c where a happens to exceed c (because of bad input), the calculator returns NaN; check that the hypotenuse is the largest side.
Related calculators on 3Tej
Solve more geometric problems with these companion tools:
Frequently asked questions
What is the Pythagorean theorem and when does it apply?
In any right-angled triangle, a^2 + b^2 = c^2 where a and b are the two legs that meet at the 90 degree angle and c is the hypotenuse (the side opposite the right angle, always the longest). To find a missing side: c = sqrt(a^2 + b^2), or a = sqrt(c^2 - b^2). The theorem only applies when one angle is exactly 90 degrees. For non-right triangles use the law of cosines: c^2 = a^2 + b^2 - 2ab cos(C).
How do you find the angles of a right triangle from two sides?
Use the inverse trigonometric functions. Angle A (opposite side a) = arcsin(a / c) = arctan(a / b). Angle B = arcsin(b / c) = arctan(b / a). The third angle is always 90 degrees by definition, so A + B = 90 always. In a 3-4-5 triangle (a=3, b=4, c=5), angle A = arctan(3/4) = 36.87 degrees and angle B = 53.13 degrees.
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a^2 + b^2 = c^2 exactly. The smallest is (3, 4, 5). Other primitive triples include (5, 12, 13), (8, 15, 17), (7, 24, 25), and (20, 21, 29). Every primitive triple can be generated by Euclid's formula a = m^2 - n^2, b = 2mn, c = m^2 + n^2 for coprime m greater than n with one even. Construction trades use these for square framing without a protractor.
How is the area and perimeter of a right triangle calculated?
Area equals one half of the product of the two legs: A = (a x b) / 2. For a 3-4-5 triangle that gives (3 x 4) / 2 = 6 square units. Perimeter is the sum of all three sides: P = a + b + c. The 3-4-5 triangle has perimeter 12. Note that area does not use the hypotenuse directly because the two legs already serve as base and height (they are perpendicular).
Why does the calculator return a degree value rather than radians?
The calculator converts the radian output of JavaScript Math.asin and Math.atan to degrees via the factor 180 / pi, because most school-level and construction-trade users think in degrees. To convert back, multiply degrees by pi / 180. The calculator displays two decimal places for angles, which is roughly 0.01 degree precision (well below the accuracy of typical hand measurement).
Last updated 2026-05-28.
