Civil & Structural Engineering

Rafter Length Calculator

Calculate common rafter length from run and rise, pitch (X/12), or angle, with optional overhang and ridge board thickness.

Formula L = (R + O − t/2) × √(1 + slope²)Reviewed Sep 9, 2026

A common rafter is the hypotenuse of a right triangle formed by the roof's horizontal run and vertical rise, so its length follows directly from the Pythagorean theorem: rafter length = run × √(1 + slope²). This calculator accepts the roof's slope three different ways - run and rise directly, run and roof pitch in the standard X/12 notation, or run and angle in degrees - and optionally adds an eave overhang and subtracts half a ridge board's thickness, both standard framing corrections, before giving you the final rafter length along with the equivalent pitch and angle.

Calculation Bench
Known Slope Value
01

R · Horizontal distance from the wall's inside face to the ridge centerline.

02

X · Rise per 12 units of run - the "X" in X/12.

03

O · Eave overhang beyond the wall. Leave 0 to skip.

04

t · Ridge board thickness; half is subtracted from the run. Leave 0 to skip.

This is a common-rafter calculation only - it does not solve hip, valley, or jack rafter lengths, and it returns a theoretical line length, not a finished cut-to-length board with birdsmouth or tail cuts applied.

Solution

Enter run and a slope value to calculate rafter length.

L = (R + O − t/2) × √(1 + (X/12)²)

Formula Sheet

L=(R+O−t2)1+(rR)2L = \left(R + O - \dfrac{t}{2}\right) \sqrt{1 + \left(\dfrac{r}{R}\right)^2}
L=(R+O−t2)1+(X12)2L = \left(R + O - \dfrac{t}{2}\right) \sqrt{1 + \left(\dfrac{X}{12}\right)^2}
L=(R+O−t2)1+tan⁡2θL = \left(R + O - \dfrac{t}{2}\right) \sqrt{1 + \tan^2\theta}
  • LRafter Length
  • RRun
  • rRise
  • XPitch
  • θAngle
  • OOverhang
  • tRidge Board Thickness

Variables & Units

SymbolVariableDescriptionCommon Units
LRafter LengthTotal common rafter length, including overhang and the ridge-thickness correction.
RRunHorizontal distance from the wall's inside face to the ridge centerline.ft, m, in
rRiseVertical height gained over the run.ft, m, in
XPitchRoof pitch as rise per 12 units of run - the "X" in X/12 (e.g. 6 for a 6/12 roof).
θAngleRoof angle measured from horizontal.deg
OOverhangEave overhang beyond the wall, extending at the same roof slope.in, ft, cm
tRidge Board ThicknessThickness of the ridge board; half of it is subtracted from the run.in, mm

How to Use This Calculator

  • 01Choose how you know the roof's slope: Rise (a direct rise measurement), Pitch (the common X/12 notation, e.g. 6/12), or Angle (degrees from horizontal).
  • 02Enter the run - the horizontal distance from the inside face of the wall to the ridge centerline - plus the rise, pitch, or angle depending on the mode chosen.
  • 03If you measured full building span instead of run, divide the span by two first for a symmetrical gable roof, then subtract the ridge-board correction if you are cutting to the ridge face.
  • 04Optionally enter the eave overhang beyond the wall; it extends at the same roof slope and is added to the run before the final calculation.
  • 05Optionally enter the ridge board's thickness. Half of it is subtracted from the run, matching the standard framing correction for where the rafter's ridge-end cut actually lands.
  • 06The calculator returns the rafter length, plus the equivalent angle and pitch so you can cross-check against a speed square or protractor.

How the Formula Works

Run and rise form two legs of a right triangle; the rafter itself is the hypotenuse, so rafter length = √(run² + rise²), which is the same as run × √(1 + slope²) once slope = rise / run.

Roof pitch (X/12) and angle are just two other ways of expressing that same slope: pitch = slope × 12, and angle = atan(slope). Whichever one you enter, the calculator converts it to a slope ratio first, then applies the same run × √(1 + slope²) relationship.

