Start with a symmetrical gable
This rafter length calculator estimates the sloping wall-to-ridge distance for a common rafter. It assumes a straight, symmetrical gable with the ridge centered between the exterior wall reference lines. Enter the full horizontal span in feet, then enter the roof pitch. The result is a useful geometry check before detailed framing layout.
The calculator divides the span in half to obtain the horizontal run for a side of the roof. Do not enter an already-halved run in the span field. The roof pitch describes rise per 12 inches of horizontal distance; it does not describe how many inches the rafter itself rises along its sloping edge.
Follow the span-to-length example
For a full span of 24 feet and a 4:12 pitch, the horizontal run is 12 feet. That run produces a vertical rise of 4 feet. The sloping reference length is about 12.65 feet, or 151.79 inches.
These distances form a right triangle. The calculated length is the square root of the horizontal run squared plus the rise squared. Adding run and rise would trace a horizontal segment followed by a vertical segment; it would not measure the diagonal rafter line.
Example 1: 24 ft span with a 4:12 pitch
Span = 24 ft → run = 24 ÷ 2 = 12 ft → rise = 12 × 4 ÷ 12 = 4 ft → rafter length = √(12² + 4²) = 12.65 ft. All dimensions in the square-root expression are feet. The answer measures the straight sloping reference line, not the length of a board after cuts.
Example 2: 24 ft span with a 6:12 pitch
- Span: start with 24 ft measured horizontally between the wall reference lines.
- Run: divide the full span by two: 24 ÷ 2 = 12 ft from the wall to the ridge centerline in plan.
- Rise: multiply that run by the pitch ratio: 12 × 6 ÷ 12 = 6 ft vertically above the wall reference elevation.
- Rafter length: use the right triangle: √(12² + 6²) = 13.42 ft along the slope.
Compare this with the first example: the wall-to-wall span and horizontal run stay the same, but the higher pitch increases both rise and rafter length. Changing the spacing between rafters would not change either triangle. This is why pitch and span belong in a length calculation, while spacing belongs in a separate layout and structural check.
Example 3: 36 ft span with a 8:12 pitch
- Span: start with 36 ft measured horizontally between the wall reference lines.
- Run: divide the full span by two: 36 ÷ 2 = 18 ft from the wall to the ridge centerline in plan.
- Rise: multiply that run by the pitch ratio: 18 × 8 ÷ 12 = 12 ft vertically above the wall reference elevation.
- Rafter length: use the right triangle: √(18² + 12²) = 21.63 ft along the slope.
Here both the full span and pitch differ from the first example. Work through the run before calculating rise; using the full building span as the run would double the reference dimensions. The larger geometric result does not show that an ordinary piece of dimensional lumber can carry the roof over this distance without additional support.
Example 4: 20 ft span with a 12:12 pitch
- Span: start with 20 ft measured horizontally between the wall reference lines.
- Run: divide the full span by two: 20 ÷ 2 = 10 ft from the wall to the ridge centerline in plan.
- Rise: multiply that run by the pitch ratio: 10 × 12 ÷ 12 = 10 ft vertically above the wall reference elevation.
- Rafter length: use the right triangle: √(10² + 10²) = 14.14 ft along the slope.
At this pitch the rise equals the horizontal run, but the sloping length is longer than either one. Adding the two equal legs would overstate the diagonal. Keep the square-root result at full precision during any later geometry and round only the displayed answer; two decimal places are a reporting choice, not a construction tolerance.
Rafter length by pitch and span
These are common-rafter lengths for a symmetrical gable, measured from the wall reference line to the ridge centerline; they exclude overhangs. Choose the full horizontal span down the left side and the pitch across the top. Each cell is a sloping length in feet, rounded to two decimal places. On a phone, swipe the table sideways if all columns do not fit.
| Full span (ft) | 4:12 | 6:12 | 8:12 | 10:12 | 12:12 |
|---|---|---|---|---|---|
| 20 | 10.54 | 11.18 | 12.02 | 13.02 | 14.14 |
| 24 | 12.65 | 13.42 | 14.42 | 15.62 | 16.97 |
| 28 | 14.76 | 15.65 | 16.83 | 18.22 | 19.80 |
| 32 | 16.87 | 17.89 | 19.23 | 20.83 | 22.63 |
| 36 | 18.97 | 20.12 | 21.63 | 23.43 | 25.46 |
Every cell uses length = √((span ÷ 2)² + ((span ÷ 2) × pitch ÷ 12)²). Here “pitch” means the rise number before the colon. A row compares roofs with the same width; a column compares different widths at the same slope. If your measured span falls between rows, enter it in the calculator instead of rounding the building width to the nearest table entry.
This is a length lookup table, not an allowable-span table. A structural span table answers a different question: how far a specified framing member can span under stated loads and support conditions. Neither the roof pitch nor the geometric length identifies lumber grade, species, member depth, bracing, or connection requirements. Keep those decisions with the approved framing design.
Pitch angles and the length multiplier
The angle is measured above horizontal. The multiplier converts horizontal run into sloping common-rafter length for the same right triangle. It is also the surface-area factor for a uniform roof plane. Use the full roof pitch chart to compare angles and area factorswhen translating between a pitch label and a measured angle.
| Pitch | Angle above horizontal | Length / area factor |
|---|---|---|
| 4:12 | 18.43° | 1.054 |
| 6:12 | 26.57° | 1.118 |
| 8:12 | 33.69° | 1.202 |
| 10:12 | 39.81° | 1.302 |
| 12:12 | 45.00° | 1.414 |
Multiply the horizontal run, not the full span, by the factor to estimate one common rafter. The table shows rounded factors for comparison; the calculator and worked examples use unrounded values. Do not multiply an already-sloping measurement by the factor again. That would apply the pitch correction twice and inflate the result.
For an existing roof, measure the roof pitch from a safe, accessible location before using these tables. A horizontal level reading and a vertical rise must refer to the same triangle. The tape distance along a rafter is the sloping side, not the run. Do not climb onto a roof just to obtain a measurement; use suitable plans or get professional help when access cannot be made safely.
Rafter spacing and how many rafters you need
Two common spacing layouts in U.S. residential framing are 16 inches and 24 inches on center, often written “o.c.” On-center spacing measures from the center of one rafter to the center of the next, along the building length parallel to the ridge. It is not the clear gap between the edges of the boards and it is not the wall-to-ridge run.
Spacing affects the number of rafters and the load assigned to each member, so it matters when checking allowable structural spans. It does not change the geometric length of an individual common rafter when pitch and run stay fixed. Selecting closer spacing here cannot prove a proposed lumber size is adequate. The American Wood Council’s span-table tutorial explains how spacing, loads, species, and grade enter structural checks.
For a simple layout with a rafter position at each end, count per side = ceil(roof length in inches ÷ on-center spacing in inches) + 1. The division counts spaces; adding one counts the endpoint member. “Ceil” means round upward to a whole number. Roof length here runs along the ridge, while full span in the length calculator runs across it.
| Roof length (ft) | 16 in o.c. — per side | 24 in o.c. — per side |
|---|---|---|
| 24 | 19 | 13 |
| 32 | 25 | 17 |
| 40 | 31 | 21 |
For the 24 ft roof length, convert to inches: 24 × 12 = 288 in. At 16 in o.c., ceil(288 ÷ 16) + 1 = 19 rafters per side. At 24 in o.c., ceil(288 ÷ 24) + 1 = 13 per side. Two matching sides would have 38 or 26 rafters respectively in this simplified layout.
These counts describe regular positions, not a final lumber order. End framing, openings, doubled members, dormers, hips, valleys, and changes in support can alter the actual schedule. Where the length is not an exact multiple of spacing, the final interval may be shorter; do not spread all positions farther apart to make a preferred count fit. Confirm the actual layout and its endpoints with the framing plan.
Rafter count does not tell you how much roofing to buy. First calculate the roof surface area from the horizontal footprint and pitch, including the relevant overhang footprint. Surface coverage and framing quantities are separate estimates: boards are counted by the framing layout, while sheathing and roof covering depend on area, product coverage, and the project’s waste allowance.
Common rafter vs hip rafter vs valley rafter
Common rafters follow a single roof plane
A common rafter runs up a roof plane from the wall toward the ridge, perpendicular to the ridge in plan on a simple rectangular gable. Its horizontal run and vertical rise form the right triangle used here. In the symmetrical case, the ridge centerline is halfway across the building span. Repeated common rafters on that same plane therefore share a reference length, even though the roof may extend much farther along the ridge.
Hip rafters follow an outside intersection
A hip rafter follows the outward corner where two roof planes meet. Its plan-view run travels diagonally across the building rather than straight across the common-rafter run. That different horizontal path changes the sloping length. The roof-plane pitch does not make a hip rafter interchangeable with a common rafter, and entering half the building width here will not describe that diagonal path.
Valley rafters follow an inside intersection
A valley rafter follows the inward intersection where roof planes meet, such as where an addition joins the main roof. Its location and length depend on the intersecting planes, their elevations, and their pitches. When the two sides have different pitches, the intersection shifts and the valley geometry changes. A single pitch plus a symmetric full span cannot capture that condition.
This calculator intentionally stops at common-rafter geometry. It has no inputs for the second roof plane or a diagonal intersection, so a hip or valley answer cannot be inferred from its result. Short jack rafters that terminate at a hip or valley also have individual runs; they should not all be assigned the full common-rafter length. Identify the member on the roof plan before choosing which measurements to use.
Separate reference geometry from framing details
The output stops at the ridge centerline and excludes the overhang. Actual framing needs adjustments for the selected ridge detail, ridge-board thickness, bearing location, birdsmouth, and end cuts. Those details belong in the framing layout, so the displayed result should not go straight onto a board as a finished cut length.
An overhang adds a rafter tail beyond the wall and needs its own horizontal projection and cut layout. Do not add a horizontal overhang directly to the sloping result as though those distances followed the same line. Keep reference dimensions clearly labeled on your sketch.
Check the roof shape before reusing the answer
Hip rafters, valley rafters, unequal slopes, and off-center ridges do not share the simple half-span geometry used here. Measure and lay out those conditions separately. For additions, also confirm where the existing and proposed roof planes meet instead of assuming matching wall widths create matching ridge heights.
Length alone does not determine rafter size or structural capacity. Lumber species, grade, spacing, connections, and design loads require the applicable framing tables or an engineered design. Use this result to check dimensions and discuss the layout, then follow the approved framing requirements for construction.