Every Single CalculatorOne place for every calculator
÷Everyday math

Right triangle calculator

Enter the two sides that meet at the square corner to find the long side and the angles.

Example: You need the length of a brace across a gate that is 4 feet wide and 3 feet tall.

Your numbers

Use any unit, as long as both sides are in the same one. The answers come back in that unit.

  • Long side0
  • Angle opposite side A0
  • Angle opposite side B0
  • Area0
  • Perimeter0

The formulas

Long side = √(A² + B²)

Angle = arctan(A ÷ B)

A worked example

Sides of 3 and 4 give a long side of exactly 5. The angles are 36.87 and 53.13 degrees. This is the 3-4-5 triangle builders use to check a square corner.

Where this turns up on site

  • A rafter is the long side of a triangle made by the rise and the run.
  • A stair stringer is the long side of the total rise and total run.
  • A brace across a gate or wall frame is the long side of its height and width.
  • The diagonal of any rectangle is the long side of its length and width. The diagonal calculator gives that in feet and inches.

Common questions

What other whole-number triangles are there?

5-12-13 and 8-15-17 work the same way as 3-4-5, and so does any multiple of them, such as 6-8-10.

How we know this calculator is right

Before this calculator went on the site, 9 answers were worked out separately from its code, by hand or straight from the formula above. Each time this page loads, your own browser runs the calculator on those same numbers and compares. Turn on JavaScript to see the comparison.

See every check
Numbers usedResultWorked out separatelyThis calculator

What this proves: the calculator does the arithmetic of the formula shown, correctly. What it cannot prove: your measurements, or figures such as coverage per bag, waste and spacing, which are typical starting values you can change. Go by the product label and your local code.

Used by: framers and carpenters, welders and fabricators, machinists, sheet metal workers, students.