Rafter Length Calculator: Common, Hip and Valley Rafters, With Worked Examples

Roofing math · Rafters · Updated 2026-09-27

A rafter is longer than most people's first guess and shorter than the number a careless calculation hands back. The figure that decides it is the run, not the span, and on a simple symmetrical gable the run is half the span. Most layout mistakes are recoverable with a saw. That one is not: it hands you a rafter exactly twice as long as the one you needed, and it survives quietly all the way into the cut list and the lumber order.

This guide sets the vocabulary first, because nearly every bad rafter number starts as a word used loosely. Then it gives the formulas, works a real roof both ways - a 28 ft span gable at 6/12 as a common rafter, then the same building hipped - and finishes with two tables you can read standing at the eave: rafter length per foot of run, and hip or valley length per foot of run, for every standard pitch from 1/12 to 24/12.

Span, run and rise, in that order

The vocabulary, checked against a 28 ft wide gable at 6/12
TermWhat it isOn this roof
SpanThe full horizontal width the roof crosses, outside of wall to outside of wall28 ft
RunThe horizontal distance one rafter covers, from the outside of the wall to the center of the ridge. Half the span on a symmetrical gable14 ft
Unit riseThe x in x/12: inches of rise for every 12 in of run6 in
Total riseRun times the unit rise over 12. How far the ridge center sits above the top of the wall plate7 ft
Line lengthThe theoretical rafter, measured along its top edge from the outside of the wall to the center of the ridge15.65 ft
Tail or overhangThe part that runs past the wall. Normally specified as a level overhang, which is a horizontal figure and not a length of lumber16 in level
Ridge deductionHalf the ridge thickness, taken off the run so two opposing rafters meet the ridge board instead of each other0.75 in of run
Slope factorRafter length per foot of run, sqrt(144 + x^2) / 121.1180
Hip/valley factorHip or valley length per foot of common run, sqrt(288 + x^2) / 121.5000

Line length is not the rafter you cut

Line length is a geometry answer. It runs along the top edge of the rafter from the outside face of the wall to the center line of the ridge, and no board on the job is exactly that long. Two things change it. First, the ridge has thickness: two opposing rafters cannot both reach the center, so you take half the ridge thickness off the run before converting, which shortens the rafter along its own edge by that half thickness times the slope factor. A nominal 2x ridge is 1.5 in thick, so 0.75 in comes off the run, and at 6/12 that is about 13/16 in off the rafter. Second, the tail. An overhang is almost always given as a level overhang, a horizontal number, so it has to be converted the same way the run was before it is added on. The two ends are the plumb cut at the ridge, which stands vertical once the rafter is in place, and the seat cut or birdsmouth at the wall, a notch with a level seat that bears on the top plate and a plumb heel against its outside face. Line length is measured between the plumb cut line and the plumb line of that seat cut, which is why layout is marked along the top edge and never taken from the end of the board.

The formulas

  • Common rafter line length = run x slope factor. The slope factor is sqrt(144 + x^2) / 12 for a pitch of x/12, and it is the same number as rafter length per foot of run. At 6/12 it is 1.1180. Roof slope factor covers where it comes from and what else it does.
  • Or straight from Pythagoras: line length = sqrt(run^2 + total rise^2). Same answer, no table needed. With 14 ft of run and 7 ft of total rise, sqrt(196 + 49) = 15.65 ft.
  • Hip or valley line length = run x hip/valley factor, where that factor is sqrt(288 + x^2) / 12. At 6/12 it is exactly 1.5000. The run you feed it is the ordinary common run, not the diagonal.
  • The hip factor is larger because a hip has a longer run. A common rafter crosses the plan square, so its run is the side of the square. A hip runs corner to corner, so its run is the diagonal of that square, 1.4142 times as far for the same building. The hip climbs the same total rise over that longer distance, which makes it both longer than the commons and shallower than them in actual degrees.
  • A valley uses the same factor as a hip. For the same pitch and the same run it is the same length, because it is the same diagonal geometry turned inside out. Where two roofs of unequal pitch meet, the two sides of the valley sit on different runs and different factors, so each side is figured on its own.
  • Then adjust both ends: subtract the ridge deduction, add the converted tail. Neither is optional, and they pull in opposite directions, so they do not cancel.

