JusTheToolPRECISION CALCULATORS

Rafter Length Calculator: Span & Pitch

Quick answer: Rafter length is the diagonal from wall to ridge: √(rise² + run²). Find the run and rise from your span and pitch, then add your overhang for the cut length.

This rafter calculator finds the exact rafter cut length from your run, pitch, and overhang β€” including the recommended board length to buy.

0 ft 0 in
Buy: 0 ft boards
Roof Angle: 0Β°
Total Lumber for All Rafters: 0 ft

Span, run, and rafter length — the three numbers people mix up

Nearly every rafter mistake starts here, so it is worth being precise. These are three different measurements and only one of them is the board you cut.

If you order lumber off the span you will be roughly double what you need. If you order off the run you will be short by the pitch multiplier — between 5% and 41% depending on how steep the roof is.

Rafter length = (span ÷ 2) × √(rise² + 12²) ÷ 12, before overhang and ridge deduction.

Span to rafter length chart

Common building spans converted to rafter length. These are line lengths from the ridge to the outside of the wall plate — add your overhang and subtract half the ridge board thickness to get the finished cut.

Building spanRun (half span)4:126:128:1210:1212:12
16 ft8 ft8' 5"8' 11"9' 7"10' 5"11' 4"
20 ft10 ft10' 6"11' 2"12' 0"13' 0"14' 2"
24 ft12 ft12' 8"13' 5"14' 5"15' 7"17' 0"
28 ft14 ft14' 9"15' 8"16' 10"18' 3"19' 10"
32 ft16 ft16' 10"17' 11"19' 3"20' 10"22' 8"
36 ft18 ft19' 0"20' 1"21' 8"23' 5"25' 5"
40 ft20 ft21' 1"22' 4"24' 0"26' 0"28' 3"

Assumes a symmetrical gable roof where run is exactly half the span. Rounded to the nearest inch.

How far can a rafter actually span?

This page calculates geometry — how long the board is. That is a different question from how far a given board can safely span, and we want to be clear about the difference because getting it wrong is a structural failure, not a material overage.

The maximum allowable span for a rafter depends on variables this calculator does not ask for and cannot infer:

Published allowable spans live in the IRC rafter span tables (R802.5), indexed by all of the above. We deliberately do not reproduce them here: they run to dozens of pages, they are amended locally, and an out-of-context number is worse than no number.

Use this page for material takeoff, not for sizing. If you are deciding what size rafter to buy, get that number from the IRC span tables for your snow load, from your truss supplier, or from a licensed engineer. Once you know the size, come back here to work out how long to cut it and how many you need.

How Rafter Length Is Calculated

A common rafter is just the hypotenuse of a right triangle. The "run" is the horizontal distance from the outside wall to the center of the ridge. The "rise" is how much the roof climbs over that same distance, set by your pitch. Once you know both, the rafter length is simple Pythagorean math: length = √(run² + rise²).

πŸ’‘ Measuring Run Correctly: For a simple gable roof, run is half your building's total width (measured to the outside of the wall framing, not the ridge). For a shed roof or lean-to with a single slope, run is the full width of the structure.

Don't Forget the Overhang

The overhang (eave) extends past the wall at the same slope as the rest of the roof, so it adds length along the same angle β€” not just a flat addition. Our calculator factors this in automatically so your total cut length is accurate, not just the distance to the wall line.

Hip & Valley Rafters: A Quick Note

This calculator handles common rafters (the standard rafters running from wall to ridge on a gable or shed roof). Hip and valley rafters run diagonally across the corners and use a different run β€” roughly your common rafter's run multiplied by 1.414 (√2) before applying the same pitch β€” because they're covering the diagonal of a square, not a straight side. If your project includes hip or valley framing, budget extra length and confirm exact cuts on-site, since the birdsmouth and ridge cuts on hip rafters are compound angles best laid out with a speed square or framing calculator at the actual ridge.

⚠️ This Calculates Length, Not Load CapacityThis tool tells you how long to cut your rafters. It does not tell you what lumber size or species can safely span that distance under snow and live loads β€” that's a structural question governed by your local building code's span tables (IRC Table R802.5.1, or your regional equivalent) and your rafter spacing. Always confirm rafter size, species, grade, and spacing with your local building department or a structural engineer before framing a load-bearing roof.

Frequently Asked Questions

How do I find the run for a gable roof?

Measure the total width of the building from outside wall to outside wall, then divide by two. That's your run for each common rafter, since the roof slopes up symmetrically from both walls to the ridge in the middle.

What length rafter do I need for a 6/12 pitch and 12 foot run?

With a 6/12 pitch, the rise over a 12 foot run is 6 feet. Using the Pythagorean theorem, the rafter length is √(12Β² + 6Β²) = √180 β‰ˆ 13.4 feet, before adding overhang.

Should I buy lumber the exact length of my rafter, or longer?

Always round up to the next standard stock length (8, 10, 12, 14, 16, 18, or 20 feet) plus a few extra inches for the ridge cut and any adjustment during layout. Cutting a rafter too short means starting over.

What's the difference between rafter length and "span"?

Span is the total horizontal distance a roof covers between supports (usually twice the run for a gable roof). Rafter length is the actual diagonal board length needed to cover that span at your chosen pitch β€” span is always shorter than the rafter itself once pitch is added.

Share this tool: 𝕏 Tweet πŸ“˜ Share πŸ“Œ Pin
MA

How we build these calculators

Founder, JusTheTool · Every formula cited to a published code table or manufacturer spec · Last reviewed August 2026

Every calculator on this site implements formulas taken from published sources — International Residential Code (IRC) tables, ACI and ASTM standards, and manufacturer spec sheets for yields and coverage rates. We list the source behind each figure on our methodology page, so you can check the math rather than take our word for it. These tools are estimating aids, not a substitute for a licensed professional or your local building department.

More roofing tools

→ All 15 roofing calculators

Sources for the figures on this page

Every constant this calculator uses and where it comes from, so you can check it rather than take our word for it.

Local codes amend the model IRC and adopt different cycles — your building department governs. Manufacturers revise yields; where your product's data sheet disagrees with a default here, use the product's number. See our full methodology.