Skip to the calculator
CalcBuilt

Rafter Length Calculator

Calculate common rafter length from the building span and roof pitch, including the ridge board deduction and overhang, plus the rise, cut angle and board length to buy.

By CalcBuilt Editorial TeamUpdated September 11, 2026Formulas checked against manufacturer specs, see how we calculate.

Quick answer: To find rafter length, subtract half the ridge thickness from half the span to get the run, multiply the run by the pitch factor, and add the overhang times the same factor. A 24 ft span at 6/12 with a 1.5 in ridge and 1 ft overhang needs a rafter 14.46 ft long, so buy 16 ft boards.
Your measurements
run 12riseoverhangHouse width
Gable end: pitch is the rise over a 12 in run; the factor from that pitch turns footprint into roof area.
Results update as you type. The link in your address bar saves these entries.

Results

Rafter length
14.46 ft
Ridge to tail along the top edge, including 1.12 ft for the overhang
Length without overhang
13.35 ft
Run of 11.94 ft x pitch factor 1.118
Rise
5.97 ft
Height of the ridge above the top plate, before the heel stand
Board length to buy
16 ft
Rounded up to the next even 2 ft lumber length
Roof angle
26.6 degrees
Lay out plumb and seat cuts with a framing square at 6 in rise over 12 in run

Rafter Length formula

Run (ft) = (Span - ridge thickness / 12) / 2
Pitch factor = sqrt(1 + (rise / 12)^2)
Rafter length = Run x Pitch factor + Overhang x Pitch factor
Rise = Run x rise / 12

Worked example

A 28 ft wide garage with an 8/12 roof, a 2x ridge (1.5 in) and 1.5 ft overhangs: run = (28 - 0.125) / 2 = 13.94 ft. The 8/12 pitch factor is 1.202, so the line length is 13.94 x 1.202 = 16.75 ft. The overhang adds 1.5 x 1.202 = 1.80 ft, for a total rafter of 18.55 ft. Buy 20 ft boards.

The rise is 13.94 x 8 / 12 = 9.29 ft, and the roof angle is atan(8 / 12) = 33.7 degrees. Mark the plumb cut at the ridge, measure 16.75 ft along the top edge to the building line for the birdsmouth, then continue 1.80 ft to the tail cut.

Quick reference

Rafter length by span and pitch (run = half the span, no ridge deduction or overhang)
Span4/126/128/12
20 ft10.54 ft11.18 ft12.02 ft
22 ft11.60 ft12.30 ft13.22 ft
24 ft12.65 ft13.42 ft14.42 ft
26 ft13.70 ft14.53 ft15.62 ft
28 ft14.76 ft15.65 ft16.83 ft
30 ft15.81 ft16.77 ft18.03 ft
32 ft16.87 ft17.89 ft19.23 ft

How to calculate rafter length

A common rafter is the hypotenuse of a right triangle whose base is the run and whose height is the rise. The run is half the building span, less half the thickness of the ridge board. Multiply the run by the pitch factor, sqrt(1 + (rise/12)²), to get the line length from the ridge to the outside of the wall plate. Then add the overhang times the same factor for the tail.

This line length is measured along the top edge of the rafter from the long point of the plumb cut to the heel of the birdsmouth. It does not include the depth of the rafter or the heel stand. A 2x8 and a 2x10 cut to the same numbers will land in the same place on the wall. Buy lumber in the next even length; a 14.46 ft rafter comes out of a 16 ft board with little waste.

Cutting and sizing rafters

Set a framing square to the pitch, rise on the tongue and 12 on the blade, and mark the plumb cut at the ridge end. Measure the line length along the top edge, mark the birdsmouth plumb line, then square off the level seat cut. IRC R802.7.1 caps an end notch at one quarter of the rafter depth, 1-13/16 in on a 2x8. At 8/12 a full 3-1/2 in seat notches 2-3/8 in. Shorten the seat, since R802.6 needs only 1-1/2 in of bearing, or go to a 2x10. Cut one, test it at both ends of the building, then gang cut.

Rafter size comes from IRC Tables R802.4.1(1) to (8) by species, grade, spacing and snow load, and the table span is the horizontal run, not the rafter length. The tables assume ceiling joists or rafter ties at the plate. A tie raised into the attic cuts the allowable span by the factor in R802.5.2, about 0.67 at one third of the rise. With no tie, as under a cathedral ceiling, the ridge must be a beam on posts to the foundation (R802.5.2). Collar ties, 1x4 every 4 ft in the upper third, or ridge straps resist uplift (R802.4.6).

What this calculator leaves out

Hip, valley and jack rafters, sub-fascia and sheathing, ceiling joists and collar ties. Hurricane ties such as a Simpson H2.5A wherever R802.11 uplift exceeds the 200 lb a toenail carries. Lumber over 20 ft is a special order; a rafter that long is easier as LVL or with a purlin brace.

