Rafter Length Calculator
Check your local building code, especially birdsmouth limits, and confirm measurements on site before cutting lumber.
Rafter layout is more than plotting a right triangle. A 24 ft span at a 6:12 pitch means deducting half the ridge thickness (usually 0.75") to find the net run before you cut the birdsmouth. Enter your span, pitch, ridge thickness, and overhang below for the line length, tail length, and total board length to buy.
Rafter line length by roof pitch (24 ft span)
| Pitch (X:12) | Slope Factor | Net Run | Line Length | Total Rise |
|---|---|---|---|---|
| 3 : 12 (Low) | 1.031 | 11 ft 11¼ in | 12 ft 3¾ in | 2ft 11¾ in |
| 4 : 12 | 1.054 | 11 ft 11¼ in | 12 ft 7 in | 3 ft 11¾ in |
| 6 : 12 (Norm) | 1.118 | 11 ft 11¼ in | 13 ft 4⅛ in | 5 ft 11¾ in |
| 8 : 12 | 1.202 | 11 ft 11¼ in | 14 ft 4¼ in | 7 ft 11½ in |
| 10 : 12 | 1.302 | 11 ft 11¼ in | 15 ft 6½ in | 9 ft 11¼ in |
| 12 : 12 (Steep) | 1.414 | 11 ft 11¼ in | 16 ft 10⅝ in | 11 ft 11¼ in |
How to calculate rafter layout cuts
Finding a rafter's length takes more than the Pythagorean theorem on your span. Framing works in real lumber dimensions, so you subtract the thickness of the parts a rafter meets to get the net cutting measurements.
The ridge deduction
Your run is half the span, the same idea as the run for stairs. A building 24 feet wide outside to outside gives each rafter a 12-foot baseline run. But the rafters don't meet at a point; they land against a ridge board. For a 2-by ridge (1.5" actual), deduct half that thickness (0.75") from the run, so the net layout run drops to 11 feet 11¼ inches.
Calculating the overhang (tail)
The slope factor is how much longer a sloped distance is than the flat run beneath it (our roof pitch calculator covers the geometry). Multiply your horizontal overhang by the slope factor to get the sloped tail length. Add the tail to the line length for the total rafter length, which tells you the stock lumber size to buy.
How the birdsmouth affects effective length
The birdsmouth is the notch that seats the rafter on the wall plate, and it's the point that splits the board into line length and tail. It doesn't add length — but where you place it sets how much of the board sits inside the wall line versus hangs past it as overhang. Cutting it too deep is the real risk: keep the seat to no more than one-third of the rafter's depth so at least two-thirds of the board stays intact above the notch. That's why the calculator asks for ridge thickness and overhang separately — it places the birdsmouth at the net run, then adds the sloped tail beyond it.
Common, hip, and valley rafters
Not every rafter uses the same run. This calculator sizes the common rafter — the standard rafter that runs straight up the slope from wall to ridge, perpendicular to both. Hip and valley rafters are different structural members, and their length is worked out on a different base measurement.
Common rafter
The common rafter climbs 12 inches of run at a time — the "12" in a pitch like 6:12. Its length is the run times the slope factor, which is exactly what the numbers above compute. Most of the rafters in a gable roof are commons, all cut to the same length.
Hip and valley rafters
A hip rafter runs diagonally from the corner of the building up to the ridge, at 45 degrees in plan to the commons; a valley rafter runs the same diagonal where two roof planes meet in an inside corner. Because that diagonal is longer than a straight run, hip and valley rafters use a unit run of about 16.97 inches (12 × √2, usually rounded to 17) instead of 12. So for the same pitch and the same horizontal distance, a hip or valley rafter is meaningfully longer than a common — you can't reuse the common-rafter length for them. Frame the commons with this calculator, then lay out the hips and valleys off the 17-inch unit run on a framing square.
Shed, lean-to, and gable roofs
The run you feed the calculator depends on the roof shape.
Gable roof
A gable roof has two slopes meeting at a central ridge, so each rafter's run is half the building span. A 24-foot-wide building gives a 12-foot run per rafter. This is the default the calculator assumes.
Shed and lean-to roofs
A shed roof (and a lean-to, which is a shed roof leaning against an existing wall) is a single slope with no central ridge. The rafter runs the full width from the low wall to the high wall, so the run is the whole span, not half. Enter the full width as the span and set the ridge deduction to zero if the high end bears on a wall plate rather than a ridge board. Everything else — slope factor, tail, birdsmouth — works the same.
Frequently asked questions
What is the difference between rafter run and span?
The span is the full width of the building, measured outside to outside of the two wall plates. The run is half of that, the horizontal distance one rafter covers from the wall to the center. A building that spans 24 feet gives each common rafter a 12-foot run.
Why do I deduct the ridge board thickness?
The rafters don't meet at a point; they land against a ridge board in the middle. To keep the building the right width, you deduct half the ridge board thickness from each rafter's run before marking the plumb cut. For a 2-by ridge at 1.5 inches actual, that is 0.75 inch off each side.
How do I calculate the rafter overhang?
Overhang is usually set as a horizontal distance past the wall, say 12 inches. To get the sloped length of wood the tail actually takes, multiply that horizontal overhang by the roof's slope factor. The steeper the pitch, the longer the tail runs for the same horizontal projection.
What is a birdsmouth cut?
A birdsmouth is the notch cut into the underside of a rafter where it crosses the wall. It has a seat cut that sits flat on top of the wall plate and a plumb cut that lines up vertically with the wall face. The notch lets the rafter bear cleanly on the wall and transfer the roof load down into it.
How deep can a birdsmouth be cut?
Keep the birdsmouth to no more than one-third of the rafter's depth, leaving at least two-thirds of the board intact above the notch. Cutting deeper removes too much material and weakens the rafter over the wall. On a 2x8 rafter, that caps the seat cut at roughly 2.4 inches deep.
What is the line length of a rafter?
The line length is the straight distance along the slope from the ridge cut down to the birdsmouth at the wall. It does not include the tail, which is the overhang added past the wall. You add the tail length to the line length to get the total board length you cut from.
Why is a hip rafter longer than a common rafter?
A hip rafter runs diagonally from the building corner to the ridge, at 45 degrees in plan to the common rafters, so it covers a longer horizontal distance. Framers work it out on a unit run of about 16.97 inches (12 times the square root of 2, usually rounded to 17) instead of the 12 inches used for a common rafter. For the same pitch and the same footprint, that makes the hip or valley rafter noticeably longer, so you can't reuse a common-rafter length for it. This calculator sizes common rafters; lay out hips and valleys off the 17-inch unit run.
How do I calculate rafter length for a shed or lean-to roof?
A shed roof (or a lean-to leaning on an existing wall) has one slope and no central ridge, so the rafter runs the full width of the building rather than half. Enter the full span as the run and set the ridge deduction to zero if the high end bears on a wall plate. The slope factor, overhang tail, and birdsmouth work exactly as they do on a gable rafter.
Related calculators
Sources
- Cutting a Common Rafter (The Little Blue Book)Swanson Tool Co.Framing-square reference treating the rafter as the hypotenuse of a rise-and-run right triangle, with birdsmouth and ridge-thickness deductions.
- Roof Pitch Reference (The Little Blue Book)Swanson Tool Co.Definition of roof pitch as rise over run (per 12 inches), used to derive rafter length from pitch and span.
- 2021 IRC Chapter 8 — Roof-Ceiling Construction (Section R802, Wood Roof Framing)International Code Council (ICC), via UpCodesCode reference for wood roof framing, including the limit on birdsmouth notch depth relative to rafter depth.