Rafter Length Calculator

Find a rafter length from the rise, the run or the roof pitch.

Counts and prices the trusses too, with or without installation, in metric and imperial units.

Updated November 11, 2026
Frank Zhao - Creator
CreatorFrank Zhao
Loading calculator…

Introduction

A rafter is the sloping member that carries a roof from the ridge down to the wall plate. Its length is rarely written on a drawing, because it is not a dimension anyone sets out: it follows from how high the roof climbs and how far it runs, and from nothing else until you start adding an overhang. This page solves that length, and it also counts and prices the trusses for the same roof.

The two views on the calculator answer two different questions. The rafter view takes either the rise and the run or the roof pitch and the run, and fills in the third number; it works in both directions, so a rafter you have already measured can be typed in and the run or the rise solved from it. The truss view takes the roof length along the eave and the distance between the frames, returns a whole number of trusses, and turns that count into a bill — with or without the crew on it.

Rafter length

  • You know: the run plus either the rise or the pitch.
  • You get: the sloping length between the two plumb cuts, and the same slope in degrees, percent or rise per 12.
  • Useful when you are marking out a board or checking a measurement against the drawing.

Truss count and cost

  • You know: the roof length along the eave and the on-center spacing.
  • You get: a whole number of trusses, the price of the order, and the installed total when you add a crew rate and a duration.
  • Useful when you are ordering frames or comparing two quotes on the same roof.

What it will not do is size the member. The depth, grade and species of rafter that can span a given run is a structural question answered by span tables and your local building code, not by the triangle. Treat this page as the length and the money, and take the size question to a qualified designer.

Quick start

One pass through the calculator, using a rafter that is easy to check by hand and the same roof priced as trusses.

1

Pick the half you need

Leave the first choice on rafter length if you are marking a board, or switch it to truss count if you are ordering frames. The form below changes with the choice: numbers both views can use are kept, and the ones only the view you are leaving needs are cleared.

2

In the rafter view, say which two numbers you have

Choose roof rise if you know how high the roof climbs, or roof pitch if you know the angle or the slope. The run is always one of the two, and the run is half the width of the building, not the whole width.

3

Type the run and the second number

For a 6 m wide building the run is 3 m. With a rise of 1.5 m, the three boxes resolve as

LrafterL_{\mathrm{rafter}}==1.52+32\sqrt{1.5^{2} + 3^{2}}==11.25\sqrt{11.25}==3.3541 m3.3541\ \mathrm{m}

Read the same roof as a pitch and you get the same answer: a rise of 1.5 m over a 3 m run is a ratio of 0.5, which is 6:12, 50% or 26.5651 degrees, and the pitch view returns 3.3541 m again. Whichever view you use, the number in the rafter box is the length along the slope between the plumb cut at the ridge and the plumb cut at the wall. Two more lengths — the overhang and the notch — are added and removed later, on the board itself.

4

Switch to the truss view for a count

Type the roof length along the eave — 12 m here — and leave the spacing at its 60 cm default. The count is rounded up and includes a frame at each end of the run:

NN==⌈120.6⌉+1\left\lceil \frac{12}{0.6} \right\rceil + 1==20+120 + 1==2121

Twenty spacings take twenty-one frames, because a truss sits at both ends rather than only at the end of the last spacing.

5

Price the order, then add the crew if you need to

At $45 per truss the material bill is 21×$45=$94521 \times \$45 = \$945. Choose Yes for installation costs and add a rate and a duration — $60 per hour over 8 hours — and the total becomes $1,425.

CC==21×$45+$60×821 \times \$45 + \$60 \times 8==$945+$480\$945 + \$480==$1,425\$1{,}425
6

Read the result, and know what it does not say

The rafter figure is the length the triangle gives for the numbers you typed — no allowance has been added and nothing has been held back for the saw. What it does not contain is the overhang past the wall, the material the notch takes out, or half the thickness of a ridge board. On the money side, the total contains the frames and, if you asked for it, the crew — it excludes delivery, sheathing, fixings and waste, because those are not inputs on this page.

How the numbers are worked out

Both halves of the page are short arithmetic on a right triangle plus one ceiling. The boxes you type into are the same boxes the results come out of, which is why every result can be typed back in.

Rafter from the rise and the run

The rafter is the hypotenuse of a triangle whose legs are the rise and the run. Squaring the two legs, adding them and taking the square root gives the length; each leg comes back by subtracting the square of the other leg from the square of the rafter and taking the root again.

Lrafter=r2+u2L_{\mathrm{rafter}} = \sqrt{r^{2} + u^{2}}
rr==Lrafter2−u2\sqrt{L_{\mathrm{rafter}}^{2} - u^{2}}\qquaduu==Lrafter2−r2\sqrt{L_{\mathrm{rafter}}^{2} - r^{2}}