Worked example: a 28 ft span gable at 6/12

  1. Take the span and halve it: The building measures 28 ft outside to outside. Run is 14 ft per side. Write 14 down and stop thinking about 28.
  2. Confirm the pitch: 6/12, which is 26.57 degrees and a 50 percent grade. On a remodel, measure the plane instead of trusting the drawing: how to measure roof pitch walks through every method.
  3. Total rise: 14 ft of run at 6 in of rise per 12 in of run gives 7 ft. The ridge center sits 7 ft above the top of the wall plate, before you account for how the ridge board itself is hung.
  4. Line length: 14 x 1.1180 = 15.65 ft, which is 15 ft 7-13/16 in. Pythagoras agrees: sqrt(14^2 + 7^2) = 15.65 ft.
  5. Subtract the ridge deduction: A nominal 2x ridge is 1.5 in thick. Half of that is 0.75 in of run, and 0.75 x 1.1180 is about 13/16 in along the rafter. Line length drops to just under 15 ft 7 in from the plumb cut to the plumb line of the seat cut.
  6. Add the converted tail: A 16 in level overhang is a horizontal figure, so convert it the same way the run was converted: 16 x 1.1180 = 17.89 in, about 17-7/8 in of rafter past the seat cut.
  7. Now you have a board length: Just under 15 ft 7 in plus about 17-7/8 in is 204.9 in, or 17 ft 0-7/8 in measured along the top edge. That is 18 ft stock, not 16 ft, and the difference between knowing that and finding it out is a delivery.

The same building with a hip roof. Hip the ends of that 28 ft wide house at the same 6/12 and the common rafters do not change at all: 14 ft of run, 15.65 ft of line length, same cuts. The hips are new. Each one runs from a building corner diagonally up to the end of the ridge, so it covers the diagonal of a 14 ft square, 14 x 1.4142 = 19.80 ft of horizontal distance, while its total rise is still the same 7 ft as everything else on the roof. Line length is 14 x 1.5000 = 21.00 ft exactly at this pitch, and Pythagoras confirms it from the diagonal: sqrt(19.80^2 + 7^2) = 21.00 ft. Watch what went into that multiplication. The run was 14, the ordinary common run, because the 1.5000 factor already contains the diagonal; taking the 19.80 ft diagonal and multiplying it by 1.5000 as well gives 29.70 ft, or 8.70 ft too much hip. The end adjustments differ too. A hip landing on the end of the ridge meets it at 45 degrees, so its deduction is half the ridge thickness measured on that diagonal, about 1-1/16 in of run, roughly 1-9/16 in off the hip; exactly how the top of a hip is framed varies from crew to crew, so lay the first one out full size rather than trusting a rule of thumb. The tail comes out cleaner: a 16 in level overhang on both walls gives 16 x 1.5000 = exactly 24 in of hip past the corner. A hip also wants cheek cuts, a compound bevel on each side of the plumb cut so it seats into the corner, and the seat is dropped or the top edge backed so the sheathing on both roof planes lies flat across it.

Rafter length per foot of run

Common rafter length per foot of run, which is the slope factor. Multiply by the run in feet to get line length.
PitchDegreesRafter per ft of run (ft)Rafter per ft of run (in)
1/124.761.003512.042
2/129.461.013812.166
3/1214.041.030812.369
4/1218.431.054112.649
5/1222.621.083313.000
6/1226.571.118013.416
7/1230.261.157713.892
8/1233.691.201914.422
9/1236.871.250015.000
10/1239.811.301715.620
11/1242.511.356616.279
12/1245.001.414216.971
13/1247.291.474317.692
14/1249.401.536618.439
15/1251.341.600819.209
16/1253.131.666720.000
18/1256.311.802821.633
20/1259.041.943723.324
24/1263.432.236126.833

Measure the plane, then take the length off it. Roof Pitch Gauge & Factor reads the pitch of a deck, a rafter or a rake board with the phone's motion sensors and shows degrees, x/12 and percent grade together with the slope factor, then gives common, hip and valley lengths from the run you enter. It works with no signal, on any roof. Coming soon for iPhone. Learn more about Roof Pitch Gauge & Factor.

Hip and valley length per foot of run

Hip or valley length per foot of COMMON run. The 45 degree diagonal is already inside the factor, so use the common run.
PitchDegreesHip/valley per ft of run (ft)Hip/valley per ft of run (in)
1/124.761.416717.000
2/129.461.424017.088
3/1214.041.436117.234
4/1218.431.453017.436
5/1222.621.474317.692
6/1226.571.500018.000
7/1230.261.529818.358
8/1233.691.563518.762
9/1236.871.600819.209
10/1239.811.641519.698
11/1242.511.685320.224
12/1245.001.732120.785
13/1247.291.781521.378
14/1249.401.833322.000
15/1251.341.887522.650
16/1253.131.943723.324
18/1256.312.061624.739
20/1259.042.185826.230
24/1263.432.449529.394

