ThisCalculator

Math

Calculate Hypotenuse of a Triangle Calculator

Updated · Standard formula, shown below

Hypotenuse 5.00 m
Side a
3 m
You entered
Side b
4 m
You entered

Calculate Hypotenuse of a Triangle Calculator

This calculator works out the hypotenuse of a right-angled triangle using the Pythagorean theorem. You enter the lengths of the two shorter sides (a and b), and it returns the exact length of the longest side (c) in the same unit you used. It also shows the result rounded to a chosen number of decimal places, so you can use it for geometry homework, construction layouts, or any quick right-triangle measurement.

Formula

The calculator uses the Pythagorean theorem, which states that in a right-angled triangle the square of the hypotenuse equals the sum of the squares of the other two sides:

c = √(a² + b²)

Where:

  • c – hypotenuse, the side opposite the right angle and the longest side of the triangle (unit: same as a and b, e.g., meters, feet, inches).
  • a – one leg (short side) adjacent to the right angle (unit: any length).
  • b – the other leg (short side) adjacent to the right angle (unit: same as a).

The theorem only applies to right-angled triangles (one angle is exactly 90°). If the triangle is not right-angled, you would need the law of cosines instead.

Worked Example

Using the default values from the calculator: side a = 3 m, side b = 4 m.

  1. Square side a: 3² = 9
  2. Square side b: 4² = 16
  3. Add the squares: 9 + 16 = 25
  4. Take the square root: √25 = 5

The hypotenuse is 5 m. The calculator shows 5.00 when rounded to two decimals. This is the classic 3-4-5 triangle, often used in construction to check right angles because the numbers are whole.

When to Use This Calculator

Use it any time you need the longest side of a right triangle given the two legs. Common situations include:

  • Finding the length of a ladder needed to reach a certain height on a wall (wall height = a, distance from wall = b).
  • Determining the diagonal of a rectangle or square (length and width are the legs).
  • Calculating the distance between two points on a coordinate plane when you know the horizontal and vertical differences.
  • Checking if a corner is square: measure 3 units along one side, 4 along the other, and the diagonal should be 5.

You can also work backwards: if you know the hypotenuse and one leg, subtract the square of the known leg from the square of the hypotenuse and take the square root to find the missing leg.

How to Read the Result

The result is always in the same unit you entered. If you mix units (e.g., a in meters and b in feet), the formula will give a meaningless number. Always convert both legs to the same unit first. For example, if one side is 2 feet and the other is 12 inches, convert the inches to feet (1 ft) before calculating.

The calculator rounds to two decimal places by default. For most practical purposes, two decimals are enough. If you need more precision for engineering or surveying, increase the decimal places in the output (the calculator allows up to 6). Remember that rounding early can introduce small errors; it is better to keep full precision during intermediate steps and round only the final answer.

Common Mistakes and Misconceptions

  • Using the wrong sides: The hypotenuse is always opposite the right angle. If you accidentally enter the hypotenuse as one of the legs, you will get a result that is too small or an error if the hypotenuse is shorter than a leg.
  • Forgetting to square before adding: Some people add a and b first then square. That is wrong. You must square each leg separately, add, then take the square root.
  • Applying to non-right triangles: The Pythagorean theorem only works for right triangles. For an acute or obtuse triangle, you need the law of cosines: c² = a² + b² − 2ab·cos(C).
  • Unit errors: Mixing inches and feet, or meters and centimeters, without converting leads to incorrect results. Always convert to one unit.

Limitations of the Formula

The Pythagorean theorem assumes a perfectly flat, Euclidean plane. In real-world applications on a curved surface (like the Earth’s surface), the formula is only an approximation for small distances. For large distances on a sphere, you would need spherical trigonometry. Also, the theorem only gives the length; it does not give angles. To find the angles, you would use trigonometric functions like sine, cosine, or tangent.

Another limitation: the inputs must be positive numbers. A side length cannot be negative or zero. The calculator enforces a minimum of 0 for each leg, so entering a negative number will result in an error or an invalid answer.

Frequently Asked Questions

Can I use this calculator for any triangle?

No, only for right-angled triangles. If you have an angle between two sides that is not 90°, you need the law of cosines. For example, if you know two sides and the included angle, use c² = a² + b² − 2ab·cos(θ).

What if I only know the hypotenuse and one leg?

You can still find the missing leg by rearranging the formula: a = √(c² − b²). Just enter the known leg as one input and the hypotenuse as the other, but be careful: the calculator expects both inputs to be legs. Instead, you can do the calculation manually: square the hypotenuse, subtract the square of the known leg, then take the square root.

How do I find the hypotenuse if I know the area and one leg?

From the area (A = ½·a·b) you can solve for the unknown leg: b = 2A / a. Then use the Pythagorean theorem to get the hypotenuse. For example, if area = 6 m² and a = 3 m, then b = 2·6 / 3 = 4 m, and c = √(3² + 4²) = 5 m.

Why is the hypotenuse always the longest side?

Because it is opposite the largest angle (the 90° angle) in the triangle. In any triangle, the longest side is opposite the largest angle. Since 90° is the largest angle in a right triangle, the hypotenuse is always the longest side.

Can the hypotenuse be a whole number?

Yes, when the legs are Pythagorean triples, like 3 and 4 giving 5, or 5 and 12 giving 13. But most pairs of legs produce an irrational hypotenuse (like √2 for legs 1 and 1). The calculator gives a decimal approximation.

What is the 3-4-5 rule?

It is a practical application of the Pythagorean theorem used by builders and DIYers to check if a corner is a perfect right angle. Measure 3 units along one side, 4 units along the other, and the diagonal between those two points should be 5 units. If it is, the corner is square.

Related

Formula used
in a | Side a | m | 3 | 0
in b | Side b | m | 4 | 0
out c | Hypotenuse | m | sqrt(a^2 + b^2) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.