Rafter Length Calculator & Roof Framing Guide (2026)

Rafter Length Calculator

Calculate the exact length of common roof rafters. Enter your horizontal run, pitch, and overhang below to find line length, rise, and total board length.

Measurement System
ft
in
m
cm
/ 12
in
Total Rafter Length (With Overhang)
—
Base Rafter = √(Run² + Rise²)
Base Line Length (Wall to Ridge): —
Overhang Tail Length: —
Total Roof Rise (Vertical Height): —

Whether you are framing a backyard shed, building an addition, or planning a full roof replacement, determining the exact length of your rafters is a critical first step. Buying lumber that is too short is a costly mistake, and guessing your roof’s rise can lead to structural failures or a sagging ridge line.

Our free Rafter Length Calculator takes the complex geometry out of roof framing. By simply entering your building’s horizontal run, the desired roof pitch, and your overhang requirements, this tool uses the Pythagorean theorem to instantly compute the exact cut lengths for your common rafters.

How to Calculate Rafter Length (The Formula)

A common roof rafter forms a perfect right triangle with the horizontal ceiling joists and the vertical king post (or imaginary line dropping from the ridge). Because of this geometry, calculating the rafter length relies entirely on the Pythagorean Theorem: a² + b² = c².

The Rafter Formula

Rafter Length = √(Run² + Rise²)
  • Run (a): The horizontal distance.
  • Rise (b): The vertical height of the roof.
  • Rafter Length (c): The hypotenuse (the diagonal board).

Factoring in the Overhang (The Tail)

The standard formula only calculates the “line length” of the rafter from the very center of the ridge board down to the outside edge of the top wall plate. It does not account for the eaves (overhang).

To find the total board length you need to purchase, you must calculate the length of the overhang “tail” using the same pitch ratio, and add it to your base rafter length. Our calculator handles this step automatically.

Understanding Roof Pitch (Rise over Run)

In the United States and Canada, roof slope is almost exclusively communicated as “Pitch”—specifically, how many inches the roof rises vertically for every 12 inches it runs horizontally.

  • 4/12 Pitch: The roof rises 4 inches for every 12 inches of run. This is a common, low-slope roof found on ranch-style homes. It is easy to walk on.
  • 6/12 Pitch: A standard, medium-slope roof.
  • 9/12 to 12/12 Pitch: A steep roof often found on Victorian, Tudor, or Cape Cod style homes. A 12/12 roof sits at a perfect 45-degree angle.

In metric countries, roof slope is usually expressed directly in Degrees (e.g., a 30° roof pitch). Our calculator supports both input methods simply by toggling the unit system at the top.

Run vs. Span: Getting Your Measurements Right

The most common mistake DIYers make when using a framing calculator is confusing “Run” with “Span.”

Run vs. Span

Span is the total horizontal width of the building (from the outside of one exterior wall plate to the outside of the opposite wall plate).

Run is exactly half of the Span (assuming a symmetrical gable roof). It is the horizontal distance from the outside of the wall plate to the dead center of the ridge board.

If you are building a shed that is 10 feet wide, your Span is 10 feet, but the Run you enter into the calculator should be 5 feet.

Standard Rafter Sizing & Spacing Guidelines

Knowing the length of your rafter is only half the battle. You must also select the correct dimensional lumber size (2×6, 2×8, 2×10) and spacing (16″ or 24″ On Center) to ensure the roof can physically support the weight of the shingles and potential snow loads.

Lumber Size Typical Max Span (16″ OC)* Best Used For
2×4 Very short (Trusses only) Engineered trusses; never used for stick-built common rafters.
2×6 Up to ~12 feet Small sheds, porches, and short-span detached garages.
2×8 Up to ~16 feet Standard residential construction with light snow loads.
2×10 Up to ~21 feet Heavy snow load areas; modern homes requiring deep cavity space for high R-value insulation.
2×12 Up to ~25 feet Very long spans, vaulted ceilings, and extreme heavy-load environments.

*Note: Maximum spans depend heavily on wood species, lumber grade, and local building codes (live/dead load requirements). Always consult an engineer or your local code enforcement office.

16″ vs 24″ On Center Spacing

Rafters are typically spaced either 16 inches or 24 inches apart (measured from center to center).

  • 16″ OC: The industry standard for residential homes. It provides a highly rigid roof deck, prevents plywood sagging, and supports heavy materials like architectural shingles or slate.
  • 24″ OC: Often used for lightweight structures like sheds or pole barns with metal roofing. It saves lumber but reduces the structural rigidity of the roof deck.

Rafter Length Calculator Frequently Asked Questions

Yes. Rafter length is calculated using the Pythagorean theorem (a² + b² = c²). Square the horizontal Run, square the vertical Rise, add them together, and find the square root of that total. This gives you the line length of the rafter from the ridge to the wall plate (before adding the overhang tail).

Generally, no. Under standard building codes (like the IRC), a 2×8 lumber rafter cannot safely span 20 feet horizontally without sagging, especially if carrying a snow load. For a 20-foot span, you typically need 2x10s or 2x12s spaced 16 inches on center, or you must use engineered roof trusses.

For a 16-foot horizontal span, a 2×8 rafter is the absolute minimum if spaced 16 inches on center under very light load conditions. However, a 2×10 is heavily recommended to prevent long-term deflection (sagging) and to meet modern structural and insulation depth codes.

Depending on the wood species (e.g., Southern Pine vs. Spruce), the lumber grade (e.g., #2 or better), and local snow load requirements, a 2×10 rafter spaced 16 inches on center can safely span between 16 feet and 21 feet.

Yes, a 2×6 rafter can easily span 12 feet in most jurisdictions, provided it is spaced at 16 inches on center and the roof does not bear heavy snow loads or heavy roofing materials like clay tiles.

Use 2x6s only for small sheds, porches, or very short spans (under 12 feet). For standard residential home construction, 2x8s are the absolute minimum. 2x10s or 2x12s are increasingly standard because they allow for deep, highly energy-efficient fiberglass or spray foam attic insulation.

For a 12-foot horizontal span, a 2×6 rafter is structurally sufficient for light loads. However, upgrading to a 2×8 provides a significantly stiffer roof deck and allows more cavity space for insulation.

Dimensions copied!

Reference: https://en.wikipedia.org/wiki/Board_foot