Cutting the first rafter as a pattern

  1. Measure the run that exists: Pull the span outside to outside and halve it, or pull from the outside of the wall to the center of the ridge if the ridge is already set. Check the building for square and the walls for parallel first, because one run figure is about to be used on every rafter.
  2. Read the pitch off the plane itself: On a remodel, do not take the pitch from the drawing. Lay a level and a tape on a rafter, or set a phone flat on the deck or along a rake board, and work from the plane you are actually framing to.
  3. Mark the plumb cut: Set a square to the pitch and mark the plumb line at the ridge end. On a speed square you hold the pivot point on the top edge and swing to 6 on the common scale for 6/12; on a framing square you set the 12 in mark on the body and the 6 in mark on the tongue both against the top edge of the rafter, then scribe the plumb line along the tongue. That plumb line is the datum every other mark is taken from.
  4. Measure the line length along the top edge: From the plumb line, run the tape down the top edge by the adjusted line length and mark the plumb line of the seat cut there. Measure on the edge, not on the face, and never from the end of the board.
  5. Lay out the seat cut and the tail: Square the level seat in from the plumb heel line so the notch bears properly on the plate, leaving enough stock standing above the notch. Then carry the tail past it by the converted overhang and mark the tail cut, plumb if a fascia is going on, square if the detail calls for it.
  6. Cut one, fit it, then make it the pattern: Cut the first rafter, set it against the ridge and the plate, and check three things: the plumb cut beds tight, the seat sits flat on the plate, and the tail lands where the fascia line wants it. Only once it fits does it become the pattern. Trace every remaining rafter off that one board instead of remeasuring, so any small error stays constant across the roof rather than drifting rafter by rafter.

Where the money goes wrong

  • Using the span instead of the run. 28 x 1.1180 = 31.30 ft of rafter on a roof that needs 15.65 ft. It is the most expensive piece of arithmetic in the trade and the easiest to catch, because the check is one sentence long: run is half the span.
  • Forgetting the ridge deduction. Every rafter comes out about 13/16 in long at 6/12, the ridge board no longer fits between the pairs, and either the ridge rides high or the seat cuts stop bearing on the plate. Half the ridge thickness comes off the run, then gets converted like any other run figure.
  • Leaving out the overhang, or adding it flat. A 16 in level overhang is 17-7/8 in of rafter at 6/12. Leave it out and the fascia line lands on the wall; add it unconverted and every tail is short by almost 2 in.
  • Using the common factor on a hip. 14 x 1.1180 = 15.65 ft where the hip needs 14 x 1.5000 = 21.00 ft. The hip finishes 5.35 ft short, about 5 ft 4 in, and the board is scrap.
  • Doubling the diagonal on a hip. The hip factor already carries the 1.4142. Multiply the 19.80 ft diagonal run by 1.5000 as well and you get 29.70 ft, which is 8.70 ft of hip that does not exist.
  • Guessing the pitch on an existing roof. A rafter figured at 6/12 for a roof that is really 6.5/12 is short, and no amount of careful layout recovers it. Measure the plane, and when the reading falls between two whole pitches, believe the reading rather than rounding toward the number you were hoping for.

Two references sit either side of this one. Roof slope factor explains where 1.1180 comes from and how the same multiplier turns a flat footprint into roof area and squares, and the roof pitch chart carries the full conversions - degrees, percent grade, slope factor and hip factor side by side - for the times you need more than a rafter length. Once those are on hand, only two inputs are still yours to get right, and they are the pitch and the run.

Frequently asked questions

How do you calculate rafter length?

Multiply the run by the slope factor for the pitch: a 14 ft run at 6/12 is 14 x 1.1180 = 15.65 ft of line length. Pythagoras gives the same answer from run and total rise, sqrt(14^2 + 7^2). Then subtract half the ridge thickness and add the converted overhang to get the board you actually cut.

Is rafter run half the span?

Yes, on a simple symmetrical gable with the ridge centered. A 28 ft span gives 14 ft of run per side, and that 14 is what goes into the formula. On an offset ridge, a shed roof or a pair of unequal pitches, each side has its own run and each is figured separately.

How do you calculate hip rafter length?

Multiply the same common run by the hip and valley factor, sqrt(288 + x^2) / 12 for a pitch of x/12. At 6/12 that factor is exactly 1.5000, so 14 ft of common run gives a 21.00 ft hip. The factor already includes the 45 degree diagonal, so do not take the diagonal run yourself and then multiply again.

Why is a hip rafter longer than a common rafter?

Because it covers more horizontal distance for the same rise. A common rafter crosses the plan square while a hip runs corner to corner, a diagonal 1.4142 times as long, and it climbs the same total rise over that longer distance. That makes the hip both longer than the commons and shallower than them in actual degrees.

How much do you deduct for the ridge board?

Half the ridge thickness, taken off the run. A nominal 2x ridge is 1.5 in thick, so 0.75 in comes off the run, which at 6/12 shortens the rafter by about 13/16 in along its own edge. A hip meeting the ridge at 45 degrees is deducted on the diagonal instead, about 1-1/16 in of run against a 2x ridge.

Is a valley rafter the same length as a hip rafter?

For the same pitch and the same run, yes, because both follow the diagonal of the plan square and both use the hip and valley factor. Where two roofs of different pitches intersect, the two sides of the valley sit on different runs and different factors, so each side has to be figured on its own.

Does rafter length include the overhang?

Only after the overhang is converted. Line length runs from the center of the ridge to the outside of the wall, and the tail is added past the seat cut. An overhang is normally specified as a level, horizontal figure, so multiply it by the slope factor first: a 16 in level overhang is 17-7/8 in of rafter at 6/12.

Keep reading