Lelifi·tools

Rafter Length Calculator

A 24 ft building with a 6/12 pitch has a 12 ft run and 6 ft rise, so the rafter is 13.42 ft long. The pitch factor shortcut gives the same answer: 12 x 1.118 = 13.42 ft, or 13 ft 5 in before the overhang.

Enter the building span and roof pitch to get the common rafter length, with the run, rise and pitch factor worked out step by step.

By the Lelifi editors ·

Key takeaways

Common rafter length, 24 ft span at 6/12 pitch24 ft span / 2 = 12 ft run12 ft x 6/12 = 6 ft rise12 ft x 12 ft + 6 ft x 6 ft = 180 sq ft= square root of 180 = 13.42 ft rafter
From a 24 ft span at 6/12 pitch to a 13.42 ft common rafter, step by step.
The 13.42 ft rafter is the hypotenuse of a 12 by 6 triangle12 ft6 ftRun along the ceiling (12 ft)Rise up the roof (6 ft)
The rafter is the hypotenuse of the run and rise triangle: 12 ft flat, 6 ft up.
On this page
  1. Span, run and rise: the three words that drive the math
  2. What the pitch notation 6/12 means
  3. Worked example: a 24 ft building at 6/12
  4. Step by step with the pitch factor shortcut
  5. Common rafter lengths by span, quick table
  6. Spacing and count: how many rafters to buy
  7. Birdsmouth and seat cuts: where the math meets the wall
  8. Overhangs, fascia and buying the right boards

Span, run and rise: the three words that drive the math

Rafter math trips people because three words sound interchangeable and are not. The span is the full width of the building from outside wall to outside wall. The run is half the span, measured from the wall to the center of the ridge, and it is the number every rafter formula uses. The rise is how far the roof climbs vertically over that run.

A rafter is just the hypotenuse of a right triangle: the run is the flat leg, the rise is the vertical leg, and the rafter is the sloped one. So the whole calculation reduces to the Pythagorean theorem you met in school:

rafter length = square root of (run x run + rise x rise)

That is it. The only practical work is getting run and rise right. Run always comes from half the span, and rise comes from the roof pitch. If a building is 24 ft wide, the run is 12 ft, never 24 ft, and forgetting the division is the single most common way a first rafter comes out twice as long as the roof.

What the pitch notation 6/12 means

American roofs are called out in rise-per-run notation. A 6/12 pitch means the roof rises 6 in for every 12 in of horizontal run, and 12/12 means 12 in of rise over 12 in of run, a 45 degree roof. The second number is always the 12 in run reference, which is why framers call the scale a 12-based pitch square.

PitchRise per 12 in of runRoof anglePitch length factor
3/123 in14.0 degrees1.031
6/126 in26.6 degrees1.118
9/129 in36.9 degrees1.250
12/1212 in45.0 degrees1.414
18/1218 in56.3 degrees1.803

The pitch length factor in the last column is the shortcut most framers use on site. It is the length of rafter per foot of run, so once you know it, the square root disappears: rafter length = run x pitch factor. The American Wood Council's span and framing publications are the reference pros use once length is settled and the question becomes lumber size and spacing.

Worked example: a 24 ft building at 6/12

Take the most common small-building setup: a 24 ft wide structure with a 6/12 roof.

That 13.42 ft is 13 ft plus 0.42 x 12 = 5.0 in, so the cut list entry is 13 ft 5 in. Framers write it as 13-5-0 on the stick, where the last number is sixteenths of an inch.

Steepen the same building to 12/12 and the run stays 12 ft while the rise grows to 12 ft, giving a length of square root of 12 x 12 + 12 x 12 = square root of 288 = 16.97 ft, nearly 17 ft. Same footprint, over 3.5 ft more rafter per side, which is exactly why steep roofs cost more in lumber and labor even when the floor area is identical.

Step by step with the pitch factor shortcut

On a roof, nobody wants square roots. The pitch factor does the same job with one multiplication, and the calculator above shows it next to the length so you can check either way.

