# Roof Framing Calculator

Roof framing calculator for gable and shed roofs. Calculate rafter length, ridge board, rafter count, and total linear feet needed. Shed roof framing calculator included.

## What this calculates

Framing a roof starts with numbers: rafter length, rafter count, and ridge board dimensions. This roof framing calculator takes your building span, length, roof pitch, and overhang, then returns everything you need to order lumber with confidence. It handles both two-sided gable roofs and single-slope shed roofs, and works for additions, garages, sheds, and new construction.

## Inputs

- **Roof Type** — options: Gable (two-sided), Shed (single slope)
- **Building Span (Width)** (ft) — min 0 — Wall-to-wall width (narrow dimension of building)
- **Building Length** (ft) — min 0 — Wall length (long dimension) for rafter count
- **Roof Pitch** (:12) — min 0.5, max 24 — Rise per 12 inches of run. 4:12 is minimum for shingles; 12:12 is steep.
- **Eave Overhang** (in) — min 0 — Typical: 12-24 in. Shed roof framing calculator users often use 6-12 in.
- **Rafter Spacing (On-Center)** — options: 12 in OC (heavy load), 16 in OC (standard), 24 in OC (light load)

## Outputs

- **Rafter Length (each)** (ft) — Includes overhang
- **Rafter Length** — formatted as text — Feet and inches format
- **Rafters per Side**
- **Total Rafters** — Both sides of gable roof
- **Ridge Board Length** (ft) — Equals building length
- **Total Rafter Linear Feet** (ft) — All rafters combined, round up to stock lengths
- **Plumb Cut Angle** (°) — Ridge and tail cut from vertical

## Details

## Roof Framing Basics

A rafter forms the hypotenuse of a right triangle where:

- **Run** = horizontal distance from outside wall to ridge (half the building span for a gable; full span for a shed)
- **Rise** = vertical height gained (run x pitch/12)
- **Rafter Length** = sqrt(run^2 + rise^2) + overhang rafter

Pitch is expressed as rise per 12 inches of run. A 6:12 pitch gains 6 inches of height for every foot of horizontal run (about 26.57 degrees from horizontal).

## Gable vs Shed Roof Framing

**Gable roofs** have two opposing slopes that meet at a central ridge board. Rafters on each side connect the top plates of the exterior walls to the ridge. For a 24-ft span, each rafter has a 12-ft run (minus half the ridge board thickness).

**Shed roof framing calculator** use a single slope. The rafter runs the full building width, connecting a tall wall on one side to a shorter wall on the other. Sheds, lean-to additions, and modern minimalist homes frequently use shed roofs.

## Worked Example

A 24x40 ft garage with a 6:12 pitch and 12-in overhang:

- Run = 24/2 - 0.0625 = **11.94 ft**
- Rise = 11.94 x 0.5 = **5.97 ft**
- Main rafter = sqrt(11.94^2 + 5.97^2) = **13.35 ft**
- Overhang rafter = sqrt(1.0^2 + 0.5^2) = **1.12 ft**
- Total rafter length = **14.47 ft** (buy 16-ft lumber)

At 16-in OC spacing on 40-ft walls: 40 x 12 / 16 + 1 = **31 rafters per side**, **62 total** for a gable.

## Rafter Size and Spacing

Rafter dimensions depend on span, spacing, and roof load. Common sizing (at 30 PSF live load, 16 in OC):

| Rafter Size | Max Span |
|---|---|
| 2x6 | 10 ft |
| 2x8 | 14 ft |
| 2x10 | 18 ft |
| 2x12 | 22 ft |

Always check your local building code and IRC span tables for your species, grade, and snow load.

## Cut Angles

Plumb cuts (at the ridge and at the rafter tail) equal the roof angle from horizontal. For a 6:12 pitch: atan(6/12) = **26.57 degrees**. The seat cut (birdsmouth on the wall plate) is the complement: 63.43 degrees.

Mark these cuts with a framing square set to the pitch rise (6 inches) and tongue (12 inches), or use a speed square pivoted to 26.57 degrees.

## Ridge Board Sizing

The ridge board needs to be at least 1 inch deeper than the rafter depth. For 2x8 rafters, use a 2x10 ridge board. The ridge runs the full length of the building and connects opposing rafters through plumb cuts on each side.

## Collar Ties and Rafter Ties

Building code requires rafter ties (horizontal members in the lower third of the rafters) to prevent the walls from spreading under roof load. Collar ties (upper third) stiffen the ridge against uplift. Plan these into your framing before starting.

## Frequently Asked Questions

**Q: How do I calculate roof rafter length?**

A: Rafter length = sqrt(run^2 + rise^2) + overhang rafter. Run is half the building span (for a gable) minus half the ridge board thickness. Rise is run times pitch/12. For a 24-ft span with 6:12 pitch: run = 11.94 ft, rise = 5.97 ft, main rafter = 13.35 ft. Add the overhang rafter (about 1.1 ft for a 12-in overhang) for a total of 14.47 ft.

**Q: What does a shed roof framing calculator compute differently?**

A: A shed roof framing calculator uses the full building span as the rafter run, not half the span like a gable. Rafter length for a shed is sqrt(span^2 + rise^2) + overhang. A 12-ft wide shed with 3:12 pitch has a 12-ft run, 3-ft rise, and a 12.37-ft rafter. No ridge board is needed because there's only one slope.

**Q: How many rafters do I need for a 40 ft building?**

A: At 16-inch on-center spacing: 40 ft x 12 in / 16 in + 1 = 31 rafters per side. Double that for a gable roof: 62 rafters total. At 24-inch OC, you need 21 per side (42 total). Add 2-4 extras for waste and any hip or valley situations.

**Q: What size rafters for a 24 ft span?**

A: For a 24-ft span with 12-ft rafter run at 16-in OC and 30 PSF load: 2x10 Southern Pine #2 handles the load. 2x12 is safer for snow zones. Rafter size also depends on species and grade. Consult IRC Table R802.5.1(1) or a local engineer for loads above 30 PSF.

**Q: What pitch should a roof be for snow?**

A: In heavy snow zones, use at least 5:12 pitch so snow slides off before accumulating dangerous loads. Metal roofs can be as low as 3:12 because snow slides readily. Flat and low-slope roofs (under 3:12) need engineered snow load calculations and drainage provisions.

**Q: How do I cut a birdsmouth notch?**

A: A birdsmouth is the notch where the rafter sits on the wall plate. It has a plumb cut (vertical, matching the roof angle) and a seat cut (horizontal, at least 1.5 inches deep to bear on a 2x4 top plate). Never remove more than 1/3 of the rafter depth or you weaken the rafter. Mark with a framing square set to the pitch.

---

Source: https://vastcalc.com/calculators/construction/roof-framing
Category: Construction
Last updated: 2026-04-08
