Rafter Length Calculator
Daniel Brooks is a civil engineer with 10 years of experience and the founder of RoofPitchCalculator.org. He develops the site's calculators and technical guides around transparent formulas, geometry and clearly stated assumptions.
About Daniel →On this page
Related Roofing Calculators
Continue with another tool when the next step needs a different roof measurement.
Enter your roof measurements
Choose the geometry and slope format that match the measurements you already have.
Overhang & advanced geometry
Enter valid measurements to see the calculation.
Birdsmouth geometry reference
Rafter length is the sloping distance between the rafter’s horizontal support points. For a basic common rafter, it can be calculated from the horizontal run and vertical rise using the Pythagorean theorem. This calculator also lets you work from roof pitch, angle or slope percentage, and can optionally account for horizontal overhang and ridge-board thickness.
How to Use the Rafter Length Calculator
This free rafter length calculator is designed for both common rafters on a symmetrical gable roof and shed or lean-to rafters. You do not need to know every roof dimension before you start. Choose the measurements you already have, and the calculator converts them into the geometry needed to work out the rafter line length.
- Choose the roof type. Select Gable / common rafter for one side of a symmetrical pitched roof, or Shed / lean-to rafter for a single-slope roof.
- Enter the horizontal measurement. For a gable roof, you can enter the full building span or enter the rafter run directly. For a shed roof, enter the horizontal distance between the bearing lines.
- Choose how you know the roof slope. Enter an x:12 roof pitch, roof angle in degrees, known rise, or slope percentage.
- Add optional framing geometry. Open the advanced section if you want the rafter length calculator with overhang, ridge-board deduction or the birdsmouth geometry reference.
- Read the live results. The tool returns the rafter line length together with the effective run, rise, roof angle, equivalent pitch, slope percentage, pitch factor and any sloped overhang.
If you only need to convert a known pitch into degrees or compare common roof slopes, our roof pitch chart gives a quick reference. If you need to calculate the pitch itself from measurements, use the main Roof Pitch Calculator.
Rafter Length Formula
A common rafter forms the hypotenuse of a right triangle. The horizontal run is one side of that triangle and the vertical rise is the other. The basic rafter length formula is therefore:
Run and rise must use the same units. The result will then be in that same unit.
When the roof pitch is entered as an x:12 ratio, the rise can be calculated from the run:
The second part of that formula is often called the pitch factor. A 6:12 roof has a pitch factor of about 1.1180, so every 1 foot of horizontal run corresponds to about 1.118 feet along the roof slope.
Building Span vs Rafter Run
One of the most common sources of error in a roof rafter length calculation is confusing building span with rafter run.
For a centred symmetrical gable roof, the basic run is half the building span:
For example, a 24 ft wide building has a 12 ft run on each side before any ridge-board adjustment. If you already know the run, choose Run directly rather than entering the full span.
A shed or lean-to roof is different. Its rafter normally crosses the full horizontal distance between the low and high bearing lines, so the run is not divided by two.
How Ridge Board Thickness Changes the Rafter Length
When two common rafters meet against the faces of a ridge board, the geometric run to the rafter’s ridge plumb cut is slightly shorter than the run to the ridge centreline. If you enter the ridge-board thickness in the advanced settings, this calculator deducts half of that thickness from each side.
Rafter Length Calculator With Overhang
The overhang option is useful when you want the geometric line length from the ridge face all the way to the rafter tail rather than only the wall-to-ridge portion.
Enter the overhang as a horizontal projection. The calculator converts that horizontal dimension into the longer sloping distance along the rafter using the same pitch factor as the main roof.
For example, a 12 in horizontal overhang on a 6:12 roof adds about 13.42 in along the slope. Simply adding 12 in to the rafter line would therefore understate the required geometric length.
Shed and Lean-To Rafter Length
The shed rafter length calculator mode is intended for a single-slope roof running between two support lines. This is also the appropriate mode for a typical lean-to roof where the rafter rises continuously from the low support to the high support.
Unlike a common gable rafter, a shed rafter uses the full horizontal run between its supports. You can also enter separate low-side and high-side overhangs. Both are converted from horizontal projection into sloped length.
Birdsmouth Geometry Reference
The advanced birdsmouth option is included for users who want a geometric reference for the seat cut. It uses the selected rafter depth, horizontal seat length and roof angle to calculate the vertical heel rise and the notch depth measured perpendicular to the rafter.
The tool also compares the calculated notch depth with a D/4 reference, where D is the actual rafter depth. In the International Residential Code, roof-member cutting and notching provisions for sawn lumber refer to the sawn-lumber limits in Section R502.8.1; end notches are limited to one-quarter of the member depth. IRC Section R802.6 also specifies minimum end bearing of 1½ in on wood or metal and 3 in on masonry or concrete. Always verify the code edition and amendments adopted where the project is located.
Common Rafter Length Table
The table below gives a quick comparison for a 12 ft horizontal run. It assumes no ridge-board deduction and no overhang. Use the calculator above for your actual dimensions.
| Roof pitch | Angle | Pitch factor | Rafter length for 12 ft run |
|---|---|---|---|
| 2:12 | 9.46° | 1.0138 | 12 ft 2 in |
| 3:12 | 14.04° | 1.0308 | 12 ft 4 7/16 in |
| 4:12 | 18.43° | 1.0541 | 12 ft 7 13/16 in |
| 5:12 | 22.62° | 1.0833 | 13 ft 0 in |
| 6:12 | 26.57° | 1.1180 | 13 ft 5 in |
| 8:12 | 33.69° | 1.2019 | 14 ft 5 1/16 in |
| 10:12 | 39.81° | 1.3017 | 15 ft 7 7/16 in |
| 12:12 | 45.00° | 1.4142 | 16 ft 11 5/8 in |
Values are rounded to the nearest 1/16 in where appropriate. This is a geometry reference only and does not include a ridge deduction, overhang or saw-cut allowance.
Worked Example: 24 ft Span With a 6:12 Pitch
Suppose a symmetrical gable roof has a building span of 24 ft and a 6:12 pitch. For this basic example, ridge-board thickness and overhang are both set to 0.
Rounded to the nearest 1/16 in, the geometric common-rafter line length is approximately 13 ft 5 in.
Example: 4:12 Pitch With a 14 ft Run
For a 4:12 pitch and a 14 ft horizontal run:
That is approximately 14 ft 9 1/16 in before adding any overhang or applying a ridge-board deduction.
Imperial and Metric Rafter Lengths
The calculator supports both US/imperial and metric measurements. In imperial mode, large dimensions can be entered in feet while smaller framing dimensions such as overhang and ridge-board thickness can be entered in inches. Results are also shown in practical feet-and-inches format, with selectable fractional-inch precision.
In metric mode, you can work in metres, centimetres or millimetres. The formulas do not change because the rise-to-run relationship is dimensionless; the important requirement is that the calculator converts all dimensions to a consistent internal unit before applying the geometry.
What the Rafter Length Result Includes
The main result is a geometric rafter line length. Depending on the options you select, it can include:
- the effective horizontal run;
- the roof slope or pitch;
- an optional half-ridge-board deduction for a gable roof;
- an optional horizontal eave overhang converted to sloped length; and
- separate low-side and high-side overhangs for a shed or lean-to roof.
It does not automatically determine final lumber cutting length, structural rafter size, allowable span, load capacity, connector requirements, plumb-cut allowance, fascia detail or whether a framing design meets local code.
The tool is also not a hip rafter length calculator or valley rafter length calculator. Hip and valley rafters use different plan geometry and should be calculated separately rather than treated as ordinary common rafters.
Rafter Length Calculator FAQs
How do I calculate rafter length?
If you know the horizontal run and vertical rise, use rafter length = √(run² + rise²). If you know the roof pitch instead, first convert the pitch into rise over the run, or use the pitch-factor form of the equation. The calculator above performs those conversions automatically.
Can I calculate rafter length from roof pitch and building width?
Yes. For a centred symmetrical gable roof, the calculator divides the building span by two to obtain the run, then uses the selected roof pitch to calculate rise and rafter length. If you enter ridge-board thickness, half of that thickness is deducted from each side’s run.
Does the calculator include roof overhang?
Yes. Open the advanced geometry section and enter the horizontal eave overhang. The calculator converts it into the equivalent sloped rafter length. Shed mode allows separate overhangs at the low and high sides.
Can I use this as a shed rafter length calculator?
Yes. Select Shed / lean-to rafter. In that mode, the calculator uses the full horizontal run between support lines rather than half the building span.
Can I use it as a lean-to rafter length calculator?
Yes. A typical lean-to is a single-slope roof, so the shed/lean-to mode is designed for that geometry. Enter the horizontal support span and the roof pitch, angle, rise or slope percentage.
Can the calculator work in millimetres?
Yes. Switch to metric mode and use metres, centimetres or millimetres. This makes the tool suitable as a metric rafter length calculator without changing the underlying formula.
Does the birdsmouth option tell me whether the cut is safe?
No. It provides geometry and a basic D/4 notch-depth reference for solid-sawn lumber, but it does not perform structural design. Confirm bearing, member size, loads, connectors, notch limits and local code requirements before cutting structural framing.
Can I use this calculator for hip or valley rafters?
No. Hip and valley rafters have different horizontal plan geometry from common rafters. A dedicated hip or valley calculation should be used instead.
Is a roof truss the same as a rafter?
No. A conventional rafter is an individual sloping framing member. A prefabricated roof truss is an engineered assembly made from multiple members connected as a system. Do not use a common-rafter line-length result as a substitute for a truss design or truss-manufacturer drawing.
Technical References and Calculation Notes
The mathematical part of this calculator uses standard right-triangle geometry. Framing and code references are provided only to explain the limits of the optional birdsmouth checks; they do not turn the calculator into a structural design tool.
- International Residential Code, Chapter 8: Roof-Ceiling Construction — see Sections R802.6 and R802.7 for bearing and cutting/notching provisions.
- International Residential Code, Section R502.8.1: Sawn Lumber — includes general notch-depth limitations referenced by the roof-framing provisions.
Share Calculator
Submit your details to get the embed code immediately. We will also try to email you a copy.
Choose a citation format.
