Rafter Calculator

Calculate roof pitch, rise, run, and common-rafter line length from a building span or direct rafter run. Add an optional ridge-board thickness or overhang and use the live diagram to keep every reference line obvious.

All calculations run in your browser. No project dimensions are uploaded by this tool.

Enter the roof geometry

I know my:
Advanced layout options

Results

Enter your span or run and roof pitch to calculate the common-rafter geometry.

Live rafter diagram

The drawing preserves the roof angle and labels the exact calculated dimensions. Use the numbers, not screen pixels, for layout.

Illustrative, dimensioned geometry
Dimensioned common rafter geometry diagram Enter roof dimensions to render the common rafter geometry.
Calculation method and reference lines
  • Building span mode: nominal half-span equals the full outside building span divided by two. If ridge-board thickness is entered, half of that thickness is deducted horizontally so the rafter line ends at the ridge-board face.
  • Direct run mode: the entered run is used exactly as entered, from the outside wall/support line to the ridge face or upper support reference. Ridge-board deduction is not applied again.
  • Roof rise: effective run multiplied by the pitch rise/run ratio.
  • Rafter line length: the hypotenuse from the outside wall line to the selected ridge/support reference. This is a geometry line length, not a guaranteed finished stock-cut length.
  • Overhang: entered as horizontal projection from the outside wall line to the rafter-tail plumb-cut line. Sloped tail length is derived from that projection and the roof angle.
  • Angles: the tool reports roof angle from horizontal and the geometric plumb-line angle relative to the rafter edge. It intentionally does not provide saw settings because saw scales and reference conventions vary.

How to use the rafter calculator

  1. Choose building span or rafter run. Use building span for a symmetrical gable roof when you know the full outside width. Use direct run when you already know the single horizontal rafter run, including many shed or lean-to layouts.
  2. Enter the roof pitch. You can use X:12, degrees, percent slope, or a rise/run ratio. The calculator converts the other pitch formats automatically.
  3. Add advanced geometry only if you need it. Ridge-board thickness changes the run only in building-span mode. Horizontal overhang adds a separate sloped tail length.
  4. Use the line-length result and diagram together. The result gives the geometry; the diagram shows exactly which wall, ridge, and tail reference lines those numbers use.

Building span vs. rafter run

Building span is the full horizontal distance between the outside faces of the supporting exterior walls. For a symmetrical gable roof, the nominal common-rafter run is half that span. If a ridge board sits between opposing rafters, entering its actual thickness lets the calculator stop the run at the ridge-board face instead of the building centerline.

Direct rafter run is already a one-side horizontal distance. The calculator therefore does not subtract ridge thickness again in direct-run mode. This prevents the easy-to-make mistake of applying the same deduction twice.

Roof pitch, angle, and percent slope

A 6:12 roof rises 6 units for every 12 units of horizontal run. That ratio is 0.5, which corresponds to a 26.565-degree roof angle and a 50-percent slope. The calculator uses the same ratio internally no matter which pitch format you enter.

Pitch angleangle = atan(rise / run)
Roof riserise = run x pitch ratio
Rafter line lengthlength = sqrt(run^2 + rise^2)
Sloped tail lengthtail = horizontal overhang / cos(angle)

What this calculator does not determine

Geometric length is not structural adequacy. Rafter sizing can depend on lumber species, grade, member size, spacing, roof live and dead loads, snow load, deflection limits, support conditions, and locally adopted building codes. The 2024 International Residential Code includes separate rafter sizing, ridge, bearing, and notching provisions, and the American Wood Council publishes dedicated span-table resources for structural selection.

Birdsmouth depth, bearing design, hip/jack/valley rafters, and structural span sizing are intentionally outside this version of the tool.

Technical sources and review notes

Pre-launch review: The geometry, terminology, diagram reference lines, and practical layout assumptions should be checked by an experienced framing carpenter or carpentry instructor. That review is not structural engineering approval.

Want to learn professional framing and carpentry skills?

Roof layout is one piece of the trade. Explore training paths that can include construction math, plans, measuring, framing, tool use, and jobsite safety.

Explore carpentry training programs See what carpenters do