Skip to the calculator
Rule Calculator

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.

runrisediagonal
What to measure
Diagonal
14' 5 1/16"
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

Ask about this in the chat

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. 1.Measure the two sides that meet at the right angle — the run and the rise.
  2. 2.Square each, add them, and take the square root. That is the diagonal.
  3. 3.To square a rectangular layout, compare the two measured diagonals: equal means square.
  4. 4.For a rafter, subtract half the ridge thickness and add the overhang before cutting.

The formula

  1. Diagonalsqrt(pow(144, 2) + pow(96, 2))
  2. Angle from horizontalatan(96 / 144) * 180 / pi
  3. 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

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>
Did this answer your question?