📚 What's in This Guide
A rafter calculator finds how long each rafter must be for a roof, given the building span and the roof pitch. This free online common rafter calculator also handles the details that decide whether a cut rafter actually fits: the eave overhang, the ridge board deduction, the plumb-cut allowance on the board, and a birdsmouth check on the notch. It then counts how many rafters the roof needs at your chosen spacing. It is built for builders framing a gable, shed, garage or addition, and for homeowners who want to understand a framing quote or a lumber list. Enter your measurements in the calculator above, then use this guide to understand each result before you cut any lumber.
Rafter line length = run × √(1 + slope²), where slope = rise ÷ run. For a gable roof the run is half the span. At 6:12 the multiplier is 1.118, so a 12 ft run gives a rafter line length of 13 ft 5 in, before overhang and ridge adjustments.
1. How the Rafter Calculator Works
You enter the roof type, the building span, and the slope, either as a pitch or as the rise from the wall plate to the ridge. The calculator converts the span to a run, turns the slope into a pitch multiplier, and multiplies the run by it to get the rafter line length. As a rafter calculator with overhang, it then adds the sloped length of the eave overhang, subtracts half of the ridge board thickness on a gable roof, and reports the rafter length along the top edge. If you add the rafter depth, it adds the plumb-cut allowance to give a minimum board length and a minimum stock length. If you add the seat length, it checks the birdsmouth notch. If you add the roof length and spacing, it counts the rafters.
If you only know the angle, or want to measure the slope of an existing roof, our Roof Pitch Calculator converts between x:12, degrees and percent and includes a full roof pitch chart with roof pitch angles. The rafter calculator accepts all three formats directly, so you can also enter the pitch here.
The calculator is for common rafters: straight rafters running from the wall plate to the ridge on a gable roof, or from wall to wall on a shed roof, at one constant pitch with level plates. It does not calculate hip, valley or jack rafters, ridge beams, collar ties or trusses, and it does not size rafters or check spans and loads. Lengths are shown to the nearest 1/16 inch. Treat the results as planning figures, and cut one test rafter before you cut the rest.
2. How to Use the Rafter Calculator
- Choose the roof type, gable or shed, and your units: inches, feet, feet and inches, millimeters or meters.
- Enter the span, measured from the outside face of one wall to the outside face of the other.
- Choose how you know the slope. Enter the pitch as x:12, degrees or percent, or use the quick pitch buttons. If you know the ridge height instead, switch to rise.
- Enter the eave overhang, measured horizontally, and for a gable roof the ridge board thickness.
- Optionally pick the rafter size and the wall plate width to get the birdsmouth check and the minimum board length.
- Optionally enter the roof length and the spacing to get the rafter count and total lumber.
- Read the results, then copy, share or download them as a PDF.
Your entries convert automatically if you change units later. The pitch can be up to 130:12, 85° or 1,000%, and lengths can be up to 1,000 feet. If a value is outside the allowed range, the calculator says so and uses the nearest allowed value.
3. Rafter Length Formula
Run = Span ÷ 2 (gable) | Run = Span (shed)
Slope = Rise ÷ Run = x ÷ 12 = tan(angle)
Multiplier = √(1 + Slope²)
Rafter line length = Run × Multiplier = √(Run² + Rise²)
Rafter length = (Run + Overhang − Ridge thickness ÷ 2) × Multiplier
Minimum board length = Rafter length + Rafter depth × Slope
Notch depth = Seat length × sin(angle) | Heel cut height = Seat length × Slope
Rafters per side = ⌈Roof length ÷ Spacing⌉ + 1
Where run is the horizontal distance from the outside of the wall to the ridge centerline, rise is the vertical height from the wall plate to the top of the ridge, overhang is the horizontal distance the rafter extends past the wall, and the brackets ⌈ ⌉ mean round up. All lengths must use the same unit. The pitch itself has no unit, so 6:12 is the same slope in inches, feet or millimeters.
To figure rafter length by hand, find the run, turn the pitch into a multiplier and multiply. These rafter length calculations are exactly what the tool runs. The multiplier comes from the Pythagorean theorem. A run of 1 and a rise of 0.5 give a sloped length of √(1 + 0.25) = 1.118. The overhang and the ridge deduction are horizontal distances, so they are multiplied by the same factor to convert them to lengths along the slope. The plumb-cut allowance exists because a vertical cut across a sloped board leaves the bottom edge longer than the top edge by the board's depth times the slope.
4. Worked Example
A gable roof covers a building 24 feet wide and 30 feet long. The pitch is 6:12, the rafters overhang the wall by 12 inches, the ridge board is 1½ inches thick, the rafters are 2x8 (7.25 inches deep), the wall plate is 3.5 inches wide, and the rafters are spaced 16 inches on center. To reproduce it, enter these values, including the optional ones, in the calculator.
| Step | Calculation | Result |
|---|---|---|
| Run | 24 ft ÷ 2 | 12 ft = 144 in |
| Slope and rise | 6 ÷ 12 = 0.5; 144 × 0.5 | 72 in = 6 ft rise |
| Multiplier | √(1 + 0.5²) | 1.1180 |
| Rafter line length | 144 × 1.1180 | 161.00 in = 13'-5" |
| Overhang tail | 12 × 1.1180 | 13.42 in = 1'-1 7/16" |
| Ridge deduction | (1.5 ÷ 2) × 1.1180 | 0.84 in = 13/16" |
| Rafter length (top edge) | 161.00 + 13.42 − 0.84 | 173.57 in = 14'-5 9/16" |
| Plumb-cut allowance | 7.25 × 0.5 | 3.63 in |
| Minimum board length | 173.57 + 3.63 | 177.20 in = 14'-9 3/16" |
| Stock length | Next standard length up | 16 ft |
| Notch depth | 3.5 × sin(26.57°) | 1.57 in (21.6% of 7.25 in) |
| Rafters | ⌈360 ÷ 16⌉ + 1 = 24 per side | 48 rafters |
The table rounds each step for display, so adding the rounded figures can differ by 0.01 inch. The calculator carries full precision. Each rafter needs a 16 foot board, so the whole roof needs 48 boards, or 768 lineal feet before any waste. The notch is within the one-fourth limit discussed below, so a 2x8 on a 2x4 wall works at this pitch.
5. Understanding Your Result
The calculator reports several lengths because framers use several. The rafter line length is the theoretical length from the outside of the wall to the ridge centerline, not the cut length. The rafter length adds the overhang tail and subtracts the ridge deduction, and is the distance you mark along the top edge of the board, from the plumb cut at the ridge to the plumb mark at the tail. The minimum board length adds the plumb-cut allowance, because the longest point of the finished rafter is at the bottom of the tail cut. The minimum stock length is the shortest standard board that is at least that long.
The results are exact for the numbers you enter, but real framing is not: walls are rarely perfectly level and spans vary by a fraction of an inch. Keep full precision until you mark the board, cut one test rafter, and if the stock length leaves almost no spare, order the next size up.
To determine or measure rafter length on an existing roof, run a tape along its top edge from the ridge cut to the plumb mark at the tail, and compare it with the calculated rafter length. The numbers help you decide which board length to buy, how many pieces to order, and where to mark the cuts. They do not tell you whether the rafter is strong enough for your loads, which is a separate span-table question covered below.
6. Birdsmouth Cut Calculator and Notch Limits
A birdsmouth is the notch that lets a rafter sit on the wall plate. It has a level seat cut that bears on the plate and a plumb heel cut. With a seat length equal to the plate width, the heel cut height is the seat length times the slope, and the notch depth, measured square to the rafter edge, is the seat length times sin(angle). The calculator shows both, plus the percentage of the rafter's depth that the notch removes.
Two limits matter. The IRC generally limits a notch at the end of a rafter to one-fourth of the rafter's depth, and requires at least 1½ inches of bearing on wood. As the Journal of Light Construction explains in its guide to sizing the birdsmouth, the seat should also be no wider than the plate, and a steep pitch can over-notch a rafter even when the seat is only as wide as the plate.
Here is how that plays out. A 2x6 rafter is 5.5 inches deep, so one-fourth is 1.375 inches. On a 2x4 wall (3.5 inch plate) at 6:12, the notch is 3.5 × sin(26.57°) = 1.57 inches, which is over the limit. The same 2x4 wall at 6:12 with a 2x8 rafter is fine, because one-fourth of 7.25 inches is 1.81 inches. If the check fails, use a deeper rafter, a shorter seat that still bears at least 1½ inches, or confirm the detail with your inspector or engineer. Treat this as a preliminary check of notch depth only. Passing it does not establish structural adequacy or code compliance, and bearing, uplift connections, the code edition in force and local requirements must be confirmed.
7. Rafter Length Table
This table gives the common rafter line length for common pitches and runs, with no overhang or ridge deduction. For a run that is not in the table, multiply the run by the multiplier. For example, a 9 ft run at 8:12 is 9 × 1.2019 = 10.82 ft, or 10'-9 13/16".
| Pitch | Multiplier | Run 4 ft | Run 6 ft | Run 8 ft | Run 10 ft | Run 12 ft | Run 14 ft |
|---|---|---|---|---|---|---|---|
| 3:12 | 1.0308 | 4'-1 1/2" | 6'-2 3/16" | 8'-2 15/16" | 10'-3 11/16" | 12'-4 7/16" | 14'-5 3/16" |
| 4:12 | 1.0541 | 4'-2 5/8" | 6'-3 7/8" | 8'-5 3/16" | 10'-6 1/2" | 12'-7 13/16" | 14'-9 1/16" |
| 5:12 | 1.0833 | 4'-4" | 6'-6" | 8'-8" | 10'-10" | 13'-0" | 15'-2" |
| 6:12 | 1.1180 | 4'-5 11/16" | 6'-8 1/2" | 8'-11 5/16" | 11'-2 3/16" | 13'-5" | 15'-7 13/16" |
| 7:12 | 1.1577 | 4'-7 9/16" | 6'-11 3/8" | 9'-3 1/8" | 11'-6 15/16" | 13'-10 11/16" | 16'-2 1/2" |
| 8:12 | 1.2019 | 4'-9 11/16" | 7'-2 9/16" | 9'-7 3/8" | 12'-0 1/4" | 14'-5 1/16" | 16'-9 15/16" |
| 9:12 | 1.2500 | 5'-0" | 7'-6" | 10'-0" | 12'-6" | 15'-0" | 17'-6" |
| 10:12 | 1.3017 | 5'-2 1/2" | 7'-9 3/4" | 10'-4 15/16" | 13'-0 3/16" | 15'-7 7/16" | 18'-2 11/16" |
| 12:12 | 1.4142 | 5'-7 7/8" | 8'-5 13/16" | 11'-3 3/4" | 14'-1 11/16" | 16'-11 5/8" | 19'-9 9/16" |
8. Rafter Spacing, Span and Size
Rafter spacing is the center-to-center distance between neighbors, called on center. The common choices are 12, 16, 19.2 and 24 inches, and in metric regions 300, 400, 450 or 600 millimeters. The right spacing depends on the rafter size, lumber species and grade, span, and the roof and snow loads, so spacing is chosen together with the rafter size, not on its own. Closer spacing lets a given board span further but needs more pieces. Used as a rafter spacing calculator, the tool lays rafters out at your spacing from one end and adds one at the far end, so a 30 ft roof at 16 in on center gets 22 full bays plus a shorter 8 in bay, or 24 rafters per side.
Rafter spans are a different number from rafter length. The span in a span table is the horizontal distance a rafter covers between supports, not the sloped length of the board, so a 12 ft horizontal span at 6:12 uses a rafter that is about 13 ft 5 in long. Rafter size, also called rafter dimensions, comes from span tables. This calculator is not a rafter span calculator in the structural sense, because it does not check allowable spans. The American Wood Council's free Maximum Span Calculator for Wood Joists and Rafters finds code-permitted spans by species, grade and spacing, so it doubles as a rafter dimensions calculator, and the IRC includes prescriptive rafter span tables. Use those for sizing, then use this calculator for lengths and quantities.
When you pick a size, remember that lumber is sold by nominal size but measured by actual size. A 2x4 is 1.5 by 3.5 inches, a 2x6 is 1.5 by 5.5, a 2x8 is 1.5 by 7.25, a 2x10 is 1.5 by 9.25, and a 2x12 is 1.5 by 11.25. The calculator's size buttons use these actual depths.
9. Shed Roof and Gable Roof Rafters
On a gable roof, two sets of rafters meet at a ridge board, so each rafter runs half the span and you deduct half of the ridge thickness. On a shed roof, a single slope runs from a high wall to a low wall, so the run is the full span, there is no ridge board, and the high end is cut plumb at the outside face of the high wall. The calculator assumes this for shed roofs and applies the overhang to the low side only.
For a shed roof, the rise is the height difference between the two wall plates. If you know the pitch you want, enter it and read the rise to learn how much taller the high wall must be. If you know the wall heights instead, switch to rise and read the pitch. Used as a shed roof rafter calculator, it gives the length and count for the single set of rafters in one pass. Shed roofs often use lower pitches than gable roofs, so check the roofing manufacturer's minimum slope before you settle on one. The rafter count for a shed roof is a single set, so the total is the per-side count.
10. Units and Conversions
The calculator works in inches, feet, feet and inches, millimeters and meters, and converts automatically. One inch is exactly 25.4 millimeters, and one foot is 304.8 millimeters. Small dimensions, such as the ridge board thickness, rafter depth and seat length, are entered in inches or millimeters. The pitch has no unit, so x:12, degrees and percent are the same in every system. Standard stock lengths are shown only in feet, because North American dimensional lumber is commonly sold in 2 ft steps from 8 to 24 ft.
11. Practical Tips
- Mark all rafters from one pattern rafter, and check it on the building first.
- Round board lengths up to the next standard stock length, and order a few extra boards for mistakes.
- Confirm rafter size, spacing and connections with your plans, span tables and local code.
12. Common Mistakes
- Using the full span as the run on a gable roof: this doubles the rafter length. A gable run is half the span.
- Adding the overhang along the slope: the overhang is horizontal, so it must be multiplied by the pitch multiplier first.
- Forgetting the ridge board: without the deduction, each rafter is slightly too long and the ridge ends up too wide.
- Ordering the exact calculated length: the board must also cover the plumb-cut allowance and trimming.
- Over-notching the birdsmouth: a deep seat on a shallow rafter at a steep pitch removes too much wood.
- Mixing up span and length: span tables use the horizontal span, not the sloped rafter length.
- Counting rafters without the end rafter: a roof 30 ft long at 16 in on center needs 24 per side, not 22.
13. Related Calculations and Use Cases
This roof rafter length calculator is useful when framing a garage, shed, porch, addition or cabin roof, when checking a framing quote or a lumber list, when ordering rafter stock, and when planning cuts before you pick up a saw. A roof framing calculator like this one turns a few measurements into a cut list, a stock list and a rafter count. Hip, valley and jack rafters, ridge beams and trusses need separate calculations.
14. Frequently Asked Questions
Find the run, which is half the span for a gable roof, then multiply it by the pitch multiplier √(1 + slope²), where slope is rise ÷ run. Add the sloped length of the overhang and subtract half the ridge board's sloped thickness. For a building 24 ft wide at 6:12, the run is 12 ft, the multiplier is 1.1180, and the rafter line length is 13 ft 5 in before overhang and ridge adjustments.
Yes. The overhang is measured horizontally, so multiply it by the same pitch multiplier and add it to the line length. A 12 in overhang at 6:12 adds about 13.42 in along the slope. If your rafters meet a ridge board, also subtract half of its thickness times the multiplier, which is about 0.84 in for a 1½ in ridge board at 6:12.
Rafters are most often spaced 16 or 24 inches on center, and 12 and 19.2 inches are also used. The allowable spacing depends on the rafter size, species and grade, span, roof and snow loads, and your local code, so check span tables or the American Wood Council's span calculator rather than choosing a spacing from habit. Closer spacing lets a given board span further but needs more pieces.
This calculator finds the length, not the size. Rafter size comes from span tables that account for lumber species and grade, spacing, and roof and snow loads, such as the IRC tables or the American Wood Council's free span calculator. Remember that span tables use the horizontal span, not the sloped length of the rafter.
The IRC's general limit for a notch at the end of a rafter is one-fourth of the rafter's depth (R802.7.1), so a 2x8 rafter, which is 7.25 in deep, should have a notch no deeper than about 1.8 in. The seat should also bear on at least 1½ in of the plate but be no wider than the plate. Local code and engineered framing can differ.
Conclusion
A rafter calculator turns a building span and a pitch into the lengths you actually cut: the line length, the full length with overhang and ridge deduction, and a minimum board length that covers the plumb cut. Accurate span, pitch and overhang measurements matter most, because every result scales with the pitch multiplier, √(1 + slope²). Use the birdsmouth check and the rafter count to plan notches and lumber before you buy. Treat the numbers as planning figures, cut one test rafter, and confirm sizing, spacing and connections with your plans and local code. Then use the calculator above whenever the span or pitch changes.
This calculator is for planning purposes only. Rafter size, spacing, notching and connections must follow your plans, span tables and local building code. Confirm all quantities with your supplier before ordering.