The two methods agree to the inch, and the factor approach scales better when you are laying out a whole roof, because you set the saw once and repeat. Tables of pitch factors are printed on the framing squares sold at any lumberyard, and the numbers here match the standard 12-based squares.

One caution: pitch factors assume the overhang is measured horizontally at the eave. If you measure along the slope from the wall instead, no factor is needed, just add the distance directly to the rafter length.

Common rafter lengths by span, quick table

For planning lumber orders, this table lists common rafter lengths at the three pitches people build most. Read it as wall to ridge, before any overhang.

Building spanRun4/12 pitch6/12 pitch12/12 pitch
16 ft8 ft8 x 1.054 = 8.43 ft8 x 1.118 = 8.94 ft8 x 1.414 = 11.31 ft
20 ft10 ft10 x 1.054 = 10.54 ft10 x 1.118 = 11.18 ft10 x 1.414 = 14.14 ft
24 ft12 ft12 x 1.054 = 12.65 ft12 x 1.118 = 13.42 ft12 x 1.414 = 16.97 ft
28 ft14 ft14 x 1.054 = 14.76 ft14 x 1.118 = 15.65 ft14 x 1.414 = 19.80 ft
32 ft16 ft16 x 1.054 = 16.86 ft16 x 1.118 = 17.89 ft16 x 1.414 = 22.63 ft

The table also shows the planning reality of spans past 24 ft: at a 12/12 pitch, a 32 ft building needs rafters pushing 23 ft, which crosses into engineered lumber or truss territory for most builders. Length is only half the check, though. Rafter depth and spacing must carry the roof load, so once the length is known, match it against span tables for your snow and wind zone rather than copying a neighbor's shed.

Spacing and count: how many rafters to buy

Length answers one question; the lumber order needs a count too. Rafters install in pairs at 16 in or 24 in on center along the building length, and the count follows directly from that spacing.

Building lengthRafter pairs at 16 inRafter pairs at 24 in
16 ft16 x 12 / 16 = 12 pairs16 x 12 / 24 = 8 pairs
24 ft18 pairs12 pairs
32 ft24 pairs16 pairs
40 ft30 pairs20 pairs

Round the count up, then add 10% for crowned boards you set aside, doubled rafters at stair openings and skylights, and the first pair you will inevitably recut. A 32 ft building at 24 in spacing takes 16 pairs, or 32 rafters, so ordering 36 boards is the normal move.

Birdsmouth and seat cuts: where the math meets the wall

The length above is the plan length from wall plate to the ridge centerline. Real rafters also carry two cuts. The plumb cut at the top sits against the ridge board, angled to match the pitch. The birdsmouth is the triangular notch near the bottom, made of a level seat cut that rests flat on the wall plate and a vertical heel cut that hugs its side.

The birdsmouth does not change the plan length, but it removes depth from the board, so leave at least 2 in of uncut depth above the notch. A 2x6 rafter at a 6/12 pitch has little room for a full seat, which is one reason shallow-pitched sheds often step up to a 2x8. Lay out the notch by hooking the framing square at the pitch numbers, 6 and 12 for this example, and sliding it down the board until the seat width matches the plate.

The ridge board itself eats a little run. A 1 1/2 in thick ridge shortens each rafter's horizontal reach by 3/4 in per side, so on a careful layout each rafter is cut 3/4 in short of the calculated run. Many framers fold that into the plumb cut and check the first pair on the ground before cutting a bundle.

Overhangs, fascia and buying the right boards

Eave overhangs are measured horizontally at the wall line, so their rafter contribution is the horizontal distance times the pitch factor. On the 24 ft example, a 1 ft overhang adds 1 x 1.118 = 1.12 ft, making the tail length 14.54 ft, while a 2 ft overhang adds 2 x 1.118 = 2.24 ft for 15.66 ft. The factor grows with the pitch, which is why a steep 12/12 roof with wide eaves needs surprisingly long boards.

