Right triangle calculator

Fill in any two boxes; the tool solves the rest.

ft
ft
ft
°
5′ (5 ft) C

Keep these results

We send this one email through our mail provider and don't keep your address.

These figures are the exact geometry of the two values you enter. They assume a true right angle at the corner between the legs; if the real corner is out of square the triangle the tool solves is not the one on the ground. Confirm your measurements before relying on a length or an angle from here.

Type any two of the two legs, the hypotenuse and the angle. As soon as two boxes hold a valid number the tool solves the triangle and shows the other two. Change your mind by clearing a box and filling a different one — it always works from the latest two.

Worked example

Enter leg A = 3 and leg B = 4. The hypotenuse is √(3² + 4²) = √25 = 5, and the angle opposite A is arctan(3 ÷ 4) ≈ 36.87°. Clear leg B, type the hypotenuse 5 instead, and leg B comes back as 4 — the same triangle from a different pair. The numbers do not care which unit: 3 ft and 4 ft give 5 ft, 3 m and 4 m give 5 m.

On the job

Squaring a deck frame. 12 ft × 16 ft: the diagonal is √(144 + 256) = 20 ft on the nose (a 3.6 × 4.8 m frame: 6 m). Pull both diagonals; when they both read 20 the frame is square, and if one reads 20′ ½″ and the other 19′ 11½″ you rack it toward the short one. Any rectangle works this way — the tool gives the diagonal for whatever two sides you have.

A knee brace. Brace from 3 ft down the post to 3 ft out along the beam: hypotenuse 3 × 1.414 = 4.24 ft, 45° cut on both ends (900 mm each way is 1,273 mm). Make it 3 ft down and 4 ft out instead and it is 5 ft with a 36.9° cut at the beam and 53.1° at the post — type either pair and read the angle off the result.

A ramp. The drawing gives a 30 in rise at the slope it specifies — say 1 in 12. Run is 30 × 12 = 360 in, and the ramp surface is √(30² + 360²) = 361.2 in, barely longer than the run (in metric, a 760 mm rise at 1 in 12 is a 9,120 mm run and a 9,152 mm surface). On shallow slopes the hypotenuse is nearly the run; on a 45 it is 41% longer. The slope itself comes off the plans, not this page.

Try one

Diagonal

A 12 ft × 16 ft frame. What should the diagonal read, in feet?

ft

Stuck? A nudge

Square both sides, add, then root.

Missing leg

A 24 ft ladder with its feet 6 ft out from the wall. How high up the wall does it reach, in feet?

ft

Stuck? A nudge

When you know the hypotenuse, the leg is a subtraction under the root.

Quick referencefor right angles

Hypotenuse
√(a² + b²) · a leg from the hypotenuse: √(c² − b²)
Whole-number triangles
3-4-5 · 5-12-13 · 8-15-17 · 7-24-25 — and every multiple of them
45°
hypotenuse = leg × 1.414
30-60-90
hypotenuse = short leg × 2 · long leg = short leg × 1.732
Angle
arctan(opposite ÷ adjacent) · 1:12 = 4.8° · 1:4 = 14° · 1:1 = 45°
Diagonal of a rectangle
both the same when it is square · 12 × 16 ft = 20 ft · 3.6 × 4.8 m = 6 m

Mistakes to catchbefore you trust the number

  • Typing the wrong two: leg A is opposite the angle, leg B is beside it — swap them and the angle you get is the other one (their sum is 90°).
  • Using a length in feet for one leg and inches for the other; the tool has no way to know, and a 12 ft × 16 in triangle is nonsense.
  • Reading the hypotenuse as the length to cut on a brace without adding for the cuts at each end.

The formula

c = √(a² + b²)  ·  angle = arctan(a ÷ b)  ·  a = c · sin(angle)

Two legs give the hypotenuse by Pythagoras and the angle by the arctangent of their ratio. A side and an angle turn it around: the sine, cosine and tangent of the angle relate each leg to the hypotenuse, so any one side unlocks the other two.

Questions

How do I solve a right triangle?
Give any two of its parts — the two legs, a leg and the hypotenuse, or a side and an angle — and the rest follow from Pythagoras and basic trig. This tool takes exactly two of leg A, leg B, hypotenuse C and the angle, and fills in the other two as you type.
Which angle does the calculator use?
The angle opposite leg A — the one whose tangent is A over B. So if you enter leg A and that angle, leg B is A divided by the tangent, and the hypotenuse is A divided by the sine. Keep the angle strictly between 0 and 90 degrees; a right triangle cannot have another right or obtuse angle.
Why does it need exactly two values?
One value is not enough to fix the shape, and three risk contradicting each other — an A, B and C that are not a true Pythagorean set have no real triangle. Entering precisely two leaves a single consistent answer, so the tool waits until two fields are filled and clears if you give it more.
Can I use it for rafters, stringers or bracing?
Yes — any time you know two parts of a right-angled layout and want the third. A rafter run and rise give the rafter length; a stair rise and run give the stringer; a brace angle and reach give its length. It is the plain geometry under a lot of the trade tools here.

Related tools

Spot something wrong on this page? Report it

We’ll include this page and the numbers you entered. We read every report but can’t reply.

Thanks — your report was sent.

That didn’t send. Please try again later.