Rafter length and ridge height: the geometry behind a gable roof

Two numbers describe the skeleton of a gable roof: how long each rafter is, and how high the ridge sits. Both fall straight out of the run and the pitch — no trigonometry tables, no guesswork. Here is where they come from, and where the tidy geometry stops and the real cuts begin.

The short answer

For a common rafter on a gable roof you need exactly three inputs: the run (the horizontal distance from the outside of the wall to the center of the ridge, which on a symmetric roof is half the building width), the overhang (how far the eave projects past the wall, measured horizontally) and the pitch. Then:

  • Rafter line length = (run + overhang) × M, where M = √(1 + (pitch÷12)²)
  • Ridge rise above the wall plate = run × (pitch ÷ 12)

That is the whole of it. The rafter length calculator and the ridge height calculator do the arithmetic for you, but it is worth understanding why the two formulas look so different — because one of them is a slope and the other is only a rise.

Why length needs a square root and height does not

Picture the right triangle a single rafter makes. The bottom side is the run, lying flat. The vertical side is the rise. The rafter itself is the hypotenuse. Pitch hands you the vertical side directly: at 7/12, every 12 inches of run climbs 7 inches, so the rise is just the run multiplied by 7÷12. Plain multiplication, no square root — and that is your ridge height above the plate.

The rafter, being the sloped side, needs Pythagoras. Its length per unit of run is √(12² + rise²) ÷ 12, which tidies up to √(1 + (pitch÷12)²) — the pitch multiplier. It is the same constant that turns a flat footprint into true roof area, which is why one small number quietly governs framing, sheathing, shingles and even gutter sizing. The whole range lives on the pitch multiplier chart, and the multiplier guide builds the derivation up from scratch if you want to see it.

One consequence is worth carrying around in your head. Ridge rise grows in a straight line with pitch, but rafter length grows very slowly at first. Going from 4/12 to 8/12 doubles the ridge height, yet lengthens the rafter by only about 14%. Steep roofs cost far more in height, in surface area and in danger than the rafter stock alone would suggest.

Worked example: a 27-foot-wide gable at 7/12

Take a real-ish house rather than a tidy one. The building measures 27 ft across the gable, so each run is 13.5 ft. The eaves project 1.5 ft horizontally. The pitch is 7/12.

  • Multiplier: 7 ÷ 12 = 0.5833; 0.5833² = 0.3403; √1.3403 = 1.1577
  • Rafter line length: (13.5 + 1.5) × 1.1577 = 15 × 1.1577 = 17.37 ft, about 17 ft 4⅜ in
  • Wall to ridge only: 13.5 × 1.1577 = 15.63 ft (about 15 ft 7½ in) — this is where the seat cut lands
  • Ridge rise: 13.5 × 0.5833 = 7.875 ft, that is 7 ft 10½ in above the wall plate
  • Angle: a 7/12 pitch is 30.26° from horizontal

Two practical readings fall out immediately. First, 17.37 ft of line length means 18-foot stock: 16-footers will not reach, and you are trimming just over half a foot off every rafter. Second, if the top plate sits 8.5 ft above the floor, the underside of the ridge is 7.875 + 8.5 = 16.375 ft above that floor — worth knowing before anyone starts imagining a room up there.

The same rise hands you the gable end for free. A gable triangle is ½ × span × rise: ½ × 27 × 7.875 = 106.3 sq ft per end, 212.6 sq ft for the pair. That figure drops straight into a siding take-off, which is otherwise the fiddliest part of measuring a house.

What the line length deliberately leaves out

Line length is measured along the top edge of the rafter, from the outside corner of the wall plate to the centerline of the ridge. Real framing needs three adjustments, and none of them live in the formula.

The ridge deduction. A ridge board has thickness, and the rafter stops at its face, not its center. Deduct half the ridge thickness — measured horizontally — then slope that deduction with the multiplier. For a nominal 2x ridge (1.5 in actual), half is 0.75 in, and 0.75 × 1.1577 = 0.87 in: call it ⅞ in off the line length of every common rafter. On a 1¾-inch engineered ridge it is about an inch. Small, but it is the difference between a tight ridge and a gap you can spot from the driveway.