A rafter shorter than its own run has no real rise behind it, so that combination is rejected rather than quietly turned into a negative number.

Rafter from the pitch

The pitch is the rise divided by the run, which is the tangent of the roof angle. Written as a ratio rather than an angle, it turns the hypotenuse into a single expression:

p=rup = \frac{r}{u}==tan⁡θ\tan\theta\qquadLrafterL_{\mathrm{rafter}}==u1+p2u\sqrt{1 + p^{2}}

On a 3 m run at 6:12, that is 3×1.253 \times \sqrt{1.25} = 3.3541 m — the same triangle as the rise version, arrived at from the other end. The rise is not asked for in this view because it follows from the run and the pitch.

Three ways of writing the same slope

The angle, the percentage and the rise per 12 are three readings of one tangent, so typing any one of them fills in the other two. A 6:12 roof is the ratio 0.5, which is 50% and also 26.5651 degrees.

p=tan⁡26.5651∘p = \tan 26.5651^{\circ}==0.50.5==50%50\%==6:126:12

Percent takes values past 100 for anything steeper than 45 degrees — a 12:12 roof is 100%, a 16:12 roof is 133.33% — and the rise per 12 keeps going the same way, so a pitch quoted by a roofer is always readable here.

Truss count

Divide the roof length by the on-center spacing, round that quotient up to a whole number, and add one frame for the far end of the run. The ceiling is why a roof that is not an exact multiple of the spacing still gets a whole frame at the end instead of a gap.

N=⌈Lroofs⌉+1N = \left\lceil \frac{L_{\mathrm{roof}}}{s} \right\rceil + 1

A 12 m run at 0.6 m spaces gives exactly 20 spaces and 21 frames; a 12.4 m run gives 20.67 spaces, which becomes 21 spaces and 22 frames. The spacing is measured from the middle of one truss to the middle of the next, not between the faces of the timber.

The bill

Without a crew the total is the frame count times the price of one frame. With a crew it is that material bill plus the rate per hour or per day times the duration in hours or days:

C=c NC = c\,N\qquadC=c N+k tC = c\,N + k\,t

The money and time boxes solve backwards too. Type a total you have already been quoted and the calculator works out the price per truss — or, with the crew included, the rate per hour or the duration that the quote implies. That is the fastest way to see what a lump-sum price is really charging you.

Mixing units

Lengths can be entered in meters, centimeters, millimeters, inches, feet or a feet-and-inches pair, and the run and the rise do not have to share a unit. Everything is reduced to a common scale before the triangle is solved, so a run in feet with a rise in inches is fine and the answer is not affected by which boxes you changed last.

From rafter length to a board

The rafter length is measured between two plumb cuts along the top edge of the board. A real board carries three more things the triangle knows nothing about, and getting the order of operations right is what turns the number into a marked piece of timber.

The overhang

The part of the rafter past the wall is measured horizontally on a plan but costs length along the slope. Divide the horizontal overhang by the cosine of the pitch angle to get the extra length: a 0.6 m overhang on a 26.5651° roof adds 0.6708 m of board, not 0.6 m.

0.6cos⁡26.5651∘\frac{0.6}{\cos 26.5651^{\circ}}==0.60.8944\frac{0.6}{0.8944}==0.6708 m0.6708\ \mathrm{m}

The notch and the ridge

The birdsmouth notch is cut out of the board where it lands on the wall plate: it shortens the seat, not the overall length, so it changes where you mark rather than how much timber you order. A thick ridge board works the other way — each rafter meets the side of the board rather than its center line, so the run loses half the ridge thickness and the rafter comes out slightly shorter than the triangle suggests.

The birdsmouth cut calculator takes the building width, the ridge thickness, the pitch, the seat cut and the overhang, and returns the run, the notch depths and the total rafter with the overhang already added — the natural next step once this page has given you the sloping length.

Ordering the boards

A rafter length is a per-piece number. Multiply by the pieces you need and you have a linear total, but suppliers quote timber by volume or by the piece, so the lumber calculator will take the rafter length, the board size and the count and turn them into a volume and an order price.

Two roofs, worked through

The quick start stayed in metric. These two cases show the other paths: an imperial pitch, and a quote that has to be read backwards.

Case 1: a 4:12 roof on a 12 ft span

A 12 ft span means a 6 ft run. Put 6 ft in the run and 4 in the rise-per-12 box, and the other two pitch boxes fill in at 18.4349 degrees and 33.3333%.

LrafterL_{\mathrm{rafter}}==6×1+(412)26 \times \sqrt{1 + \left(\frac{4}{12}\right)^{2}}==6×1.054096 \times 1.05409==6.32456 ft6.32456\ \mathrm{ft}