Overhang extends the horizontal distance the rafter has to span at the same slope, so it's added to the run before the final multiplication. Run is measured to the ridge centerline, but the rafter's actual top cut lands at the ridge board's face - set back from that centerline by half the board's thickness - so ridge board thickness shortens the bearing run by half its value.

Worked Example 01

Rafter length from run and pitch, with overhang and ridge board

Known

  • Run (R): 12 ft
  • Pitch (X): 6 (6/12)
  • Overhang (O): 1 ft
  • Ridge Board Thickness (t): 1.5 in

Formula

L = (R + O − t/2) × √(1 + (X/12)²)

Substitution

L = (12 + 1 − 0.0625) × √(1 + 0.5²)

Result

L ≈ 14.46 ft

A 12 ft run at a 6/12 pitch (26.57°), with a 1 ft overhang and a 1.5 inch ridge board, needs a rafter about 14.46 feet long.

Worked Example 02

Rafter length from run and rise, no overhang

Known

  • Run (R): 10 ft
  • Rise (r): 5 ft

Formula

L = (R + O − t/2) × √(1 + (r/R)²)

Substitution

L = 10 × √(1 + 0.5²)

Result

L ≈ 11.18 ft

A 10 ft run with a 5 ft rise (the same 6/12 pitch) gives a plain rafter length of about 11.18 feet with no overhang or ridge correction applied.

Applications

  • 01Estimating rafter length for lumber ordering on a gable or shed roof framing job
  • 02Cross-checking a roof's pitch, angle, and rafter length against each other before cutting
  • 03Working out how much longer a rafter needs to be for a given eave overhang

Assumptions

  • 01Rafters are common rafters running perpendicular to the ridge on a simple gable or shed roof - not hip, valley, or jack rafters, which need additional geometry beyond a single run-and-rise triangle.
  • 02The roof slope is constant along the full length of the rafter, including through the overhang.
  • 03Run is measured to the ridge centerline; the optional ridge board thickness correction accounts for the actual ridge-end cut location.

Where This Model Stops

  • 01Does not calculate hip, valley, or jack rafter lengths - those require additional plan-view geometry, not just a single run-and-rise triangle.
  • 02Does not account for birdsmouth notch depth or seat-cut geometry at the wall plate - this is the theoretical line length along the top of the rafter, not a finished cut-to-length lumber order.
  • 03Does not size the rafter for structural load (species, grade, spacing, or span rating) - use a span table or a structural calculation for that.
  • 04Does not round up to a stocked lumber length or include waste for cut errors, damaged boards, or complex roof intersections.

References

  1. [1]

    How to Calculate Rafter Length

    Inch Calculator

    Explains the Pythagorean-theorem basis for rafter length and the standard X/12 roof pitch notation used throughout US residential framing.

  2. [2]

    Wood Frame Construction Manual

    American Wood Council (AWC)

    Industry reference for residential roof framing practice, including common rafter layout and ridge board conventions.

Frequently Asked Questions

What's the difference between run and span?

Run is the horizontal distance from the wall to the ridge centerline - half the building's total span for a symmetrical gable roof. If you know the full span instead, divide it by two to get the run for this calculator.

What does a "6/12 pitch" mean?

It means the roof rises 6 inches for every 12 inches (1 foot) of horizontal run. Roof pitch is always expressed this way in US residential framing - the first number is the rise, the second is always 12.

Do I need to include the overhang and ridge board correction?

Only if you want the actual lumber cutting length. The plain run-and-rise (or run-and-pitch) calculation gives the theoretical rafter line length to the ridge centerline with no overhang; adding the overhang and ridge board thickness gets you closer to the true end-to-end board length before any birdsmouth or tail cuts.

Does this work for hip or valley rafters?

No - this calculator is specifically for common rafters, which run perpendicular to the ridge in a single run-and-rise triangle. Hip and valley rafters run diagonally in plan view and need additional geometry this page doesn't model.

Should I order exactly the calculated length?

Usually no. The calculated value is the geometric line length before practical cutting allowances. Round up to the next available board length and account for birdsmouth, tail cuts, ridge cuts, and jobsite waste.