Right Triangle Calculator
Solve right triangles — find sides, angles, area, and perimeter.
Related calculators
About
Right Triangle Calculator
Give the calculator any two values and it works out the rest of the right triangle: the third side, both acute angles in degrees, degrees-minutes-seconds and radians, the altitude, the area, the perimeter, and the radii of the inscribed and circumscribed circles. The drawing above redraws itself from your numbers, so a 3-4-5 triangle looks nothing like a 2-6.7-7 one.
What a right triangle is
A right triangle has one angle of exactly 90°. The side opposite that angle is the hypotenuse, always the longest of the three, labelled c here. The two shorter sides are the legs, a and b. The acute angles are written with the Greek letters α opposite side a and β opposite side b, and since the three angles total 180°, the two acute ones always add to 90°: they are complementary, so fixing one fixes the other.
The letter h is the altitude, the perpendicular distance from the right-angle vertex to the hypotenuse. It divides the triangle into two smaller triangles, and both are similar to the original and to each other.
Right triangles carry more weight than their simplicity suggests. Trigonometry is built on them, since sine, cosine and tangent are defined as ratios of their sides, and any triangle at all can be split into two right triangles by dropping an altitude.
The Pythagorean theorem
The relationship between the three sides is the one piece of mathematics almost everyone remembers:
Square the two legs, add them, and the total is the square of the hypotenuse. With a = 3 and c = 5, b comes out as √(25 − 9) = √16 = 4. Rearranged, a leg is √(c² − a²), which is why the calculator refuses a hypotenuse shorter than the leg you gave it: the square root would be of a negative number and no such triangle exists.
When all three sides are whole numbers the set is a Pythagorean triple, and the triangle is a Pythagorean triangle. The familiar ones are 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is another triple, so 6-8-10 works as well, and triples that share no common factor are called primitive. Euclid's formula generates every primitive triple from two coprime whole numbers m > n of opposite parity:
These were known long before Pythagoras. Plimpton 322, a Babylonian clay tablet from around 1800 BC, lists numbers that amount to a table of Pythagorean triples, roughly twelve centuries before the theorem acquired its name.
Sides to angles
Once two sides are known the angles follow from the trigonometric ratios, usually memorised as SOH-CAH-TOA:
For a = 3 and c = 5, sin α = 0.6, so α = arcsin(0.6) = 36.87°, and β is whatever is left of 90°, which is 53.13°. Working from the two legs, tan α = a/b is the one to use, since it avoids computing the hypotenuse first.
Angles here are shown three ways. The decimal degree is the usual form. The degrees-minutes-seconds form splits the fraction into sixtieths and then sixtieths again, so 36.87° is 36°52'12", which is what surveying and navigation use. The radian is the angle subtending an arc equal to the radius, making a full turn 2π, and it is the unit calculus requires. Switch the dropdown to radians and you can type values such as pi/3 or pi/4 directly.
The altitude and similar triangles
Dropping the altitude from the right angle onto the hypotenuse splits it into two segments, p and q. The altitude is the geometric mean of those two segments:
It is also easy to reach from the area, since the triangle can be measured two ways, giving h = ab/c. On the 3-4-5 triangle that is 12/5 = 2.4. The similarity of the three triangles is the reason the trigonometric ratios work at all: shape is set by the angles alone, so the ratios of sides do not care about size.
Area, perimeter and the two circles
The legs of a right triangle are already perpendicular, so they serve as base and height directly and no extra step is needed:
The perimeter is simply a + b + c. Two further measurements come almost free. The inradius is the radius of the largest circle that fits inside, and the circumradius is the radius of the circle through all three corners:
The circumradius result is Thales' theorem read backwards: the hypotenuse of a right triangle is a diameter of its circumscribed circle, so R is half of c and the circle's centre sits at the midpoint of the hypotenuse. For the 3-4-5 triangle, r = (3 + 4 − 5)/2 = 1 and R = 2.5.
Special right triangles
Two shapes turn up often enough that their ratios are worth knowing by heart, because one side gives you the other two with no trigonometry at all.
The 30-60-90 triangle has sides in the ratio 1 : √3 : 2, shortest side opposite the 30° angle.
If the side opposite the 60° angle is 5, then that side is the √3 part of the ratio, so:
Half an equilateral triangle is exactly this shape, which is where the ratio comes from, and it is the triangle behind the exact values of the trigonometric functions at multiples of π/6.
The 45-45-90 triangle, also called the isosceles right triangle, has two equal legs and sides in the ratio 1 : 1 : √2.
Given a hypotenuse of 5:
This is half a square cut along its diagonal, and it gives the exact values at multiples of π/4. The √2 in it is the same irrational number that reportedly unsettled the Pythagoreans, since the diagonal of a unit square cannot be written as a fraction.
Which two values are enough
Almost any two of the eight quantities will do: the three sides, the two acute angles, the altitude, the area and the perimeter. Two sides, or a side with an angle, are the straightforward cases. The calculator also handles the awkward ones, such as area with perimeter or hypotenuse with altitude, which need a quadratic rather than a rearrangement.
One pair never works: two angles. Knowing α fixes β automatically, so a second angle adds nothing and the triangle can be any size at all. Give the calculator an angle plus a length, an area or a perimeter instead.
Where this gets used
Builders square a corner with the 3-4-5 method: measure 3 units along one wall, 4 along the other, and adjust until the diagonal reads exactly 5. Any multiple works, and longer ones are more accurate over a large footing.
Roof pitch is a right triangle written as a ratio, so a 6:12 pitch rises 6 inches over 12 of run, an angle of arctan(6/12) = 26.57°. Ramp gradients work the same way: the maximum slope allowed under the Americans with Disabilities Act is 1:12, which is arctan(1/12) = 4.76°. Add navigation, surveying, and the whole of vector decomposition in physics, where a force at an angle is split into perpendicular components using exactly these ratios.
Reading your result
Check which side you called the hypotenuse. It is always c and always the longest, so if the calculator says a needs to be smaller than c, the two lengths have been entered the wrong way round.
Look for the exact form where one is shown. The calculator prints the surd alongside the decimal when the answer has one, so a = 2 with c = 7 gives b = 6.7082 = 3√5. The surd is the exact value and the decimal is rounded, which matters if the figure feeds into more arithmetic.
For anything that is not right-angled, use the Triangle Calculator, which handles the general case through the law of sines and the law of cosines.
Common questions
Frequently asked questions
Use the Pythagorean theorem, a squared plus b squared equals c squared. For the hypotenuse take the square root of the sum of the squared legs. For a leg, subtract instead: b equals the square root of c squared minus a squared. With a = 3 and c = 5, b is the square root of 16, which is 4.
Almost any two: two sides, a side and an angle, or a side with the area, perimeter or altitude. The one pair that never works is two angles, because the acute angles always add to 90 degrees, so the second tells you nothing new and the triangle could be any size.
It is the perpendicular distance from the right-angle vertex to the hypotenuse, and it equals a times b divided by c. On a 3-4-5 triangle that is 12 divided by 5, or 2.4. It splits the triangle into two smaller ones, both similar to the original.
A set of three whole numbers that fit the Pythagorean theorem, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is another triple, so 6-8-10 also works. Euclid's formula generates every primitive triple from two coprime numbers of opposite parity.
Two shapes whose side ratios are fixed, so one side gives the others without trigonometry. A 30-60-90 has sides in the ratio 1 to root 3 to 2, and a 45-45-90 has 1 to 1 to root 2. They are half an equilateral triangle and half a square respectively.
Keep the whole degrees, multiply the decimal part by 60 for the minutes, then multiply what is left by 60 again for the seconds. So 36.87 degrees is 36 degrees, 52 minutes and 12 seconds. The calculator prints all three forms alongside radians.
The inradius is the radius of the largest circle that fits inside the triangle, equal to (a + b - c) divided by 2. The circumradius is the radius of the circle through all three corners, and for a right triangle it is simply half the hypotenuse, because the hypotenuse is a diameter of that circle.
Because that is the exact value and the decimal is rounded. Where the answer is a surd the calculator simplifies it, so the square root of 45 is shown as 3 root 5. Use the exact form if the number is going into further calculation.