Diagonal & Rafter Length Calculator
With run (horizontal) 144.00000000000003 inch, rise (vertical) 96.00000000000001 inch, diagonal & rafter length comes to 14' 5 1/16" — diagonal. It is reached in 3 steps, the last of which is sqrt(pow(144, 2) + pow(96, 2)), and each one is printed on the page with its numbers filled in. The formula is the one published by NIST Engineering Statistics Handbook, not an approximation fitted to it.
Hypotenuse of a right triangle in feet and inches — brace lengths, rafter runs, and squaring a layout.
Formula and sources checked · How we check
Run (horizontal) 12', Rise (vertical) 8'
14' 5 1/16"
Diagonal for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.
It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.
- Diagonal
sqrt(pow(144, 2) + pow(96, 2))173.066 in- Angle from horizontal
atan(96 / 144) * 180 / pi33.69 °- Roof pitch (rise per 12 of run)
96 / 144 * 128 /12
Worked example
A 12 ft run with an 8 ft rise gives a 14' 5 1/16" diagonal at 33.7°, an 8/12 pitch. Add rafter tail and ridge allowance separately — this is the theoretical line length, not the cut length.
How to work it out yourself
- 1.Measure the two sides that meet at the right angle — the run and the rise.
- 2.Square each, add them, and take the square root. That is the diagonal.
- 3.To square a rectangular layout, compare the two measured diagonals: equal means square.
- 4.For a rafter, subtract half the ridge thickness and add the overhang before cutting.
The formula
- Diagonal
sqrt(pow(144, 2) + pow(96, 2)) - Angle from horizontal
atan(96 / 144) * 180 / pi - Roof pitch (rise per 12 of run)
96 / 144 * 12
Source: NIST Engineering Statistics Handbook, Wolfram MathWorld — Pythagorean theorem
Questions people actually ask
- How do I use this to square a deck or foundation?
- Measure both diagonals of the rectangle. If they are equal, the corners are square. Enter the two sides here to get the diagonal they should measure — a 12 × 16 ft frame should read exactly 20 ft corner to corner.
- Is this the length of rafter to cut?
- No. It is the line length from the outer wall to the ridge centre. Subtract half the ridge board thickness and add the overhang before cutting; on a typical 1.5 in ridge that is 3/4 in off each rafter.
- What is the 3-4-5 rule?
- The smallest whole-number right triangle: sides of 3 and 4 give a diagonal of exactly 5. Any multiple works, so 6-8-10 or 9-12-15 lets you square a large layout with a tape and no calculation.
Related
- Square Footage CalculatorSquare footage of a room, wall, border, gable end, ring or triangle from feet-and-inches measurements, with a waste factor and the cost.
- Board Foot CalculatorConvert lumber dimensions to board feet and price out a cut list, including nominal-vs-actual sizing.
- Stair CalculatorRiser height, tread count, total run and stringer length from a total rise — checked against the code limits.
- Roofing CalculatorRoofing squares and shingle bundles from the building footprint and the roof pitch. Applies the pitch multiplier, so it is roof area, not footprint.
- Fraction to Decimal CalculatorConverts fractions to decimals and back, to the nearest 16th, 32nd and 64th, with the millimeter equivalent.
- Slope & Grade CalculatorGrade percentage, angle in degrees, ratio and roof pitch from a rise and a run.
Read first
- How to Read a Tape Measure — Why the marks are different lengths, and how to read a sixteenth without counting them: each halving is drawn one step shorter than the one above it.
- How to Use a Protractor — Lining up the vertex, choosing between the two scales — the one to read starts at zero on your baseline — and reading an angle past 180° without inverting it.
Put this calculator on your site
Free, no attribution required beyond the link.
<iframe src="https://rulecalculators.com/embed/diagonal-length" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Diagonal & Rafter Length Calculator"></iframe>