Roof Truss Calculator: How to Size Rafters and Spans for Your Build

Use this roof truss calculator to estimate the number of trusses needed, along with the rafter length and ridge height. Enter the roof span, length, pitch, spacing, and overhang to get a quick estimate.

⚡ QUICK ANSWER Updated for 2026

How do I size rafters and space roof trusses?

Rafter and truss geometry comes from three numbers: span (wall to wall), pitch (rise per 12″ of run), and overhang. For a 28 ft span at a 6/12 pitch, the ridge sits about 7 ft above the wall plates, and each rafter runs roughly 15.6 ft including a 1 ft overhang. Truss count follows a separate formula — building length ÷ on-center spacing, plus one. Lumber size for stick-built rafters is a different question entirely: it depends on species, grade, spacing, and your local snow load, and should always be checked against your adopted IRC/IBC span table or a licensed engineer before you cut anything. Enter your numbers below for both.

📐
Rafter Length
15.6 ft
28 ft span, 6/12
🔺
Ridge Height
7 ft
above wall plate
🔢
Truss Count
21
40 ft @ 24″ o.c.
🪵
Common Rafter
2×8
~13 ft span, 16″ oc

Planning estimates only. Final rafter/truss sizing must follow your local building code’s adopted span tables or be specified by a licensed engineer or truss manufacturer.

⚡ Free Tool

Roof Truss & Rafter Calculator

Geometry, truss count, and a span/size check — all in one place

Roof geometry

Wall-to-wall, outside to outside
Energy heel — leave 0 for standard truss

Truss count

Rafter length (with overhang)

15.7 ft

28 ft span, 6/12 pitch, 1 ft overhang

  • Run (half-span)14.0 ft
  • Rise (theoretical height)7.0 ft
  • Ridge height above wall plate7.0 ft
  • Common trusses needed21
  • Total trusses (incl. gable ends)23
✓ Formula: rafter length = √(run² + rise²) + overhang ÷ cos(pitch angle). Truss count = ceil(building length ÷ spacing) + 1, plus 2 gable end trusses for a standard gable roof.

Your rafter

The horizontal distance this rafter needs to cover

Maximum allowable span

13′-11″

✓ This size works for a 13 ft span

  • Rafter size2×8
  • Species / gradeSPF #2
  • Spacing16″ o.c.
  • Design load30 psf snow + 10 psf dead
⚠ Planning reference only. These figures approximate common IRC/AWC span tables for #2-grade lumber and are rounded for quick planning. Your jurisdiction’s adopted code edition, exact snow load, and grade stamp can shift the real allowable span. Verify against your local IRC table or a licensed engineer before cutting or ordering lumber.

Why "close enough" doesn't work for framing

With most parts of a build, a rough estimate gets you close enough to order materials and adjust later. Framing isn't that forgiving. Order a rafter that's a size too small, or space your trusses too far apart for the load they'll actually carry, and you don't find out until the roof is sagging, bouncing underfoot, or failing an inspection — none of which are cheap to fix after the fact. On the other hand, over-engineering every rafter to the largest lumber you can find wastes money on a house that will never see it.

A roof truss calculator exists to sit between those two mistakes. This one handles both halves of the problem: the geometry (how long is the rafter, how tall is the ridge, how many trusses does the roof need) and the structural side (does this lumber size actually span the distance you need it to, given your spacing and snow load). Most calculators online only do one or the other — this one does both, and treats species, grade, spacing, and load as separate inputs instead of burying them in a single "roof size" field.

Rafter vs. truss — and why it matters here

A rafter is a single sloped beam running from the ridge to the wall plate, cut and installed on site — "stick framing." A truss is a pre-engineered triangular assembly of top chord, bottom chord, and internal webs, built in a factory to span the full width of the building without a center support wall. Trusses have mostly replaced site-built rafters on new residential construction because they go up faster, span farther without interior bearing walls, and come with an engineer's stamp already attached.

