How long are my rafters?
Type the building span, the roof pitch, the overhang and the ridge board thickness. The rafter calculator shows each common rafter’s length, the board length to buy, the rise and angle of the roof, and how many rafters you need.
- Rafter length (ft)
- 14.46
Each rafter is 14.46 ft long (buy 16 ft boards); you need 62 rafters.
- Rafter length (m)
- 4.409
- Rafter length (in)
- 173.57
- Board length to buy (ft)
- 16
- Rafters
- 62
- Rise (ft)
- 5.97
- Rise (m)
- 1.819
- Run (ft)
- 11.94
- Roof angle (°)
- 26.57
- Slope factor
- 1.118
Rafter length (ft): 14.46. Each rafter is 14.46 ft long (buy 16 ft boards); you need 62 rafters.
Rafter length (ft) by roof pitch (in 12)
How to calculate
Computes common rafter length from the building span, roof pitch, ridge board and overhang, with the rise, roof angle, lumber length to buy and how many rafters you need.
Example with the default inputs (Building span 24 ft, Roof pitch (in 12) 6, Overhang 12 in, Ridge board thickness 1.5 in, Building length 40 ft, Rafter spacing 16 in): Each rafter is 14.46 ft long (buy 16 ft boards); you need 62 rafters.
Method: Run = (span − ridge) ÷ 2; slope factor = √(12² + pitch²) ÷ 12; rafter = (run + overhang) × slope factor; rise = run × pitch ÷ 12; angle = arctan(pitch ÷ 12); rafters = 2 × (⌈building length ÷ spacing⌉ + 1).
- Common rafters from the ridge board to the tail, measured along the top edge (the line length); no bird’s mouth or plumb-cut allowance.
- The overhang is measured level, from the outside of the wall.
- Boards are sold in 2 ft steps (Kreg Tool: 6 to 20 ft in 2 ft increments); longer rafters may need a special order.
- Spacing is 16 in on center by default, with one rafter at each end of each side.
Worked examples
Each example is checked against the calculator on every build.
- Building span 24 ft, Roof pitch (in 12) 5, Overhang 0 in, Ridge board thickness 0 in, Building length 40 ft, Rafter spacing 16 in gives Slope factor 1.083333, Rafter length (ft) 13, Board length to buy (ft) 14, Rise (ft) 5, Rafters 62.Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem
- Building span 24 ft, Roof pitch (in 12) 6, Overhang 12 in, Ridge board thickness 1.5 in, Building length 40 ft, Rafter spacing 16 in gives Run (ft) 11.9375, Rafter length (ft) 14.464565, Board length to buy (ft) 16, Roof angle (°) 26.565051.Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem; Kreg Tool, Ultimate Guide to Lumber Dimensions (2× lumber is 1.5 in thick; lengths in 2 ft steps). https://learn.kregtool.com/learn/understand-lumber-sizing/
- Building span 26.25 ft, Roof pitch (in 12) 9, Overhang 19.69 in, Ridge board thickness 1.575 in, Building length 32.81 ft, Rafter spacing 23.62 in gives Slope factor 1.25, Rafter length (m) 5.6, Rise (m) 2.985, Rafters 36.Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem
How it works
- Run = (building span − ridge board thickness) ÷ 2
- Slope factor = √(12² + pitch²) ÷ 12, where the pitch is the rise in inches per 12 inches of run
- Rafter length = (run + overhang) × slope factor, along the top edge from the ridge board to the tail
- Rise = run × pitch ÷ 12
- Roof angle = arctan(pitch ÷ 12), in degrees
- Board length to buy = the rafter length in feet rounded up to the next even foot (2 × ⌈feet ÷ 2⌉)
- Rafters = 2 × (⌈building length ÷ spacing⌉ + 1): one every "spacing" plus one at the end, on both sides
The chart draws the rafter length in feet for pitches from 1/12 to 24/12 at your span, ridge and overhang.
Exact arithmetic. Each size is read as the exact decimal you typed, in the unit you typed it in. The run, rise and rafter count are exact fractions. The slope factor is exact when 144 + pitch² is a square (5/12 gives 13/12, 9/12 gives 15/12, 16/12 gives 20/12), and a 64-bit float otherwise. The board length and rafter count are exact ceilings, so a rafter of exactly 14 ft needs a 14 ft board.
Output format. Feet and inches show 2 decimals, metres 3, the angle 2 and the slope factor 4, each rounded half up, with trailing zeros left off. In Metric the answer leads with metres.
When there is no answer. A ridge board as wide as the building or wider (no run).
Assumptions
- Common rafters on a simple gable roof; the length is the line length, with no allowance for the bird’s mouth or plumb cuts.
- The overhang is measured level from the outside of the wall: 12 in by default. Ridge board: 1.5 in (a 2× board) by default; 0 for none.
- Spacing is 16 in on center by default (at least 1 in). Pitch is more than 0 and at most 24 in 12. Spans and lengths up to 200 m.
Worked examples by hand
24 ft span at 5/12, no ridge, no overhang, 40 ft long at 16 in. Run = 12 ft; rise = 12 × 5 ÷ 12 = 5 ft; rafter = 12 × 13 ÷ 12 = 13 ft; buy 14 ft; 480 ÷ 16 = 30, + 1 = 31 per side, 62 rafters.
24 ft span at 6/12, 12 in overhang, 1.5 in ridge. Run = (288 − 1.5) ÷ 2 = 143.25 in = 11.9375 ft; rafter = 12.9375 × √180 ÷ 12 = 14.46 ft; buy 16 ft; angle = arctan(0.5) = 26.57°.
8 m span at 9/12, 50 cm overhang, 4 cm ridge, 10 m long at 60 cm. Run = (8 − 0.04) ÷ 2 = 3.98 m; slope factor = 15 ÷ 12 = 1.25; rafter = 4.48 × 1.25 = 5.6 m; rise = 3.98 × 0.75 = 2.985 m; ⌈10 ÷ 0.6⌉ + 1 = 18 per side, 36 rafters.
Other questions people ask
How do I calculate rafter length?
A rafter is the long side of a right triangle whose legs are the run and the rise. Rafter = run × √(12² + pitch²) ÷ 12. For a 24 ft span at 5/12 the run is 12 ft and the rise 5 ft, so the rafter is √(144 + 25) = 13 ft.
What is the run of a rafter?
The level distance the rafter covers: half the building span, minus half the ridge board’s thickness. A 24 ft span with a 1.5 in ridge board has a run of 12 ft − 0.75 in = 11.9375 ft.
What does a 6/12 pitch mean?
The roof rises 6 inches for every 12 inches it runs. Its slope factor is √(12² + 6²) ÷ 12 = 1.118, so each foot of run needs 1.118 ft of rafter, and the roof angle is arctan(6 ÷ 12) = 26.57°.
How do I add the overhang?
Add the level overhang to the run before you multiply by the slope factor. A 12 in overhang at 6/12 adds 1 × 1.118 = 1.12 ft of rafter.
How many rafters do I need?
Divide the building length by the spacing, round up, and add one for the end; then double it for both sides. A 40 ft wall at 16 in on center needs 40 × 12 ÷ 16 = 30, plus 1 = 31 per side, 62 in all.
What length of lumber should I buy?
Round the rafter length up to the next even foot, because dimensional lumber is sold in 2 ft steps. A 14.46 ft rafter needs a 16 ft board. Kreg Tool lists lengths from 6 to 20 ft; longer boards may need a special order.