That is 6 ft 3.89 in, so a 6 ft 4 in board covers the sloping length with about a tenth of an inch to spare before any overhang or notch is taken into account. Whether a given size of rafter may carry that 12 ft span at 4:12 is a separate question, answered by a span table rather than by this length.

Case 2: reading a 1,500 quote backwards

Suppose the 12 m roof at $45 per truss has been quoted at $1,500 all-in, with the crew expected on site for 8 hours. Type 1,500 into the total, leave the price at 45 and the duration at 8, and the crew rate is solved:

kk==$1,500−21×$458\frac{\$1{,}500 - 21 \times \$45}{8}==$5558\frac{\$555}{8}==$69.38\$69.38

The quote is charging $69.38 per hour for labor rather than the $60 you had assumed. That comparison is the practical use of a bidirectional total: it tells you which line of a lump-sum price is carrying the margin, before you ask for a breakdown.

Inputs that go wrong

Nearly every wrong answer from this page comes from one of these inputs, not from the arithmetic.

Run, not span

The run is the distance from the outside of the wall to the line of the ridge, which is half the building width. Typing a 24 ft span as a 24 ft run doubles both the run and the rafter, and doubles the timber you order; the 30 m rafter ceiling is there for grosser slips than that, so it will not save you.

60 cm is not 24 in

A 24 in spacing is 609.6 mm, and a 60 cm spacing is 600 mm — close enough to look the same, far enough apart to change the count. On a 24 ft roof, 24 in on center gives 13 trusses while 60 cm gives 14.

Six in the percent box is 6%

The percentage box holds a percentage. Six in it means a 0.06 ratio, or 3.4336 degrees, which is a nearly flat roof. For a 6:12 roof, type 6 in the rise-per-12 box or 26.5651 in the angle box, or 50 in the percentage box.

The count already has both ends

A truss is counted at each end of the run, so the number already includes the two gable-end frames. Do not add one per end again — but do add your own allowance for damaged or miscut pieces, because the calculator has no waste input.

Trust the sanity limits

A single rafter over 30 m or a count over 500 trusses is almost always a unit mix-up rather than a very large building. The number stays on screen and turns red so you can see what it is claiming before you order anything.

Work from the same line

Measure the run to the same reference you expect the rafter to sit on — outside face of the wall and the ridge line — and remember that a dressed 2×10 is neither 2 in nor 10 in. The triangle uses the numbers you type, not the nominal sizes.

Questions

Q

How many trusses does a 24 ft roof need at 24 in on center?

Thirteen. Twenty-four feet is 288 inches, which is twelve 24 in spaces, and one frame goes at each end of those twelve spaces. If the same roof is set out at 60 cm instead, the count is fourteen, because 60 cm is slightly narrower than 24 in.

Q

Do the three pitch boxes ever disagree with each other?

Not once they hold the same roof — they are three readings of one tangent, so the percentage is always the tangent of the angle times 100 and the rise per 12 is the same tangent times 12. They can disagree with the roof if you type a value into the wrong box, which is why a 6% entry and a 6:12 entry look so different: 3.4336 degrees versus 26.5651 degrees.

Q

Can I use it for a hip roof, a valley or a gambrel roof?

The rafter view is a common rafter of a symmetrical gable: one straight run from the wall to the ridge. Hip and valley rafters lie on a different plane and have their own geometry, and a gambrel or mansard roof has two pitches per side, so each slope has to be worked out as its own triangle. The truss count is unaffected by any of this, because it only depends on the length along the eave.

How far to trust it

  • Geometry and cost, not structural design. The depth, grade and species of rafter that can safely span a given run is not computed here. Spacing and member size have to satisfy your local building code and the span tables for the lumber you buy, and a truss is an engineered product supplied to its own design. Have a qualified designer or engineer check the framing before you build.
  • One symmetrical gable. Hips, valleys, dormers, unequal pitches, curved roofs and single-pitch (shed) roofs need their own geometry. The rafter result is only exact for a straight run to a central ridge.
  • The count assumes an even layout. It takes the frames as evenly spaced from one end with a truss at both ends. Gable-end framing, a drop-in interior wall or a different spacing near a chimney can change the real number of members.
  • Prices are estimates. Truss prices differ by region, supplier and design, and the total leaves out delivery, lifting equipment, sheathing, fixings and waste unless you type those into the rate. Exchange rates are refreshed daily and move the displayed amounts, not the quantities.
  • An ideal triangle. The model ignores the thickness of the ridge board, the wall thickness and the saw kerf. A real roof loses a little length to the ridge and needs extra for the overhang, which is why the board is marked from those calculations rather than cut straight from the box.

None of that makes the result fuzzy: the rafter length is the answer the triangle gives for the numbers you type, and the truss count is the correct whole number for an even layout. The caveats are about everything the triangle does not model, and about questions of member size that belong to a structural check.

Rafter Length Calculator - Rise, Pitch, Truss Count and Cost