That last point matters for this guide: engineered trusses are custom-designed per project by the truss manufacturer, and their internal member sizes aren't something a general calculator can responsibly reproduce. What this tool can do reliably is the geometry both systems share (rafter length, ridge height, on-center spacing and count) and a simplified span/size reference for stick-built common rafters, which are still very much used for additions, porches, sheds, and cathedral ceilings.

Working out span, rise, and rafter length

Rafter geometry is just a right triangle. The building's span (wall to wall) splits into two equal runs meeting at the ridge; pitch tells you how much the rafter rises for every 12 inches of that run.

Ridge Rafter Run (½ span) Rise

Fig. 1 — Run, rise, and rafter length form a right triangle; pitch sets the ratio between run and rise

The formulas

  1. Run = span ÷ 2
  2. Rise = run × (pitch ÷ 12)
  3. Pitch multiplier = √(1 + (pitch ÷ 12)²)
  4. Rafter length = (run × pitch multiplier) + (overhang × pitch multiplier)
  5. Ridge height above wall plate = rise (plus any raised heel, if used)

A worked example

Say you're framing a 28 ft span at a 6/12 pitch, with a 1 ft overhang on each side.

Step by step

  1. Run: 28 ÷ 2 = 14 ft.
  2. Pitch multiplier at 6/12: √(1 + 0.5²) ≈ 1.118.
  3. Rise: 14 × 0.5 ≈ 7 ft — that's your ridge height above the wall plate.
  4. Core rafter length: 14 × 1.118 ≈ 15.65 ft.
  5. Overhang add-on: 1 × 1.118 ≈ 1.12 ft.
  6. Total rafter length: 15.65 + 1.12 ≈ 16.8 ft — round up to the next standard lumber length (18 ft stock, in this case).

Steeper pitches push that rafter length up quickly — an 8/12 pitch on the same 28 ft span adds almost a full foot of rafter length over 6/12, even though the span hasn't changed at all.

How many trusses does a roof need?

Truss count is a separate calculation from rafter geometry, and it's simpler: divide the building's length by your on-center spacing, round up, and add one for the extra truss at the far end.

Truss count formula

  1. Common trusses = ceil(building length ÷ spacing in feet) + 1
  2. Add 2 more for standard gable-end trusses (a typical gable roof)
  3. Add extras separately for hips, valleys, or girder trusses at openings — these aren't part of the standard spacing run

For a 40 ft long building at 24" o.c.: ceil(40 ÷ 2) + 1 = 21 common trusses, plus 2 gable ends = 23 total. Switch to 16" o.c. and that jumps to ceil(40 ÷ 1.333) + 1 = 31 common trusses — roughly 50% more material for a spacing change alone, which is exactly why spacing decisions belong in the budget conversation early, not after the truss package is already ordered.

Roof load, and why span tables exist

A rafter (or truss chord) isn't just holding up its own weight — it's carrying dead load (the permanent weight of roofing, sheathing, and insulation, typically 10–15 psf) plus live load, which for a roof is mostly snow, expressed as a ground snow load in pounds per square foot that your local code specifies. A roof load calculator, in practice, is really answering one question: given this species, grade, spacing, and load, what lumber size do I need to safely cover this span without excessive bending or deflection?

🪵 Species & gradeDouglas Fir-Larch is the strongest common framing species; Spruce-Pine-Fir is more widely available but allows somewhat shorter spans at the same size. Grade #2 is the residential default — #1 gains 12–18" of span over #2 at the same size.
📏 SpacingTighter spacing (12" o.c.) lets a given size span farther, since each rafter carries a narrower strip of roof. Wider spacing (24" o.c.) is more material-efficient but shortens the safe span.
❄️ Snow loadGround snow load is the single biggest swing factor. The same 2×8 that spans 15 ft with no snow load can drop to under 12 ft once a moderate 30 psf snow load is applied.
📐 Deflection limitCodes cap how much a rafter can bend under load, usually L/180 for roofs. On long spans, deflection — not raw strength — is often what actually limits the allowable span.

Rafter span calculator: reading the table