Code limits that apply

  • IRC R802.3checked

    Below 3/12 the ridge, hips and valleys are beams; the ridge board is as deep as the plumb cut

    If you miss it: A 2x8 ridge under 2x8 rafters leaves the plumb cut hanging past the board; the inspector sees it from the attic hatch

  • IRC Table R802.4.1

    Allowable rafter span by species, grade, spacing and snow load, measured on the horizontal run

    If you miss it: Rafters sized by their cut length instead of the run come out a size light and the ridge sags; each one gets a sister

  • IRC R802.7.1

    Notch at a rafter end 1/4 the depth max; 1-13/16 in on a 2x8, 2-5/16 in on a 2x10

    If you miss it: A full 3-1/2 in seat on a 2x8 at 8/12 notches 2-3/8 in and splits along the grain; the whole run is a 2x10 re-cut

  • IRC R802.6

    Rafter bearing 1-1/2 in min on wood or metal, 3 in on masonry

    If you miss it: A seat cut under 1-1/2 in leaves the rafter on the plate edge; the inspector asks for filler blocks under every heel

  • IRC R802.5.2

    Rafter ties at the plate; a raised tie shortens the span, no tie means a ridge beam on posts

    If you miss it: A vaulted ceiling on a ridge board spreads the walls a little each year; the fix is a ridge beam and posts to the foundation

  • IRC R802.4.6

    Collar ties 1x4 min at 4 ft OC in the upper third, or ridge straps on every rafter pair

    If you miss it: No collar ties and no straps: wind uplift opens the ridge joint; the inspector counts them from the hatch

  • IRC R802.11

    Rafter to plate connection sized for uplift; a hurricane tie where uplift exceeds 200 lb

    If you miss it: Toenails alone in a high-wind county get tagged; H2.5A ties go on from the eave after the roof is sheathed

Rows marked checked produce a warning in the results when an entry crosses the limit. The others are on the plans or on site and this calculator does not test them. Local amendments can be stricter; the adopted edition and the inspector govern.

Mistakes that cost money

  • A 3-1/2 in seat cut on a 2x8 at 8/12 notches 2-3/8 in, past the 1/4 depth limit of R802.7.1; 1-1/2 in bearing is enough.
  • A 2x8 ridge board with 2x8 rafters: the plumb cut at 6/12 is 8-1/8 in and R802.3 wants the ridge that deep; use a 2x10.
  • A ridge board on a cathedral ceiling: with no ceiling joists or rafter ties the walls spread; R802.5.2 calls for a ridge beam on posts.
  • Skipping collar ties: the IRC wants 1x4 ties every 4 ft in the top third of the attic, or ridge straps, against wind uplift.
  • Taking the span off the plans instead of the plates: a wall an inch out changes the rafter; measure outside plate to outside plate first.
  • Sizing rafters by rafter length: IRC span tables use the horizontal run, and a tie raised above the plate shortens the allowed span.

Key facts

  • Rafter tables stamped on a framing square give the rafter length per foot of run for each pitch: 13.42 in at 6/12, 14.42 in at 8/12, 16.97 in at 12/12.
  • Pitch factors: 4/12 = 1.054, 6/12 = 1.118, 8/12 = 1.202, 10/12 = 1.302, 12/12 = 1.414.
  • Half the ridge board thickness is deducted from each rafter run, because the rafters bear on the faces of the ridge, not its center.
  • Under the IRC, the birdsmouth notch at the end of a rafter may not exceed one quarter of the rafter depth.
  • Rafter size and spacing depend on span, species, grade and snow load; IRC Table R802.4.1 lists allowable spans for 2x6 through 2x12 rafters.

Frequently asked questions

How long should rafters be for a 24 ft wide house?

At a 6/12 pitch with a 1.5 in ridge and no overhang, the run is 11.94 ft and the rafter is 13.35 ft. With a 1 ft overhang it is 14.46 ft, so buy 16 ft lumber.

Do you subtract the ridge board when calculating rafter length?

Yes. Subtract half the ridge thickness from the run of each rafter, since the rafters bear against the faces of the ridge board. For a 2x ridge that is 3/4 in per rafter.

What size lumber do I need for rafters?

It depends on span, spacing, species, grade and snow load. IRC Table R802.4.1 gives allowable spans; for many houses a 2x8 or 2x10 at 16 in on center works, but check the table or ask your building department.

Do I need a ridge beam or a ridge board?

A ridge board only holds the rafter tops in line; the ceiling joists or rafter ties keep the walls from spreading. With a cathedral ceiling and no ties, the IRC requires a ridge beam supported on posts down to the foundation (R802.5.2). Size it from the AWC span tables or the LVL maker's beam tables, or have an engineer do it. Either way the ridge must be at least as deep as the rafter plumb cut (R802.3).

Sources and references

Next steps for this project

  1. Roof Pitch
  2. Roofing
  3. Shingles
  4. Rafter Length
  5. Gutters
  6. Soffit & Fascia
  7. Siding

The usual order for a roofing & siding project. See all roofing & siding calculators.

Embed this calculator

Results are estimates based on standard formulas and typical product specifications. Confirm quantities with your supplier and local code before ordering.