The bird’s mouth. The seat cut notches the rafter over the wall plate at the 15.63 ft mark in our example, measured down the line from the ridge. The notch removes material but does not change the line length — it only marks where along that line the wall sits. Keep the notch shallow; how deep it may safely go is a structural question for a span table or a professional, not for a geometry calculator.

The tail cut. You entered the overhang as a horizontal projection, so the multiplier already sloped it for you. If your plans instead give the tail as a sloped length — a measurement taken along the rafter — set the overhang to zero in the calculator and add that sloped figure to the result directly. Mixing the two conventions is the most common way to end up with eaves that refuse to line up.

Hip and valley rafters use a different constant

A hip rafter does not run straight up the slope; it runs diagonally across the corner, so its horizontal run is longer than a common rafter’s by a factor of √2. Over a square corner with equal pitches on both sides, the hip length is:

hip = run × √(2 + (pitch÷12)²)

In our 7/12 example: √(2 + 0.3403) = √2.3403 = 1.5298, so 13.5 × 1.5298 = 20.65 ft, against 15.63 ft for the common rafter reaching the same point. That is why hip stock is ordered longer and why hip roofs eat material. A valley rafter over an equal-pitch intersection uses the identical constant. Unequal pitches break the √2 assumption altogether and have to be laid out plane by plane — at that point, work from the framing drawings.

Shed roofs, dormers and roofs that are not symmetric

On a mono-pitch shed roof there is no ridge and no halving: the run is the full horizontal width from the low wall to the high wall, and the rise is the height difference between the two plates. Feed the full width in as the run and both formulas hold unchanged. On an asymmetric gable — two different runs, or two different pitches — each slope has its own rafter length, and the ridge only lands in the middle when both sides produce the same rise. If they do not, the ridge shifts sideways and you should be laying out from a section drawing rather than a single calculation. Shed dormers are the same problem in miniature: treat each plane as its own little roof and run the numbers separately.

Sanity checks before anyone cuts

Three quick tests catch most mistakes. First, is your figure the run or the span? If your rafter length comes out roughly equal to the full building width, you almost certainly used the span. Second, does the multiplier look sane? Every common pitch lands between 1.0 and 1.5; a value outside that range means the pitch went in as degrees or as a percentage. Third, does the ridge height feel right? At 7/12 the rise is a little over half the run — if your answer stands taller than the walls beneath it on an ordinary house, measure again. Confirm the pitch first with the pitch calculator, because every downstream figure inherits that one reading.

Finally, the boundaries. These are geometric line lengths for layout and for estimating stock — planning estimates, not a structural design. What depth, thickness, spacing and species a rafter needs in order to carry snow, wind and its own weight comes from published span tables or a licensed professional. And no measurement is worth an injury: working on a roof is dangerous, falls are a leading cause of construction deaths, so take your run and your pitch from the ground, the attic or the drawings wherever you can, use proper fall protection if you must go up, and check any height limit with your local building official.

Background on framing conventions and span data: American Wood Council; on roof assemblies and code editions, International Code Council and National Roofing Contractors Association.

Frequently asked questions

How long is a rafter for a 24-foot-wide house?

Halve the width to get the run: 12 ft. At 6/12 the multiplier is 1.1180, so the rafter is 12 × 1.1180 = 13.42 ft to the ridge centerline, plus the overhang times the same multiplier. A 1 ft overhang adds 1.12 ft, giving 14.54 ft. Change the pitch and only the multiplier changes.

How do I calculate a hip rafter length?

A hip crosses the corner diagonally, so its run is √2 times longer. For equal pitches, hip = run × √(2 + (pitch÷12)²). At 7/12 with a 13.5 ft run that is 13.5 × 1.5298 = 20.65 ft, against 15.63 ft for a common rafter to the same point.

How much do I deduct for the ridge board?

Half its thickness, measured horizontally, then sloped by the multiplier. A 1.5 in ridge board gives 0.75 × 1.1577 = 0.87 in — about ⅞ in off each common rafter at 7/12. The calculator returns length to the ridge centerline, so the deduction is yours to make.

How high will my attic be at the ridge?

Ridge rise above the plate is run × (pitch ÷ 12) — 7.875 ft for a 13.5 ft run at 7/12. Subtract the rafter depth and any ceiling finish for usable headroom under the peak, and remember headroom drops away fast as you move toward the eaves.