Rafter Length Calculator
Calculate exact common, hip, and valley rafter lengths for any roof pitch and building span — with bird's mouth dimensions and lumber sizing.
Enter your building's width, roof pitch, and overhang, and this calculator works out common rafter length, hip/valley rafter length, ridge board length, and total rafter count — all with a bird's mouth cut depth and recommended lumber size included. A 10% waste allowance is applied by default to the rafter count.
General residential guideline by rafter span. Always verify against local span tables (e.g. IRC Table R802.4) for your specific spacing, species, and snow/live load.
| Rafter span | Typical lumber size |
|---|---|
| Under 10 ft (3.0 m) | 2×6 |
| 10–16 ft (3.0–4.9 m) | 2×8 |
| 16–20 ft (4.9–6.1 m) | 2×10 |
| Over 20 ft (6.1 m) | 2×12 or engineered lumber |
How rafter length is calculated
Every rafter length calculation starts from the same two numbers: run (the horizontal distance the rafter travels) and rise (the vertical distance it climbs over that run). Once those two are known, the rafter itself is simply the hypotenuse of the right triangle they form — a direct application of the Pythagorean theorem that's been used to frame roofs for centuries, long before calculators existed to do the arithmetic.
For a gable or simple hip roof, run is half the building’s total width (since the roof slopes down from a central ridge to each side wall), adjusted slightly for half the ridge board’s thickness. Rise is the run multiplied by the roof’s pitch ratio — pitch expressed as “rise per 12 inches of run,” so a 6/12 pitch rises 6 inches for every 12 inches of horizontal run.
Worked example — 28 ft wide building, 6/12 pitch, 1.5 ft overhang:
- Run: 28 ÷ 2 − (1.5 in ridge ÷ 2 ÷ 12) ≈ 13.94 ft
- Pitch ratio: 6 ÷ 12 = 0.5
- Rise: 13.94 × 0.5 = 6.97 ft
- Rafter angle: atan(0.5) = 26.6°
- Overhang length: √(1.5² + (1.5×0.5)²) = √(2.25 + 0.5625) ≈ 1.68 ft
- Common rafter: √(13.94² + 6.97²) + 1.68 = √(194.3 + 48.6) + 1.68 ≈ 15.59 + 1.68 = 17.27 ft
The same building in metric — 8.53 m wide, same 6/12 pitch, 0.46 m overhang — gives a run of about 4.25 m, a rise of about 2.12 m, and a common rafter length of roughly 5.27 m. The physical roof is identical either way; only the units used to describe it change.
Hip and valley rafters
A common rafter runs perpendicular from the ridge straight down to the wall plate — the simplest case. A hip rafter (on a hip roof’s outside corners) or a valley rafter (where two roof planes meet at an inside corner) runs diagonally instead, connecting the ridge corner to the building corner at roughly a 45-degree angle in plan view.
Because a hip or valley rafter travels diagonally, it covers a longer horizontal distance for the same span — its run is effectively the diagonal of a square with sides equal to the common rafter’s run, which is why the formula includes run² twice rather than once. This is also why hip rafters use a different “unit length” figure in framing tables: where a common rafter travels 12 inches of run for every foot, a hip or valley rafter travels roughly 16.97 inches for the same foot of building run (17 in tables that round to a whole number, or more precisely 13.42 inches per foot of common rafter run at a 45° hip angle, depending on which reference length the table uses — always check which convention your source is using before cross-referencing rafter tables by hand).
Hip and valley rafters also require compound angle cuts at both ends — a cut that combines the roof’s pitch angle with a 45-degree plan angle — which is considerably more complex to lay out than a common rafter’s single-angle plumb cut. This is one of the main reasons hip roofs cost more in labor than simple gable roofs, even when the total roof area is similar.
Jack rafters — the shorter rafters that run between a hip or valley rafter and the wall plate or ridge — are a related piece of the same framing system. Each jack rafter in a sequence is a fixed amount shorter than the one before it, based on its position along the hip and the rafter spacing, which is why jack rafter layout is typically handled with a dedicated step-off or framing-square method on site rather than calculated individually for each piece. This calculator focuses on the common and hip/valley rafter lengths that anchor the roof’s geometry; jack rafter lengths are derived from those anchor lengths during layout.
Roof pitch and angle
Roof pitch in the US is conventionally expressed as a ratio — rise per 12 inches of run — rather than as a simple angle in degrees. A “6/12” roof rises 6 inches for every 12 inches of horizontal run; a “12/12” roof rises a full inch for every inch of run, a 45-degree angle.
| Pitch | Angle | Typical use |
|---|---|---|
| 3/12–4/12 | 14.0°–18.4° | Low-slope, some roofing materials require min. 3/12 |
| 5/12–7/12 | 22.6°–30.3° | Most common residential range |
| 8/12–9/12 | 33.7°–36.9° | Steeper, common in snow-load regions and traditional styles |
| 10/12–12/12 | 39.8°–45.0° | Steep, dramatic rooflines, maximum shedding of snow/water |
Steeper pitches shed water and snow more effectively and are often required or strongly preferred in heavy-snow climates, but they also mean longer rafters, more roofing material per square foot of building footprint, and a taller overall structure. Shallower pitches use less material and create a lower profile but may not be rated for every roofing material — asphalt shingles, for example, typically require a minimum pitch around 2/12 to 3/12 with special underlayment, and standard shingle installation is more commonly rated starting around 4/12.
Pitch also directly affects the total roofing surface area, and therefore the quantity of shingles, underlayment, and roofing nails needed. A roof’s actual surface area is larger than its footprint by a factor related to the pitch — a 6/12 roof adds roughly 12% more surface area than the flat footprint below it, while a steeper 12/12 roof adds over 41% more. This “roof area factor” is worth keeping in mind when budgeting a project: pitch decisions made for aesthetic or drainage reasons ripple through into every material quantity on the roof, not just the rafters.
Bird's mouth cuts and lumber sizing
A bird’s mouth is the notch cut into the underside of a rafter where it rests on the wall’s top plate. It consists of two cuts: a plumb cut (vertical, parallel to the rafter’s overall slope) and a seat cut (horizontal, resting flat on the top plate). The plumb cut’s depth is set by the wall plate’s width — 3.5 inches (89 mm) for a standard 2× wall plate — and the seat cut is generally limited to no more than about one-third of the rafter’s total depth, to avoid weakening the rafter at its most heavily loaded point.
Rafter lumber size is driven primarily by span (the rafter’s length), spacing, and roof load (snow load, live load, and dead load from roofing material). As a general residential guideline: spans under 10 feet typically use 2×6, 10–16 foot spans use 2×8, 16–20 foot spans use 2×10, and anything beyond 20 feet moves to 2×12 or engineered lumber (I-joists or LVL). These are starting points, not final answers — actual sizing depends on your local snow load and the specific span tables in your adopted building code, such as IRC Table R802.4 for rafter spans, which cross-references species, grade, spacing, and load to a required lumber size.
Waste allowance and lumber ordering
Rafter cutting produces waste at both the ridge end (plumb cut) and the tail end (overhang cut and bird’s mouth notch), and every rafter needs to be cut individually to fit its exact position on the roof.
| Roof complexity | Recommended waste |
|---|---|
| Simple gable roof, no hips or valleys | 5% |
| Standard roof with some hips or valleys | 10% |
| Complex roof, many hips/valleys, dormers | 15% |
10% is a reasonable default for most residential roofs and is applied automatically by the calculator above to the total rafter count. Complex rooflines with multiple hips, valleys, and dormers benefit from the higher 15% allowance, both because there are more individual cut lengths to account for and because layout mistakes become more likely as the number of distinct rafter types increases.
Real-world applications
A simple gable addition, say a 24 ft wide room addition with a 6/12 pitch and 1 ft overhang, typically needs common rafters around 14–15 feet long, all identical in length and cut angle — the simplest and most economical roof framing scenario, since every rafter uses the same cut pattern.
A hip roof on a detached garage, perhaps 24 × 24 ft with an 8/12 pitch, needs common rafters on all four sides plus four hip rafters at the corners — each hip rafter noticeably longer than the common rafters and requiring compound-angle cuts at both the ridge and the tail. This is a good example of a project where getting the hip rafter formula right matters, since a hip rafter cut to a common-rafter length would come up noticeably short.
A roof addition tying into an existing structure — a common remodeling scenario — frequently creates one or more valleys where the new roof plane meets the old one. Valley rafters use the same 3D-diagonal formula as hip rafters but sit at an internal corner rather than an external one, and because they’re tying into existing framing, field verification of the actual existing pitch and ridge height matters more than working purely from the calculated numbers.
A shed roof over a porch or lean-to addition is the simplest rafter scenario of all — a single sloped plane with no ridge, no hips, and no valleys. Here the “run” is simply the full horizontal depth of the porch or addition (not half the building width, since there’s no opposing slope), and the rafter length calculation reduces to the same Pythagorean formula with that full run. Because shed roofs often use a shallower pitch to keep the structure low against an existing wall, double-check that the chosen pitch still meets the minimum slope rating for whatever roofing material will be installed.
When to consult a professional
This calculator estimates standard rafter geometry for planning and material takeoff — it is not a substitute for a stamped structural drawing or a building permit review. Involve a licensed engineer, architect, or your local building department before proceeding in these situations:
- Any roof framing in new construction or a structural addition — a building permit and inspection are typically required before framing begins
- Spans, snow loads, or configurations beyond simple residential guidelines — always verify final lumber size against your local code’s span tables (such as IRC Table R802.4) rather than the general guidance in this article
- Complex rooflines — multiple hips, valleys, dormers, or unusual roof shapes benefit from a detailed framing plan, since small errors compound quickly across many interdependent rafter lengths and cut angles
- High snow-load or high-wind design regions, where prescriptive tables may require larger lumber, tighter spacing, or additional bracing not captured by this calculator’s general guidance
- Any rafter tying into or replacing existing structural framing, where the actual as-built dimensions may differ from original plans
For a straightforward gable or simple hip roof within standard residential spans, the numbers above are a reliable starting point for material planning — just confirm your final framing plan against local code requirements before cutting lumber or pulling a permit.
Common mistakes to avoid
- Forgetting the overhang in the rafter length. The common rafter formula above already accounts for it, but if you’re checking figures by hand, it’s a frequently missed addition — a rafter cut only to the ridge-to-wall-plate length will come up short at the eave.
- Using the common rafter formula for hip or valley rafters. Hip and valley rafters travel a longer diagonal distance and need their own formula — substituting the common rafter length will leave hip/valley rafters noticeably too short.
- Ignoring ridge board thickness. Subtracting half the ridge board’s thickness from each side’s run is a small adjustment, but skipping it introduces a small, consistent length error across every rafter on the roof.
- Sizing lumber from span alone, ignoring load. The lumber-size guideline in this article is based on span only — always verify against your local code’s span tables, which also factor in snow load, spacing, and lumber species/grade, before finalizing a lumber order.
- Skipping the waste allowance on complex roofs. A simple gable roof can often get away with minimal waste, but a hip roof with several different rafter lengths and cut angles benefits from a larger cushion, since a single miscut board on a less common rafter type may not have a same-length replacement on hand.
- Not accounting for rafter spacing when estimating a lumber order. Rafter count depends on spacing (12, 16, or 24 inch OC) just as much as it depends on building length — a quick mental estimate that ignores spacing can be significantly off from the calculator’s actual count.
- Assuming the printed pitch matches the built pitch. Existing roofs, especially older ones, sometimes settle or were never framed to the pitch shown on original plans. When tying new rafters into an existing roof, measure the actual in-place rise and run directly rather than trusting a plan set or a previous calculation, since even a small real-world discrepancy compounds across a full hip or valley rafter length.