Right Triangle Calculator

Give us any two facts about your right triangle (two sides, or one side and one acute angle) and we solve everything else: all three sides, both acute angles, area, perimeter, and the altitude to the hypotenuse, with every step shown.

Fill in exactly two fields (at least one must be a side) and leave the rest blank. Angle A sits opposite leg a, angle B opposite leg b, and c is the hypotenuse.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Right Triangle Calculator.

How the right triangle calculator works

Here is the promise of the 3-4-5 triangle, and of every right triangle: give us any two facts and we hand you the whole thing. Two legs? We find the hypotenuse, both angles, the area, the perimeter, and the altitude. One side and one angle? Same deal. The right angle is doing you an enormous favor: it locks one of the three angles at 90 degrees, so two independent pieces of information pin down everything else. The only combination that fails is two angles with no side, because angles alone fix the shape but not the size.

The calculator uses exactly the tools you would use by hand (the Pythagorean theorem when you know two sides, trig ratios when you know an angle) and shows every substitution step so you can follow, or check homework, line by line. For triangles without a right angle, head to the general triangle calculator.

The Pythagorean theorem

a² + b² = c²

a and b are the two legs (the sides that meet at the right angle) and c is the hypotenuse, the longest side, sitting opposite the right angle. Rearranged, c = √(a² + b²) when you know both legs, and a missing leg is a = √(c² - b²). That subtraction is the version people forget: the hypotenuse is always the biggest side, so when it is known, you subtract squares instead of adding them. If your "leg" comes out imaginary, you accidentally entered a leg longer than the hypotenuse.

The theorem is also the engine behind the distance formula: the distance between two points is just the hypotenuse of the right triangle their coordinates draw, which is the same idea a slope calculation exploits with its rise and run.

SOH-CAH-TOA, explained like a person

Forget reciting the acronym for a second. Stand at one of the acute angles and look across the triangle. The side straight across from you is the opposite side. The side you are touching (that is not the hypotenuse) is the adjacent side. The hypotenuse is the hypotenuse no matter where you stand.

The three trig ratios are just three ways of comparing those sides. Sine is opposite over hypotenuse: it answers "how tall is this triangle compared to its longest side?" Cosine is adjacent over hypotenuse. Tangent is opposite over adjacent, the ratio of the two legs, which is why tangent is also the slope of a ramp at that angle. In practice you pick the ratio that uses the side you know and the side you want. Know the adjacent leg, want the opposite one? That pair belongs to tangent, so opposite = adjacent × tan(angle). Know the hypotenuse, want the opposite leg? Sine: opposite = hypotenuse × sin(angle). The calculator picks the right ratio for you and shows which one it used.

The two special right triangles

Two right triangles are so tidy they get their own names, and memorizing them saves real time.

The 45-45-90 triangle is half a square, cut along the diagonal. Its sides run in the ratio 1 : 1 : √2, so the hypotenuse is about 1.414 times either leg. A square room 10 feet on a side has a 14.14 foot diagonal, no calculator required. (Fun fact: that diagonal is also the diameter of the circle through all four corners, which the circle calculator can take from there.)

The 30-60-90 triangle is half an equilateral triangle. Its sides run 1 : √3 : 2. The short leg (opposite the 30 degree angle) is exactly half the hypotenuse, and the long leg is about 1.732 times the short one. If a problem hands you either of these angle sets, you can write down all three sides from a single one, which is exactly what this calculator does when you enter, say, one leg and 30 degrees.

Worked example

Take the classic legs a = 3 and b = 4:

c = √(3² + 4²) = √(9 + 16) = √25 = 5

Angle A = arcsin(3 ÷ 5) = 36.87°, and angle B = 90 - 36.87 = 53.13°.

Area = (3 × 4) ÷ 2 = 6, perimeter = 3 + 4 + 5 = 12, and the altitude to the hypotenuse is (3 × 4) ÷ 5 = 2.4.

The mistake that flips your answer

Mislabeling opposite and adjacent. The labels are relative to the angle you are standing at, so the side that is "opposite" from angle A is "adjacent" to angle B. Swap them and you silently compute the wrong leg: tan(30°) × 8 gives 4.62 while 8 ÷ tan(30°) gives 13.86, and both look plausible on paper. The sanity check takes five seconds: the biggest side must face the biggest angle. The hypotenuse faces the 90, the longer leg faces the larger acute angle, and the shorter leg faces the smaller one. If your solved triangle breaks that ordering, a label got swapped. This is also why the calculator names its angles: A is always opposite leg a, B always opposite leg b.

Frequently asked questions

What is the Pythagorean theorem?

In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². So if the legs are 3 and 4, the hypotenuse is the square root of 9 + 16 = 25, which is 5. It only works when the triangle has a 90 degree angle.

How do I find the hypotenuse of a right triangle?

Square each leg, add the results, and take the square root: c = √(a² + b²). With legs 6 and 8, that is √(36 + 64) = √100 = 10. If you have one leg and one angle instead, use trig: c = a ÷ sin(A), where A is the angle opposite leg a.

Can I solve a right triangle with just one side?

No. One side alone leaves infinitely many possible triangles. You need two independent facts, and at least one of them must be a side length. Two angles alone will not do it either: they fix the shape but not the size, since every right triangle with those angles is just a scaled copy.

How do I find the angles of a right triangle from the sides?

Use inverse trig. If a is the leg opposite angle A and c is the hypotenuse, then A = arcsin(a ÷ c). With legs 3 and 4 and hypotenuse 5, A = arcsin(3 ÷ 5) = 36.87 degrees, and the other acute angle is 90 - 36.87 = 53.13 degrees, because the two acute angles always add to 90.

What is a 3-4-5 triangle?

It is the most famous right triangle: legs of 3 and 4 with a hypotenuse of 5, since 9 + 16 = 25. Any scaled copy works too (6-8-10, 9-12-15, 30-40-50). Builders still use it to check corners: measure 3 feet along one wall and 4 along the other, and the diagonal is exactly 5 feet only if the corner is square.

What is the altitude to the hypotenuse?

It is the perpendicular distance from the right angle down to the hypotenuse, and it has a beautifully simple formula: h = (a × b) ÷ c, the product of the legs divided by the hypotenuse. For a 3-4-5 triangle, h = 12 ÷ 5 = 2.4. It also splits the triangle into two smaller triangles similar to the original.

What are the ratios for 45-45-90 and 30-60-90 triangles?

A 45-45-90 triangle has sides in the ratio 1 : 1 : √2, so the hypotenuse is about 1.414 times a leg. A 30-60-90 triangle has sides in the ratio 1 : √3 : 2, so if the short leg is 1, the long leg is about 1.732 and the hypotenuse is exactly 2. These are the only two right triangles with all-nice angles, which is why they show up on every test.

Related calculators