Buy rafters a little long and cut to the mark. Dimensional lumber lengths run in 2 ft steps, so a 13.42 ft rafter means a 14 ft board, and the 14.54 ft total means a 16 ft board once the tail is included. Count pairs before ordering: rafters go in pairs at 16 in or 24 in on center, so a 32 ft long building at 24 in spacing takes 32 x 12 / 24 = 16 pairs, or 32 rafters. Add 10% for crowns you reject, doubled headers at openings, and the mistakes every first roof makes.

Finally, remember the calculator measures geometry, not structure. A length that fits can still be undersized for snow load, and the Forest Products Laboratory's wood handbook research is the underlying reference for how species and grade change capacity. When in doubt, size up one dimension and sleep well.

This page covers common rafter geometry for planning. Structural sizing must follow your local building code and span tables for your load zone.

Frequently asked questions

How long is a rafter for a 24 foot building with a 6/12 pitch?

The run is 24 / 2 = 12 ft and the rise is 12 x 6/12 = 6 ft. The rafter length is the square root of 12 x 12 + 6 x 6, which is 13.42 ft, or 13 ft 5 in.

What is the pitch factor for a 6/12 roof?

It is the square root of 1 + (6/12) x (6/12), which equals 1.118. Multiply the run by 1.118 and you get the rafter length without touching a square root.

How do I read the pitch mark 12/12?

It means the roof rises 12 in for every 12 in of run, a 45 degree roof. A 6/12 roof rises 6 in over the same 12 in of run, and half the rise number means half the angle, roughly 26.6 degrees.

How long is a rafter on a 12/12 roof for a 20 foot span?

The run is 10 ft and at 12/12 the rise equals the run, so the rafter is the square root of 10 x 10 + 10 x 10, which is 14.14 ft, or about 14 ft 2 in.

Does the rafter length include the overhang?

No. The common rafter length runs from the wall plate to the ridge line. Add the overhang separately: a 1 ft horizontal overhang on a 6/12 roof adds 1 x 1.118 = 1.12 ft of rafter, for a total of 14.54 ft in the example above.

What is a birdsmouth cut and does it change the length?

It is the triangular notch that sits on the wall plate. The plan length stays the same, but the notch removes material, so use lumber deep enough to leave at least 2 in of wood above the seat cut.

How far apart should rafters be spaced?

16 in or 24 in on center is standard for residential roofs. Spacing and rafter depth must match the span and roofing load, so check the span tables in the code book for your snow and wind zone.

How many rafters do I need for a 24 x 32 foot building?

Rafters come in pairs every 24 in along the 32 ft length, so 32 x 12 / 24 = 16 pairs, or 32 rafters, plus a few extras for headers and doubling at openings.

What size lumber for a 12 foot rafter span?

A 2x8 works for many 12 ft rafter spans at 16 in spacing in moderate load areas, but snow country often needs a 2x10. The rafter length calculator gives length, not depth, so confirm the size against span tables.

What is the difference between run and span?

Span is the full width the roof covers, wall to wall. Run is half of it, measured from the wall to the center ridge. All rafter math uses the run, which is why the first step here divides the span by 2.

How do I convert pitch to degrees?

Take the rise over 12 and use the arctangent. A 6/12 roof is about 26.6 degrees, a 12/12 roof is 45 degrees, and an 18/12 roof is about 56.3 degrees.

Does the ridge board change the rafter length?

A 1 1/2 in thick ridge board shortens each rafter's plan run by 3/4 in, so a purist cuts each rafter slightly shorter. Many framers just bevel the ends and ignore it on small roofs.

How much longer is a hip rafter than a common rafter?

A hip rafter runs along the corner at a shallower plan angle, so its length factor is about 1.5 times the common rafter per foot of run. Plan hip rafters with a hip factor of 17 instead of 12 on a 12/12 scale.

Can I just measure an existing rafter and copy it?

Yes, and on repair work it is the fastest way. Lay a straight rafter on the ground, mark the plumb cut from the pitch and the seat cut from the wall plate thickness, and test fit before cutting the rest.

Spotted a wrong number or a broken result?

More Home Improvement tools

See all Home Improvement tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.