Here's a simplified reference for common 2× rafter sizes, Spruce-Pine-Fir #2, at 16" on-center — the residential standard spacing.

SizeNo snow (20 psf)Moderate snow (30 psf)Heavy snow (50 psf)
2×610'-6"9'-8"8'-3"
2×813'-11"12'-10"11'-0"
2×1017'-9"16'-4"14'-0"
2×1221'-7"19'-11"17'-0"

Rounded planning figures only — the calculator above lets you switch species, spacing, and load to check your exact combination against your required span.

Check your exact span and size

Run your numbers in the calculator above →

Choosing truss or rafter spacing

16" on-center is the residential default for a reason: it lines up cleanly with 4×8 sheathing sheets and standard drywall fastening schedules, and it comfortably handles most moderate snow loads without pushing lumber size up. 24" on-center cuts material count by roughly a third and is common on engineered trussed roofs with lighter loads, but it typically requires thicker sheathing (⅝" minimum) and isn't code-permitted for every heavy-snow combination. 12" on-center shows up when 16" simply can't hit the required span — heavy snow load, a vaulted ceiling with a structural ridge, or a size constraint on the lumber being used.

Mistakes that undersize a roof

  • Using rafter length as the span. Span tables measure horizontal projection, not the sloped rafter length — using the wrong one gives an artificially generous number.
  • Applying a generic "20 psf" table in a snow region. Skipping the local ground snow load figure is the single most common way a roof ends up undersized on paper.
  • Mixing up species defaults. A span that works for Douglas Fir-Larch can fall short with Spruce-Pine-Fir at the same size and spacing — always match the table to the lumber you're actually buying.
  • Cutting or notching a truss member. Unlike a rafter, a truss is an engineered system — removing or altering any web or chord without the truss manufacturer's approval can compromise the whole assembly.
  • Skipping the local code check. Span tables vary by adopted code edition and jurisdiction amendment — a figure that's correct in one county can be non-compliant in the next.

Why trust this guide

Geometry formulas follow standard right-triangle roof framing math used industry-wide. Span reference figures are simplified, rounded approximations of published IRC/AWC-style span tables for #2-grade dimensional lumber and are intended for early planning only — they are not a substitute for your jurisdiction's adopted building code table or a stamped design from a licensed engineer or truss manufacturer, both of which account for your exact local snow load, wind exposure, and code edition.

Working through a tricky span or an odd roof shape this calculator doesn't quite cover? Drop your numbers in the comments — happy to help you think it through.

Frequently Asked Questions

It uses the building span and roof pitch to work out the roof's geometry — run, rise, ridge height, and rafter length — as a right-triangle calculation, then uses building length and on-center spacing to work out how many trusses the roof needs.
Both share the same underlying geometry — span, pitch, and rise determine rafter length either way. The difference is structural: a rafter is a single site-cut beam sized against a span table, while a truss is a factory-engineered assembly whose internal members are custom-designed per project by the truss manufacturer.
Select your rafter size, species and grade, spacing, and ground snow load, then compare the maximum allowable span against the horizontal distance you actually need to cover. If your required span exceeds the maximum, step up a lumber size, tighten the spacing, or add a purlin and strut for mid-span support.
It combines dead load (the permanent weight of roofing, sheathing, and insulation — typically 10-15 psf) with live load, which for most roofs means the local ground snow load set by your building code. Together these determine the design load a rafter or truss chord must safely carry.
Divide the building's length by your on-center spacing, round up, and add one — that's your common truss count. Add two more for standard gable-end trusses, plus any extra hip, valley, or girder trusses your roof shape requires.
No. Span is the horizontal projection a rafter covers between supports — the number used in span tables. Rafter length is the actual sloped board length, always longer than the span once pitch is factored in.
Not without engineering approval. A truss is an engineered system where every chord and web member works together — cutting or removing even one piece without the manufacturer's sign-off can compromise the entire truss.

Related Article: Roof Pitch Calculator: Complete Guide

Related Article: Roof Shingle Calculator

Related Article: Metal Roof Cost Calculator

Similar Posts