Pitch & Span

Rafter Length Calculator

This calculator finds rafter length, run, rise, and cut angles from building span, roof pitch, and overhang, using rafterLength = √(run² + rise²) with run = span/2 minus half the ridge thickness. It covers gable, hip, shed, and gambrel roof framing.

History

Saved

    No saved results yet. Use "Save this result" to pin one.

    Recent

      No recent results yet. Copy or print a result to see it here.

      Rafter Length Calculator

      This calculator finds rafter length, run, rise, and cut angles from building span, roof pitch, and overhang, using rafterLength = √(run² + rise²) with run = span/2 minus half the ridge thickness. It covers gable, hip, shed, and gambrel roof framing.

      Scenario presets

      Outside wall to outside wall, measured along the width the rafters cross.

      Roof pitch

      Rise in inches per 12" of run. Read directly off a speed square or rafter square.

      Horizontal eave overhang beyond the wall line. Common: 12" residential, 18–24" for better weather protection.

      Gable (Two-Slope) - Most Common · Hip · Shed (Single-Slope) · Gambrel (Barn-Style)

      Advanced options

      Standard 2x material = 1.5". Use 0 for a ridge beam flush with the rafter tops or no ridge member.

      16" on center – standard residential · 24" on center – lighter loads or engineered rafters.

      Length of the wall the rafters run along, used to count rafters per side.

      Roof rafter profile diagram Live-updating roof profile showing run, rise, rafter length, and cut angles.
      Rafter length 13'-4 3/16"
      Building span
      24'-0"
      Total length (with overhang)
      14'-5 9/16"
      Run
      11'-11 1/4"
      Rise
      5'-11 5/8"
      Sloped overhang
      1'-1 7/16"
      Plumb cut angle
      26.6°
      Seat cut angle
      63.4°
      Rafters needed (per side)
      19
      Slope factor
      1.118

      Worked example

      A contractor is framing a detached garage: 24 ft span, 6/12 pitch, 12" overhang, 1½" ridge board, rafters 16" on center, 32 ft building length. Here is the math the calculator runs.

      Run. Half the span, minus half the ridge thickness: 24 ÷ 2 = 12 ft, then 12 ft − (1.5" ÷ 2 ÷ 12) = 11.9375 ft. Round to 11'-11¼" on the tape.

      Rise. Run × pitch ÷ 12: 11.9375 × 6 ÷ 12 = 5.96875 ft, or 5'-11⅝".

      Rafter length. √(run² + rise²) = √(11.9375² + 5.96875²) = √(142.50 + 35.63) = √178.13 = 13.3465 ft, or 13'-4 3/16" before the overhang is added.

      Sloped overhang. The slope factor for 6/12 is √(144 + 36) ÷ 12 = 1.118. A 12" (1 ft) horizontal overhang becomes 1 × 1.118 = 1.118 ft, or 1'-1 7/16" along the slope.

      Total length. 13.3465 + 1.118 = 14.4645 ft, or 14'-5 9/16" — that is the number to pull on the tape before the first cut.

      Angles. θ = arctan(6/12) = 26.57°. Plumb cut = 26.6°, seat cut = 63.4°. Set the speed square to 6 on the tongue, 12 on the body, and mark both cuts off the same reading.

      Rafter count. 32 ft building length = 384". 384 ÷ 16 = 24, plus 1 = 25 rafters per side, 50 total for a gable roof.

      How it works

      Rafter length comes straight out of the Pythagorean theorem, applied to the triangle formed by the building's run, the roof's rise, and the rafter itself as the hypotenuse:

      rafterLength = √(run² + rise²)

      • run — horizontal distance from the outside wall to the roof centerline: span ÷ 2, minus half the ridge board thickness for a gable or hip roof; the full span for a shed roof.
      • rise — vertical distance the roof climbs over that run: run × (pitch ÷ 12).
      • pitch — inches of rise per 12 inches of run, read off a speed square as "x/12."
      • slope factor — √(144 + pitch²) ÷ 12, the multiplier that converts a flat, horizontal measurement into the true, sloped one. It is how overhang and roof area both scale with pitch.
      • plumb angle and seat angle — the two cut angles at the top and bottom of the rafter, always complementary (they add up to 90°).

      Every one of the 13 tools on this site that touches roof geometry uses this same slope factor, so a number checked here will match the roof area, shingle, and metal roofing calculators exactly.

      Pitch correction factor table (1/12 – 24/12)

      The full range of standard roof pitches, their angle from horizontal, and the slope factor (multiplier applied to a flat-plan measurement to get the true, sloped length).

      Pitch Angle Slope factor OSHA classification
      1/12 4.8° 1.0035 Low-slope
      2/12 9.5° 1.0138 Low-slope
      3/12 14° 1.0308 Low-slope
      4/12 18.4° 1.0541 Low-slope
      5/12 22.6° 1.0833 Steep-slope
      6/12 26.6° 1.118 Steep-slope
      7/12 30.3° 1.1577 Steep-slope
      8/12 33.7° 1.2019 Steep-slope
      9/12 36.9° 1.25 Steep-slope
      10/12 39.8° 1.3017 Steep-slope
      11/12 42.5° 1.3566 Steep-slope
      12/12 45° 1.4142 Steep-slope
      13/12 47.3° 1.4743 Steep-slope
      14/12 49.4° 1.5366 Steep-slope
      15/12 51.3° 1.6008 Steep-slope
      16/12 53.1° 1.6667 Steep-slope
      17/12 54.8° 1.7341 Steep-slope
      18/12 56.3° 1.8028 Steep-slope
      19/12 57.7° 1.8727 Steep-slope
      20/12 59° 1.9437 Steep-slope
      21/12 60.3° 2.0156 Steep-slope
      22/12 61.4° 2.0883 Steep-slope
      23/12 62.4° 2.1619 Steep-slope
      24/12 63.4° 2.2361 Steep-slope

      OSHA classification per 29 CFR 1926.500(b): a "low-slope roof" is one with a slope of 4-in-12 or less, which changes the fall-protection requirements that apply to roofing work — see your competent person or OSHA's fall-protection standard for what's required on your job.

      Tips from the field

      • Cut one rafter first and test-fit it before cutting the rest of the run.
      • Mark the plumb cut line with a speed square set to the pitch, not the angle in degrees, to avoid rounding drift.
      • Add tail cut length after confirming the fascia detail — some builders trim the tail separately from the main rafter length.
      • Crown every rafter up before installing; a crowned edge resists sagging over time.
      • Double-check ridge thickness against the actual lumber in hand — nominal and actual dimensions differ.
      • For hip roofs, common rafters use this calculator; hip rafters need a separate length and compound angle.

      What this tool does not do

      • Does not size the rafter for structural load — check span tables or an engineer for allowable spans.
      • Does not calculate hip or valley jack rafter lengths, only the common rafter.
      • Does not compute the birdsmouth notch — use the Birdsmouth Cut Calculator for seat cut depth.
      • Assumes a single, straight roof slope — a true gambrel needs two separate pitch calculations.

      For structural sizing, see the Joist Span Calculator. For the birdsmouth notch, see the Birdsmouth Cut Calculator. For total roof area instead of a single rafter, see the Roof Square Footage Calculator.

      Results are for planning and estimating purposes only. Always confirm structural framing decisions against the International Residential Code (IRC), your local building code, and a licensed engineer or building official before cutting material or starting construction.

      Did this calculator help you?

      Frequently asked questions

      These are the questions that come up on the job site once the tape measure comes out — measuring span correctly, reading pitch off a square, and knowing what this calculator does not cover.

      How do I measure the span for a rafter length calculation?

      Measure outside wall to outside wall, at the top plate, along the direction the rafters run. Do not measure to the center of the walls — that understates the span and produces a rafter that comes up short.

      What does a pitch of "6/12" actually mean?

      It means the roof rises 6 inches for every 12 inches (1 foot) of horizontal run. Pitch is always expressed as rise over a 12" run, so "6/12" and "6 in 12" mean the same thing.

      Why does ridge board thickness change the rafter length?

      The ridge board sits between the two opposing rafters at the peak, so each rafter's run is measured to the centerline of the ridge, not the far wall. Half the ridge thickness is subtracted from run on each side. A thicker ridge means a very slightly shorter rafter.

      Do I need to include the ridge thickness for a ridge beam instead of a ridge board?

      If the rafters land on top of a ridge beam (flush) rather than butting against a ridge board, set ridge thickness to 0 and treat total span differently — this calculator assumes a standard ridge board framing method.

      What is the difference between the plumb cut and the seat cut?

      The plumb cut is the angled cut at the top of the rafter where it meets the ridge, and at the tail where it meets the fascia. The seat cut is the flat, horizontal cut where the rafter rests on the top plate. The two angles are complementary — they add up to 90°.

      Does this calculator give me the birdsmouth notch depth?

      No. This tool gives rafter length and cut angles only. Use the Birdsmouth Cut Calculator for seat cut depth and heel height, and note that the seat cut should never exceed one-third of the rafter's depth.

      How is overhang added to the total rafter length?

      Overhang is entered as a horizontal measurement (how far the eave extends past the wall), then converted to the sloped distance using the roof's slope factor before being added to the rafter length. A steeper pitch means more material is needed for the same horizontal overhang.

      Can I use this calculator for hip roof rafters?

      Yes, for the common rafters — the ones running straight from the wall plate to the ridge. Hip rafters (the diagonal ones at the corners) run at a different angle and length and are not calculated here.

      What roof type should I pick for a shed roof?

      Choose "Shed (Single-Slope)." A shed roof has no ridge — the rafter spans the full building width at a single pitch, so the calculator uses the full span as the run instead of splitting it at a ridge.

      Why does the gambrel option not give two different pitches?

      A true gambrel roof has two distinct pitches (a shallow upper slope and a steep lower slope). This calculator handles a single pitch at a time — run it twice, once per slope, using the span and pitch for each section.

      How many rafters do I need for my building?

      Rafter count is based on building length and spacing: it divides the wall length by the on-center spacing and adds one for the starting rafter. This is per roof side — a gable roof needs this count twice, once per slope.

      Should I use 16" or 24" on-center spacing?

      16" on center is standard for most residential roofs and matches common sheathing layouts. 24" on center is used with engineered rafters or trusses rated for the wider spacing — check your span tables or engineer's specification before switching.

      Does this calculator work in metric units?

      Yes. Toggle the unit selector to metric and enter span and overhang in meters or millimeters — the underlying geometry is unit-independent, so results convert directly.

      Why do my hand calculations come out slightly different from this tool?

      Small differences almost always come from rounding mid-calculation. This tool keeps full precision internally and only rounds the final displayed number to the nearest 1/16", which avoids compounding rounding error across run, rise, and length.

      Is the rafter length from this calculator safe to use for structural sizing?

      The length and angles are exact geometry. Structural sizing — whether a given rafter size and species can safely span that distance under your local snow and live loads — is a separate question. Use the Joist Span Calculator or your local building code for allowable spans.

      How we checked this page

      Written by
      Pitch & Span Editorial
      Reviewed by
      Formula and rounding checked against the standard rafter-square method (framing square manufacturer instructions) and Pythagorean geometry.
      Last reviewed
      2026-07-28
      Publisher
      Pitch & Span
      Scope
      U.S. roof framing and roofing material estimating
      What we checked
      • Canonical test case (24 ft span, 6/12 pitch → 13.416 ft rafter length) verified against hand calculation and a physical rafter square.
      • Rounding to the nearest 1/16" checked for drift across run, rise, and total length.
      • Plumb and seat cut angles checked to sum to 90° for every pitch from 1/12 to 24/12.
      • Metric conversion checked to return the same rafter length after a feet → meters → feet round trip.

      Methodology

      Cite this calculator

      Pitch & Span. "Rafter Length Calculator." Pitch & Span, https://pitchandspan.com/rafter-length-calculator/. Accessed .

      Embed this calculator

      Paste this on your own site — free, links back to Pitch & Span.

      Related tools

      Comments and suggestions

      Found a bug, have a suggestion, or just want to say hi? Post it below.