Right Triangle Calculator (Rise, Run & Diagonal)

</> Embed this calculator on your site

This right triangle calculator finds the missing side, both angles, pitch, slope and area from any two known values. Enter rise, run, diagonal or an angle, and it works out the rest for squaring layouts, stair stringers, ramps and roof framing.

Estimates only. By using this calculator you agree to our Terms.

Geometry only (Pythagorean theorem and trigonometry). Local codes vary; results are not engineering, permit or inspection approval.

</> Embed this calculator on your site

Free for any website, blog, classroom or intranet. No sign-up, no ads inside the embed. Copy the code and paste it into your page.

Preview the embed

How to Use This Right Triangle Calculator

Choose the two measurements you already know from the "I know these two values" menu: rise and run, rise and diagonal, run and diagonal, or one leg plus an angle. Pick a unit, type your numbers and press Calculate (or hit Enter). You get the missing side, both acute angles, pitch as rise per 12 of run, slope percent, area, perimeter and a diagonal cut length rounded up to the next 1/16 inch. The diagram redraws to match your triangle, and a table shows the same run at common roof pitches.

Why This Matters

Almost every layout job in carpentry, concrete and landscaping hides a right triangle. The classic case is squaring a deck or slab form: if a 12 ft by 16 ft rectangle has two diagonals that both measure 20 ft, the corners are square. If one reads 20 ft 1 in and the other 19 ft 11 in, the frame is racked, and the decking, siding or slab edge will show it for years.

Stair builders use the same math. A flight rising 108 in over a 144 in run has a 180 in stringer diagonal, which is 15 ft of lumber before waste. Roofers convert between pitch and angle all day: an 8:12 roof is a 33.7° slope, and a 12 ft run needs 8 ft of rise. Ramp designers check that a 30 in rise over 360 in of run gives a 1:12 slope, about 8.3%. Fence installers, surveyors and anyone bracing a wall or gate rely on a quick diagonal check too. Knowing the diagonal before you cut saves lumber, trips to the yard and rework.

How It's Calculated

In a right triangle the rise and run are the two legs, and the diagonal is the hypotenuse opposite the 90° corner. Angle A sits where the run meets the diagonal, so it measures the slope from horizontal. The calculator uses these relationships:

diagonal² = rise² + run² Angle A = arctan(rise ÷ run) rise = run × tan(A)  |  diagonal = run ÷ cos(A)  |  run = rise ÷ tan(A)

When you enter a diagonal and one leg, the missing leg is the square root of the diagonal squared minus the known leg squared. Angle B at the top is always 90° − A. Pitch is rise ÷ run × 12, slope percent is rise ÷ run × 100, area is rise × run ÷ 2, and perimeter is the sum of all three sides.

For safe cutting, the diagonal cut length is always rounded up: to the next 1/16 in for inches and feet, to the next whole millimeter, 0.1 cm, or 0.001 m for metric. That leaves the piece slightly long so you can trim to fit. Every other value is rounded normally for display only.

Worked Example

Say you are bracing a gate frame with a rise of 6 ft and a run of 8 ft, entered in feet.

  • Diagonal: 6² + 8² = 36 + 64 = 100, and √100 = 10.000 ft. The cut length shows as 10'.
  • Angle A: arctan(6 ÷ 8) = arctan(0.75) = 36.87°. Angle B is 90° − 36.87° = 53.13°.
  • Pitch: 6 ÷ 8 × 12 = 9.00 : 12.
  • Slope: 6 ÷ 8 × 100 = 75.00%.
  • Area: 6 × 8 ÷ 2 = 24 ft². Perimeter: 6 + 8 + 10 = 24 ft.

This is the familiar 3-4-5 triangle scaled by 2, which is why the diagonal comes out to a whole number.

Tips & Common Mistakes

  • Use one unit for everything. Mixing feet for the run and inches for the rise is the most common source of wrong answers. Convert first, then enter both values in the same unit.
  • Measure the angle from the right place. Angle A here is measured from the horizontal run, not from the vertical rise. A 30° roof angle is not the same as a 60° angle from the wall.
  • A diagonal must be the longest side. If you enter a diagonal shorter than the rise or run, no triangle exists, and the calculator will flag it. Re-measure before trusting any layout.
  • Allow for kerf and connections. The cut length is a theoretical long-point-to-long-point length. Brace ends, plumb cuts and hardware change the real piece length, so mark and test-fit.
  • Check codes separately. This tool does not apply building code limits. For stairs, the IRC (R311.7) generally caps riser height at 7¾ in and sets a minimum tread of 10 in, but local amendments vary. Confirm with your inspector and have structural members designed by a qualified professional.

Frequently Asked Questions

How do I find the diagonal of a right triangle with rise and run?

Square the rise, square the run, add them and take the square root. For a 3 ft rise and 4 ft run, 9 + 16 = 25, so the diagonal is 5 ft. This calculator does it instantly and also gives a rounded-up cut length.

How do I square a deck or foundation with a diagonal measurement?

Measure both diagonals corner to corner. If the rectangle is square, they will be equal and match the Pythagorean result. For a 12 ft by 16 ft frame, enter rise 12 and run 16 to get a 20 ft target, then adjust the frame until both diagonals match.

What is the difference between rise, run and diagonal?

Rise is the vertical distance, run is the horizontal distance and the diagonal is the sloped straight line joining their ends. On stairs the diagonal is the stringer length, and on a roof it is the rafter length measured along the slope.

How do I convert pitch like 6:12 to degrees?

Take arctan of the pitch divided by 12. For 6:12, arctan(0.5) is 26.57°. To go the other way, enter your run and angle in this calculator, and the pitch appears in the results as rise per 12 of run.

Can I use this right triangle calculator for metric measurements?

Yes. Select millimeters, centimeters or meters and every result uses that unit. The math is identical in any unit as long as rise and run share the same one, and the cut length is rounded up to a practical metric step.

Why does it say my diagonal must be longer than the rise or run?

The hypotenuse is always the longest side of a right triangle. If your diagonal is equal to or shorter than a leg, the numbers cannot form a triangle, so check for a typo or a measurement taken between the wrong points.

Related Tools