Quick Answer: In a right triangle the square of the hypotenuse equals the sum of the squares of the two legs, a² + b² = c². Legs of 3 and 4 give a hypotenuse of c = 5 cm, since 9 + 16 = 25.
What does this calculator do?
This Pythagorean theorem calculator solves a right triangle from any two things you know about it: both legs, a leg and the hypotenuse, or one side and one of the acute angles. It returns the missing sides, both acute angles, the area, the perimeter and the height from the right angle to the hypotenuse.
Two extra modes build the special right triangles, 45-45-90 and 30-60-90, from a single leg.
The naming is fixed throughout. The legs a and b are the two sides that meet at the right angle. The hypotenuse c is the side opposite the right angle and is always the longest. Angle A sits opposite leg a, angle B opposite leg b, and the two add up to 90 degrees.
Any length unit works, as long as every side you enter is in the same one. The working runs at 34-digit precision and the results are rounded to four decimal places for display.
Using the Pythagorean Theorem Calculator
- Choose what you know from the list. The first option, both legs, is the classic hypotenuse problem.
- Fill in the boxes that mode needs. Angle A must be above 0 and below 90 degrees, and a hypotenuse must be longer than the leg you pair it with.
- Pick your unit.
The headline shows the sides you did not enter. The cards show all three sides, the angles, the area, the perimeter and the height to the hypotenuse. The presets solve a 6 by 8 ft frame's diagonal brace, how high a 13 ft ladder reaches with its foot 5 ft out, a 45-45-90 triangle with legs of 10 and a 30-60-90 triangle with a short leg of 5.
How is this calculated?
- Two sides known. The Pythagorean theorem gives the third. With both legs, the hypotenuse is the square root of the sum of their squares. With a leg and the hypotenuse, the other leg is the square root of the difference.
c = √(a² + b²); b = √(c² − a²)
- One side and angle A known. The trigonometric ratios fill in the rest. From leg a: b = a ÷ tan A and c = a ÷ sin A. From leg b: a = b × tan A and c = b ÷ cos A. From the hypotenuse: a = c × sin A and b = c × cos A.
sin A = a/c; cos A = b/c; tan A = a/b
- Special triangles. A 45-45-90 triangle with leg x has sides x, x and x√2. A 30-60-90 triangle with short leg x has sides x, x√3 and 2x.
- Angles. Once both legs are known, angle A is the arctangent of a over b, converted from radians to degrees, and angle B is 90 minus A.
A = arctan a/b; B = 90^∘ − A
- Area, perimeter and altitude. The legs are a base and a height for each other, so the area is half their product. The perimeter adds all three sides. The altitude to the hypotenuse is twice the area divided by the hypotenuse.
Area = ab/2; h_c = ab/c
- Round for display to four decimal places, half up.
Worked Example
The default is legs of 3 cm and 4 cm.
- Hypotenuse: the square root of 3² + 4², which is the square root of 25, 5 cm.
- Angle A: the arctangent of 3/4, 36.8699°; angle B is 53.1301°.
- Area: 3 × 4 ÷ 2 = 6 cm². Perimeter 12 cm. Height from the right angle to the hypotenuse: 12 ÷ 5 = 2.4 cm.
A frame 6 ft by 8 ft needs a diagonal brace of 10 ft. That is the 3-4-5 triangle doubled, the carpenter's way of checking a corner is square.
A 13 ft ladder with its foot 5 ft from the wall is leg a = 5 and hypotenuse c = 13. It reaches 12 ft up the wall, and it leans at 67.3801° to the ground (angle B, between the ground and the ladder).
With a leg of 3 and angle A of 30 degrees, the other leg is 3 ÷ tan 30°, 5.1962, and the hypotenuse is 3 ÷ sin 30°, exactly 6.
How Do You Find the Hypotenuse?
Square both legs, add them, and take the square root. That is the formula for the hypotenuse, c = √(a² + b²). The most common mistake is adding the legs and then taking the root, or forgetting the root altogether.
The table below the calculator lists Pythagorean triples, sets of whole numbers such as 5, 12 and 13 or 8, 15 and 17 that satisfy the theorem exactly, which make handy checks.
How Do You Calculate the Angles of a Right Triangle?
One angle is 90 degrees by definition. For the other two, take the arctangent of the opposite leg over the adjacent leg, or use the sine (opposite over hypotenuse) or cosine (adjacent over hypotenuse) if those are the sides you have. The two acute angles always add up to 90, so finding one gives the other.
On a scientific calculator, make sure it is set to degrees before you take an inverse tangent.
What Are the Special Right Triangles?
Two right triangles have sides in fixed ratios that are worth remembering, because their angles turn up constantly.
- 45-45-90. The two legs are equal and the hypotenuse is a leg times the square root of 2. It is half of a square cut along its diagonal, which makes it the isosceles right triangle. A leg of 10 gives a hypotenuse of 14.1421.
- 30-60-90. The hypotenuse is twice the short leg, and the long leg is the short leg times the square root of 3. It is half of an equilateral triangle. A short leg of 5 gives a long leg of 8.6603 and a hypotenuse of 10.
The second table below the calculator lists both for legs from 1 to 12.
What does this calculator not account for?
- Triangles without a right angle. The Pythagorean theorem only holds for right triangles. For any other triangle use the triangle calculator, which works from the law of cosines.
- Angles in radians. Angle A is entered in degrees.
- Unit conversion. All sides must be in one unit; nothing is converted.
- Exact surds. The answers are decimals. The calculator does not write results such as 5√3 in radical form, though the special-triangle tables show the decimal values of those ratios.
- Measured right angles. A corner that is not quite square makes the real diagonal differ from the computed one. That difference is exactly what a 3-4-5 check is used to catch.
What mistakes do people make with this?
- Treating the hypotenuse as a leg. The hypotenuse is opposite the right angle. If you put the longest side in as a leg, the theorem gives an even longer "hypotenuse" that does not exist.
- Subtracting the wrong way. For a missing leg, subtract the leg's square from the hypotenuse's square, not the other way round. The calculator refuses a hypotenuse that is not longer than the leg.
- Mixing up opposite and adjacent. Angle A here is opposite leg a. If your angle sits next to the side you know, it is angle B; enter 90 minus it as A, or swap which leg you call a.
- Calculator in radians. Taking sin 30 in radian mode gives a negative number and a nonsense triangle.
- Rounding the legs before squaring. The error grows when squared. Keep full precision until the end.
Frequently Asked Questions
What is the Pythagorean theorem?
How do I find a missing leg?
Is an isosceles triangle a right triangle?
What is a slope triangle?
How can I check that a corner is square?
Does the theorem work in three dimensions?
Sources
- Euclid's Elements, Book I, Proposition 47, ed. D. E. Joyce, Clark University: the Pythagorean theorem and its proof. mathcs.clarku.edu/~djoyce/elements/bookI/propI47.html
- OpenStax, Algebra and Trigonometry 2e, §7.2 Right Triangle Trigonometry (sine, cosine, tangent; the 30-60-90 and 45-45-90 triangles). openstax.org/books/algebra-and-trigonometry-2e/pages/7-2-right-triangle-trigonometry
- NIST Digital Library of Mathematical Functions, §4.14 Definitions and Periodicity of the trigonometric functions. dlmf.nist.gov/4.14
- OpenStax, Contemporary Mathematics, §10.3 Triangles (hypotenuse and legs). openstax.org/books/contemporary-mathematics/pages/10-3-triangles

