Roofing Calculator

Rafter Length Calculator

Last updated: September 11, 2026
Daniel Brooks

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 →
0 people found this calculator helpful
💬 Feedback
On this page
    Common & shed rafter geometry Results update automatically as you enter measurements.

    Enter your roof measurements

    Choose the geometry and slope format that match the measurements you already have.

    For a centred gable, the calculator divides the span by two before any ridge-board deduction.
    : 12
    Example: enter 6 for a 6:12 roof pitch.
    Overhang & advanced geometry
    Measured level from the outside wall line to the tail end, not along the rafter.
    Half the ridge thickness is deducted from each gable-side run. Set to 0 if your run is already measured to the ridge face.
    Common rafter geometry Live diagram
    Rafter Run Rise Angle Overhang
    Total rafter line length — Ridge face to tail end, including horizontal overhang converted to slope.
    Wall to ridge face — geometric line length
    Effective horizontal run — after ridge deduction
    Vertical rise — over effective run
    Sloped overhang — eave tail
    Roof angle — above horizontal
    Equivalent pitch — —
    Pitch factor — sloped length ÷ horizontal run
    Ridge deduction — half ridge thickness
    Calculation Enter valid measurements to see the calculation.

    Birdsmouth geometry reference

    Horizontal seat —
    Vertical heel rise —
    Notch depth normal to rafter —
    D/4 reference limit —
    Geometry, not structural sizing. This calculator estimates common-rafter or shed-rafter line geometry. It does not determine lumber size, structural capacity, connectors, final saw-cut allowances, hip/valley lengths, or whether a framing detail satisfies your locally adopted code.
    Quick answer

    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.

    1. 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.
    2. 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.
    3. Choose how you know the roof slope. Enter an x:12 roof pitch, roof angle in degrees, known rise, or slope percentage.
    4. 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.
    5. 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:

    Using run and rise
    Rafter length = √(run² + rise²)

    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:

    Using roof pitch
    rise = run × (pitch rise ÷ 12)
    rafter length = run × √(1 + (pitch rise ÷ 12)²)

    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:

    Centred gable roof
    run to ridge centreline = building span ÷ 2

    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.

    Gable roof ridge adjustment
    effective run = centreline run − (ridge thickness ÷ 2)
    Avoid double deduction. If the run you measured already ends at the face of the ridge board rather than its centreline, set ridge-board thickness to 0.

    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.

    Sloped overhang
    sloped overhang = horizontal overhang × pitch factor
    total rafter line length = main rafter line + sloped overhang

    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.

    Common rafter vs shed rafter: a symmetrical gable usually uses half the building span for one common rafter. A shed or lean-to roof normally uses the full horizontal distance between its two bearing lines.

    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.

    The birdsmouth output is not structural approval. The calculator does not determine whether a particular rafter size, species, grade, span, load, connector or notch is structurally adequate. Engineered wood products and roof trusses can also have manufacturer-specific restrictions that are different from solid-sawn lumber.

    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:129.46°1.013812 ft 2 in
    3:1214.04°1.030812 ft 4 7/16 in
    4:1218.43°1.054112 ft 7 13/16 in
    5:1222.62°1.083313 ft 0 in
    6:1226.57°1.118013 ft 5 in
    8:1233.69°1.201914 ft 5 1/16 in
    10:1239.81°1.301715 ft 7 7/16 in
    12:1245.00°1.414216 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.

    Step 1: find the run
    run = 24 ft ÷ 2 = 12 ft
    Step 2: find the rise
    rise = 12 × (6 ÷ 12) = 6 ft
    Step 3: find the rafter length
    √(12² + 6²) = √180 = 13.416 ft

    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:

    rise = 14 × (4 ÷ 12) = 4.6667 ft
    rafter length = 14 × √(1 + (4 ÷ 12)²) = 14.7573 ft

    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.

    Check the code adopted where you build. Model-code editions and local amendments vary by jurisdiction. Where engineered lumber, roof trusses or manufacturer-designed components are involved, follow the approved design information and manufacturer instructions rather than applying solid-sawn-lumber assumptions.