Rafter Length Calculator
Introduction
Calculating rafter length accurately is one of the most fundamental tasks in roof framing. Every common rafter must be cut to the precise slope length so that it spans from the ridge board to the wall plate with the correct bearing, while also extending past the wall to form the eave overhang. A rafter that is even an inch too short will not bear properly on the top plate, creating a structural deficiency that compromises the entire roof system. One that is too long requires costly field trimming and can throw off the ridge alignment for every subsequent rafter.
Despite the straightforward trigonometry involved, rafter length calculations are frequently performed incorrectly in the field. The most common errors include using the full span instead of the half-span run, forgetting to deduct half the ridge board thickness from the run, and failing to account for the birdsmouth drop at the bearing point. Each of these mistakes produces rafters that do not fit correctly, leading to wasted material, delayed schedules, and potential structural issues that an inspector will flag.
This calculator eliminates those problems by computing all critical rafter dimensions from your inputs. It provides the common rafter slope length, the rafter tail length, the total rafter length, and the header board deduction, all with a single click. A live SVG diagram updates as you enter values, letting you visualize the rafter profile before you mark a single piece of lumber. Whether you are framing a simple gable roof on a shed or laying out rafters for a full residential build, this tool gives you the precision needed to get the cut right the first time.
Rafter Length Calculator
Visual Diagram
Live diagram updates as you enter measurements.
How to Calculate Rafter Length: Complete Guide
What Is a Common Rafter?
A common rafter is the most basic and frequently used structural member in roof framing. It is a sloped beam that spans from the ridge board at the peak of the roof down to the top plate of an exterior wall. Common rafters run perpendicular to both the ridge and the wall plates, supporting the roof sheathing, underlayment, and finishing materials while transferring those loads into the wall structure below. Every gable roof requires common rafters on both sides, and they form the backbone of the roof's structural framework.
The length of each common rafter is determined by three primary factors: the horizontal distance it must cover (the run), the steepness of the roof (the pitch), and any additional length needed for overhangs. Understanding how these factors interact is essential for accurate framing. A rafter that is cut even slightly too short will not bear properly on the wall plate, creating a gap that reduces the bearing area and introduces concentrated loads. One that is too long must be trimmed in the field, which wastes time and can compromise the ridge alignment.
Understanding Run, Rise, and Pitch
Before calculating rafter length, you must understand the three geometric values that define the roof profile. The run is the horizontal distance from the outside face of the wall plate to the center of the ridge board. For a symmetrical gable roof, the run equals half the building span. If your building is 24 feet wide from outside wall to outside wall, the run is 12 feet (144 inches). For asymmetrical roofs such as saltbox designs, each side has its own independent run.
The rise is the total vertical distance from the top of the wall plate to the top of the ridge board. It is calculated by multiplying the run by the pitch ratio. For a 6/12 pitch over a 144-inch run, the rise equals 144 multiplied by 6/12, giving 72 inches. The rise is not entered directly into the calculator; it is derived from the run and pitch.
The pitch is expressed as the ratio of vertical rise to horizontal run in inches, always using 12 as the denominator. A 6/12 pitch means the roof rises 6 inches for every 12 inches of horizontal distance. The pitch determines the slope angle of the rafter, which directly controls its length. Using trigonometry, the pitch angle equals the arctangent of pitch divided by 12. For a 6/12 pitch, this gives approximately 26.6 degrees.
Step-by-Step: Calculating Rafter Length
- Determine the run. Measure the total building span and divide by two for a symmetrical gable roof. For asymmetrical roofs, measure each side independently from the wall plate to the ridge centerline.
- Deduct the ridge thickness. If a ridge board is used, subtract half its thickness from the run. For a standard 1.5-inch 2x ridge, subtract 0.75 inches. This gives the adjusted run that each rafter actually covers.
- Calculate the pitch angle. Take the arctangent of the pitch divided by 12. For a 6/12 pitch, the angle is arctan(0.5) = 26.565 degrees.
- Compute the common rafter length. Divide the adjusted run by the cosine of the pitch angle. This gives the straight-line distance from the ridge bearing point to the wall plate bearing point, measured along the slope of the rafter.
- Compute the tail length. Divide the horizontal overhang by the cosine of the pitch angle. This gives the sloped length of the rafter portion that extends past the wall plate.
- Add them together. The total rafter length equals the common rafter length plus the tail length. This is the total board length you need for each rafter.
Accounting for Ridge Thickness and Birdsmouth Drop
The ridge board sits between opposing rafters, so each rafter must be shortened by half the ridge thickness to fit correctly. Failing to account for this is one of the most common framing errors. If you use a 1.5-inch ridge board and forget the deduction, every rafter will be 0.75 inches too long, pushing the ridge out of position and throwing off the entire roof geometry.
The birdsmouth drop is the vertical heel height of the notch cut where the rafter bears on the wall plate. While the birdsmouth does not change the total board length, it affects the sloped distance along the rafter from the ridge to the bearing point. The sloped deduction equals the birdsmouth drop divided by the sine of the pitch angle. For a 0.75-inch birdsmouth drop at a 6/12 pitch, this deduction is approximately 1.68 inches. This calculator factors in the birdsmouth drop automatically.
IRC Maximum Rafter Spans Reference
The International Residential Code (IRC 2018 Table R802.4(1)) specifies maximum rafter spans based on lumber depth, on-center spacing, and load conditions. The table below lists maximum spans for common residential loads (30 psf live / 10 psf dead). These values assume a continuous bearing at the ridge and a simple span between supports.
| Lumber Size | Actual Depth | 12" OC | 16" OC | 19.2" OC | 24" OC |
|---|---|---|---|---|---|
| 2x6 | 5.5" | 15' 5" | 13' 8" | 12' 6" | 11' 2" |
| 2x8 | 7.25" | 20' 2" | 18' 0" | 16' 6" | 14' 8" |
| 2x10 | 9.25" | 25' 4" | 22' 6" | 20' 6" | 18' 4" |
| 2x12 | 11.25" | 30' 0" | 26' 8" | 24' 4" | 21' 8" |
Source: IRC 2018 Table R802.4(1). Values apply to #2 Southern Pine or Douglas Fir-Larch. Spans decrease for lower-grade lumber. Always verify with your local building department for jurisdiction-specific amendments.
Board Feet and Lumber Cost Estimation
Board feet (BF) is the standard unit of measurement for rough lumber in North America. One board foot equals a piece of wood that is 1 inch thick, 12 inches wide, and 12 inches long (144 cubic inches). The formula for calculating board feet for a single rafter is: BF = (Depth x Length) / 144, where depth and length are both in inches.
To estimate the total cost of rafter lumber, multiply the total board feet (including waste) by your local price per board foot. Lumber prices vary significantly by region, species, and grade. As of 2026, common framing lumber (SPF #2) typically costs $3.50 to $5.50 per board foot, while Douglas Fir-Larch #2 runs $4.50 to $7.00 per board foot. Always get current quotes from your local supplier, as prices fluctuate with market conditions.
Common Mistakes to Avoid
- Using span instead of run. Always remember that run equals span divided by two for a symmetrical gable. Using the full span produces rafters that are twice as long as needed.
- Forgetting the ridge deduction. The ridge board has physical thickness. Each rafter must be shortened by half that thickness to fit properly at the peak.
- Ignoring overhang units. The overhang is measured horizontally, not along the slope. The calculator converts it to sloped length automatically.
- Not rounding up for ordering. Lumber is sold in standard lengths (8, 10, 12, 14, 16 feet). Always round up to the next available length and add a waste factor of 10 to 15 percent.
- Using nominal lumber dimensions. A 2x10 is actually 9.25 inches deep, not 10 inches. Always use actual dimensions when calculating birdsmouth and structural limits.
Example: Framing a 20-Foot Span Gable Roof
Consider a standard 20-foot wide single-story home with a 7/12 roof pitch. The builder is using 2x8 rafters spaced 16 inches on center with a 1.5-inch ridge board and a 16-inch tail overhang. Here is how the rafter length calculation works out:
Step 1: The total span is 20 feet (240 inches). The run is half the span: 120 inches.
Step 2: Subtract half the ridge thickness: 120 - 0.75 = 119.25 inches. This is the adjusted run.
Step 3: Calculate the pitch angle: arctan(7/12) = arctan(0.5833) = 30.256 degrees.
Step 4: Calculate the common rafter length: 119.25 / cos(30.256 degrees) = 119.25 / 0.8637 = 138.07 inches (11 feet 6.07 inches).
Step 5: Calculate the tail length: 16 / cos(30.256 degrees) = 16 / 0.8637 = 18.52 inches.
Step 6: Total rafter length: 138.07 + 18.52 = 156.59 inches (13 feet 0.59 inches). The builder rounds up and orders 14-foot 2x8 lumber.
Step 7: The rafter count per side is ceil(119.25 / 16) + 1 = 8 + 1 = 9 rafters. For the gable roof, that is 9 times 2, or 18 common rafters total. With a 10 percent waste factor, the builder orders 20 pieces of 14-foot 2x8.
After cutting the first rafter and test-fitting it on the plates, the rafter length is verified with no adjustments needed. The builder uses this rafter as a pattern to mark and cut the remaining 17 rafters in under two hours. The accurate calculation eliminated the trial-and-error approach that often wastes an entire morning on a project this size, and the consistent cuts ensured the ridge stayed perfectly straight throughout installation.
Frequently Asked Questions About Rafter Length
Measure the horizontal run from the ridge to the outside of the wall plate, then add the tail overhang. Divide the total horizontal distance by the cosine of the pitch angle to get the sloped rafter length. The formula is: Rafter Length = (Run + Overhang) / cos(pitch angle), where pitch angle = arctan(pitch / 12). This calculator does all of that automatically.
Span is the total horizontal distance between the outside faces of two opposing walls. Run is half the span for a symmetrical gable roof, measured from the ridge to the outside wall plate. For example, a 24-foot span has a 12-foot run. Always use the run, not the span, when calculating rafter length.
Typical rafter tail overhangs range from 12 to 24 inches. A 16-inch overhang is common for standard residential eaves, while 24 inches or more is used for deeper eaves or craftsman-style architecture. The overhang length affects your soffit, fascia, and gutter placement. Enter your desired overhang in the calculator above to see how it affects total rafter length.
The birdsmouth cut does not change the total rafter board length, but it does affect the bearing geometry. The birdsmouth drop is the vertical heel height at the wall plate. The sloped deduction along the rafter equals the birdsmouth drop divided by the sine of the pitch angle. This calculator accounts for birdsmouth drop in its measurements.
When a ridge board is used between opposing rafters, you must subtract half the ridge thickness from the run before calculating rafter length. For a standard 1.5-inch thick 2x ridge board, subtract 0.75 inches from each rafter's run. This calculator performs this deduction automatically when you enter the ridge thickness.
A common rafter runs perpendicular to the ridge and wall plates, straight from peak to eave along the roof slope. A hip rafter runs diagonally from the ridge to an outside corner, forming the hip where two roof planes meet. Hip rafters are approximately 1.414 times longer than common rafters for the same run and pitch because they span a diagonal path.
Count rafters per side by dividing the run in inches by the on-center spacing (16 or 24 inches) and adding one for the end rafter. For a gable roof, multiply by two sides. For example, a 12-foot (144-inch) run at 16-inch spacing requires ceil(144/16) + 1 = 10 rafters per side, or 20 total for both sides of the gable.
Yes. Toggle between imperial (inches and feet) and metric (millimeters and meters) using the unit switch at the top of the calculator. All input labels and placeholders update automatically. Results are displayed in both unit systems so you can cross-reference. The conversion factor used is 1 inch = 25.4 mm.
Most residential roofs use a pitch between 4/12 and 12/12. A 6/12 pitch (approximately 26.6 degrees) is the most common for standard gable roofs. Low-slope roofs use 2/12 to 4/12 and require special underlayment. Steep roofs may use 10/12 or higher for aesthetic appeal or to shed snow in cold climates.
Higher pitch produces a steeper angle and a longer rafter for the same horizontal run. A 12/12 pitch rafter is approximately 13.4% longer than a flat rafter for the same run. The mathematical relationship is: Length = Run / cos(pitch angle). As pitch increases, the cosine of the angle decreases and the rafter length increases proportionally.
The IRC specifies maximum rafter spans based on lumber depth, spacing, and loading conditions. For a typical residential roof with 16-inch on-center spacing, 2x8 (7.25" actual) handles spans up to 18 feet, while 2x10 (9.25" actual) extends to 22' 6". For runs exceeding these limits, or for heavier snow loads, consult an engineer. This calculator recommends lumber sizes based on your specific run and spacing inputs using IRC Table R802.4(1).
Board feet (BF) equals (lumber depth in inches x rafter length in inches) / 144. For example, a 2x8 (7.25" actual depth) rafter that is 14 feet (168 inches) long contains 7.25 x 168 / 144 = 8.46 board feet. Multiply by the total number of rafters and add 10-15% for waste to get your total order quantity. This calculator computes board feet automatically when you enter the lumber depth and price per board foot.
"On-center" (OC) means the distance is measured from the center of one rafter to the center of the next, not from edge to edge. Standard spacings are 16" or 24" OC. At 16" OC, you get more rafters per foot of run, which increases structural capacity and allows longer spans. At 24" OC, fewer rafters are needed but each rafter must carry more load, limiting the maximum span. Choose spacing based on your span requirements and local code.