Rafter Calculator

Work out common rafter length from the building span, the roof pitch and the overhang. The ridge board deduction is handled for you, and the calculation is shown step by step.

Quick answer: a 24 ft span at 8:12 with a 12 in overhang and a 2 in ridge gives a run of 12.92 ft and a rafter length of about 15.52 ft. The ridge sits 7.94 ft above the plate, and the rafter is 14.32 ft from the plate to the ridge face.

  • Ridge deduction included
  • Overhang included
  • Live geometry diagram

Rafter calculator inputs and results

Span is outside face to outside face; half of it is the run, and the ridge thickness is deducted from that.

Pitch and overhang use the same unit as the span.

Half of this is deducted from the run, because the rafter stops at the side face of the ridge rather than its centre line. Enter 0 if there is no ridge board.

run rise overhang section through the roof
Rise is vertical, run is level, overhang is measured out from the wall.

Results

Rafter length (with overhang)
15.52 ft
Line length to the ridge face, top edge
Half span
12 ft
Run incl. overhang
12.92 ft
Rise incl. overhang
8.61 ft
Rafter per 12 of run
14.42 units
Roof angle
33.69°
Rafter to wall line
14.53 ft

This is the top-edge length before any cuts; the plumb cut and the birdsmouth are taken out of the member, not added to it.

Show calculation

Rafter geometry

8:12 · 33.69°

The rafter is the hypotenuse of the run and the rise. The overhang extends the run past the wall, so it extends the rafter too.

What this rafter calculator works out

A common rafter on a symmetrical gable roof is the hypotenuse of a right triangle. The horizontal leg is the run — half the building span plus any overhang. The vertical leg is the rise, which follows from the pitch. The rafter is the distance between them.

This calculator builds that triangle from four things you can actually measure: the span between the walls, the pitch, the overhang and the thickness of the ridge board. It returns the rafter length, the run, the rise and the angle.

It also shows the length to the wall line, without the overhang. That number is useful when you are checking an existing roof, because the wall line is easy to find and the fascia is not.

What this is not. It is not a cut list. A finished rafter has a plumb cut at the ridge, a plumb cut at the fascia and a birdsmouth where it sits on the wall plate. Those are layout steps performed on the actual timber, not arithmetic this page can do for you.

How to use the rafter calculator

  1. Measure the span across the building, outside face to outside face. On a symmetrical gable this is twice the run.
  2. Enter the pitch as rise per 12. If you only know the angle, convert it with the roof pitch calculator.
  3. Enter the overhang measured horizontally from the wall to the fascia, not along the slope.
  4. Enter the ridge thickness, or 0 if the rafters meet at a point. Half of it is deducted from the run.
  5. Read the rafter length, then check the run and rise against your own measurements before cutting anything.

All four measurements must be in the same unit. The pitch is a ratio and has no unit.

Rafter formula

Five steps, each one shown in the calculator's working.

half span = span ÷ 2
run = half span − (ridge thickness ÷ 2) + overhang
rise = run × (pitch ÷ 12)
rafter = √(run² + rise²)
angle = atan(pitch ÷ 12) × 180 ÷ π

The deduction of half the ridge thickness is geometric, not a rule of thumb. A rafter's top end bears against the side face of the ridge board, and that face is half the board's thickness in from the centre line. Measuring to the centre line would make every rafter slightly too long.

The overhang is added to the run rather than to the rafter, because it is measured horizontally. Adding it to the rafter directly would understate the extra length, since the overhang follows the slope.

The result is the length along the top edge of the rafter. Because a rafter has depth, the bottom edge is shorter at the ridge end and longer at the eave end, and the plumb cuts remove material at both. That is why the number is a line length for sizing and checking, not a finished cut length.

One distinction the tiles make that is easy to miss. Rise incl. overhang is the height gained over the whole rafter line, tail included — 8.61 ft in the default example. The ridge height above the plate is smaller, because the tail does not climb towards the ridge: it is the run to the ridge face multiplied by the pitch ratio, 11.917 × 0.6667 = 7.94 ft. If you are setting out a ridge, 7.94 is the number you want.

Exposed timber roof framing inside an unfinished house, showing rafters rising to a ridge board above ceiling joists.
Exposed framing shows the rafter, the run and the rise as a right triangle before any covering hides them.

Worked rafter examples

Both examples use the defaults in the calculator above.

Example 1 — 24 ft span at 8:12 with a 12 in overhang

Half span
24 ÷ 2 = 12 ft
Ridge deduction
2 in ÷ 2 = 1 in = 0.0833 ft
Run to ridge face
12 − 0.0833 = 11.917 ft
Run including overhang
11.917 + 1 = 12.917 ft
Rise
12.917 × (8 ÷ 12) = 8.611 ft
Rafter length
√(12.917² + 8.611²) = 15.524 ft
rafter = √(12.917² + 8.611²) = √(166.84 + 74.15) = 15.524 ft

Example 2 — the same roof without a ridge board

Set the ridge thickness to 0 and the rafters are measured to the centre line, which is 1 in longer than the face.

Run including overhang
12 + 1 = 13 ft
Rise
13 × 0.6667 = 8.667 ft
Rafter length
√(169 + 75.11) = 15.624 ft
Difference
15.624 − 15.524 = 0.1 ft, about 1.2 in

Small differences matter on a rafter. A 1.2 in error at the ridge is a 1.2 in gap, and it compounds across the roof if every rafter is cut the same way.

rafter = √(13² + 8.667²) = 15.624 ft

Example 3 — checking an existing roof

You measure a 20 ft span at 6:12 and want to know how long the existing rafter should be, without the overhang, measured to the centre line.

Run
10 ft
Rise
10 × 0.5 = 5 ft
Rafter to wall line
√(100 + 25) = 11.18 ft

If the timber on the roof measures noticeably more than 11.18 ft from wall to ridge, the roof was probably built with an overhang on the same rafter, or the span is wider than 20 ft.

rafter = √(10² + 5²) = 11.18 ft

Rafter inputs, outputs and units

Building span
The full width the roof spans, wall to wall. Feet, metres, inches, centimetres or millimetres.
Roof pitch
Rise per 12 of run. A ratio with no unit.
Eave overhang
Horizontal distance from the outside face of the wall to the fascia. Measured in the same unit as the span.
Ridge board thickness
The actual thickness of the ridge, usually 1.5 in or 2 in for sawn timber. Enter 0 for no ridge.
Rafter length
Straight-line length along the top edge, from the ridge face to the end of the overhang, in the unit you entered.
Rafter per 12 of run
A unit-free figure for checking a framing square: the rafter length for every 12 units of horizontal run at this pitch.
Rafter length per 12 of horizontal run, by pitch.
PitchAngleRafter per 12Rise per 12
2:129.46°12.1662.00
3:1214.04°12.3693.00
4:1218.43°12.6494.00
5:1222.62°13.0005.00
6:1226.57°13.4166.00
8:1233.69°14.4228.00
10:1239.81°15.62010.00
12:1245.00°16.97112.00

Multiply the rafter-per-12 figure by your run divided by 12 to get the actual rafter length.

A carpenter cutting a timber roof rafter with a circular saw, the board supported on sawhorses in a workshop.
Rafters are cut slightly long and trimmed to the plumb-cut marks, so the calculated length is a checking figure rather than a finished cut length.

Rafter cuts and layout not covered here

Rafter length is the easy part. The layout is where most of the craft sits, and it is worth being clear about what is left to do after you have the number.

  • Ridge plumb cut. The angle of the cut at the top end. On a framing square this is the pitch number on the common rafter scale, set against the level line.
  • Fascia plumb cut. The matching cut at the tail. On a gable with a level fascia these two cuts are parallel.
  • Birdsmouth. The seat cut and its plumb shoulder where the rafter sits on the wall plate. The depth of the seat cut is limited by the rafter's width — cutting too deep weakens the member, and the calculate birdsmouth cut figures show how much section is left.
  • Rafter thickness. The number here is a line length along the top edge. Because the rafter has depth, the ridge plumb cut is measured at a different point on the top edge than on the bottom.
  • Spacing and count. Set by the structural design and the covering, not by this calculator.

If any of this is unfamiliar, the length figure is still useful for ordering material and for a sanity check on a quote. It is not a substitute for a framing layout done by someone competent to do it.

Two neighbours on the same roof use different geometry. A calculate hip rafter is longer than a common because it runs diagonally, and a jack rafter calculation gives the stepped series that fills the triangles either side of it. Neither follows from the number on this page.

Structural work is not a calculator question. Rafter size, spacing, ridge size, connections and bracing are structural decisions governed by the building code adopted in your area and by an engineer's or designer's specification. This page computes a length. It says nothing about whether the member is adequate.

Rafter code requirements

The length is geometry, and geometry does not care what code you build to. But three provisions decide whether the rafter you just measured is allowed to exist.

IRC R802.4.1 is the one that governs size. Rafters are sized from Tables R802.4.1(1) to (8), by species, grade, member size, spacing and load — and the spans in those tables are measured along the horizontal projection of the rafter, not along its length. That is the run on this page, not the rafter. It is a common source of confusion when someone tries to check a 15.5 ft rafter against a 15.5 ft span limit.

IRC R802.3 covers the ridge board: not less than 1 in nominal in thickness, and not less in depth than the cut end of the rafter. That is why the ridge has to match the rafter's plumb cut rather than being whatever board is on the pile.

IRC R802.2 is the one that gets skipped: the roof and ceiling assembly must provide continuous ties across the structure so that roof thrust is not applied to the supporting walls. A pair of rafters meeting at a ridge pushes outward at the plate, and without a tie that push goes into the walls. The span tables assume that tie is present — Table R802.4.1(1) footnote 1 says so explicitly, and requires the tabulated spans to be reduced where the ties sit higher in the attic.

Notching is covered separately. R802.7.1 routes rafter cutting and notching to R502.8.1, which limits end notches to a quarter of the member depth. The birdsmouth is that notch, and the section above sets out what the calculator does and does not do about it.

Rafter limitations

  • Symmetrical gable only. Both sides share one pitch and the ridge sits at the centre.
  • Common rafters. Hip, valley and jack rafters have different plan geometry.
  • Straight line, no camber. Real timber is not perfectly straight and roofs deflect under load.
  • No plumb cut allowance. The length is to the theoretical end points, not the sawn ends.
  • No birdsmouth. The seat cut changes how the rafter sits on the plate, which affects the finished height of the roof.
  • Not a structural check. Nothing here verifies that the member or the connection is adequate.
  • Trusses instead. A manufactured truss replaces the rafter and the ceiling tie in one engineered unit, and the roof truss calculator covers the spacing and span side of that. Trusses must not be cut or notched on site.
  • No gable end. The triangle of studwork that closes the end of the roof is a separate calculation, handled by calculate gable end framing.

For anything you are going to build, treat this as a planning and checking tool, and have the framing confirmed by someone qualified to specify it. To turn a run of rafters into an order, the roof lumber calculator converts member lengths into board feet.

Roof Pitch Resources and Guides

Reference values for the pitches you are most likely to be framing.

Frequently asked questions

From the right triangle the rafter sits on. The horizontal leg is the run, the vertical leg is the rise, and the rafter is the hypotenuse: rafter = √(run² + rise²), where rise = run × (pitch ÷ 12). For a 12 ft run at 8:12: rise = 12 × 0.6667 = 8 ft, and rafter = √(144 + 64) = 14.42 ft.

Because most people measure the building, not the roof. On a symmetrical gable the run is half the span, so entering the span is one less step and one less chance to halve the wrong number. If you already know the run, halve the span field's value by entering twice the run. The calculator shows the half span it used, so you can check it.

Yes, if the rafters butt against a ridge board. The rafter's top end lands on the side face of the ridge, which sits half the ridge thickness in from the centre line. So the horizontal run to that face is the half span minus half the ridge thickness. Enter 0 for the ridge thickness if the rafters meet at a point, or if you want the length measured to the centre line. The calculator shows both the run to the ridge face and the run to the centre line, so you can see the difference the deduction makes.

No. The overhang extends the rafter along the same slope, so the pitch, the angle and the rise per foot are unchanged. It only makes the rafter longer. A 2 ft overhang on a 12 ft run adds 2 ft to the horizontal run and about 2.4 ft to the rafter length at 8:12, because the added length follows the slope rather than the horizontal.

No. The result is the straight-line length from the outside of the wall to the end of the rafter, measured along the top edge. It does not include the plumb cut at the ridge, the plumb cut at the fascia, or the birdsmouth where the rafter sits on the wall plate. Each of those is a separate layout step. Use this number to size the material and to check your layout, then mark the cuts from the actual rafter you are holding.

The birdsmouth is the notch cut where the rafter sits over the wall plate. It is usually formed by a horizontal seat cut and a vertical plumb cut, and it lets the rafter bear flat on the plate instead of resting on one edge. It does not shorten the rafter's overall length, but it does change how the rafter sits, so the height of the roof and the position of the overhang depend on it. The seat cut depth is limited by the rafter's width, which is a structural consideration rather than a geometric one.

That is a spacing question, not a length question. Divide the length of the building by the rafter spacing, add one for the end, and round up. At 24 in centres on a 40 ft building you need 21 rafters per side. Spacing is set by the structural design and the roof covering, so confirm it with whoever is specifying the roof rather than picking a number here.

Partly. On a shed roof the span field is not half the building width — the run is the full horizontal distance from the low wall to the high wall. Enter twice that distance in the span field so the calculator halves it back to the correct run, or use the rise and run calculator to solve the run first.

Usually one of three things: the pitch was estimated rather than measured, the run was taken to the wall face rather than the outside face, or the existing rafter has a seat cut that changes where it bears. An existing roof may also have sagged, or been built with a nominal pitch that is not exactly the one on the drawing. Measure the actual rise and run of the rafter you are matching, and use those numbers.

Not directly. Hip and valley rafters run at an angle across the plan, so their run is the diagonal of the corner rather than half the span, and their length is longer than a common rafter at the same pitch. The same Pythagorean relationship applies, but the run must be the true plan length of that rafter. This calculator solves common rafters on a symmetrical gable.

Where these numbers come from

The length is Pythagoras applied to a right triangle. The pitch ratio gives the rise for a known run, and the rafter is the hypotenuse. Nothing on this page depends on a manufacturer's table or an empirical constant.

Two things here are not arithmetic:

  • Structural adequacy. Rafter size, spacing, span limits and connections come from the building code adopted in your area and from a designer's specification. This page does not check any of them. The provisions quoted above are from Chapter 8 of the International Residential Code, sections R802.2, R802.3, R802.4.1 and R802.7.1.
  • Safe work at height. Fall-protection requirements depend on where you work and who you work for. In the United States, the Occupational Safety and Health Administration publishes the applicable standards — see osha.gov/fall-protection.

No claim on this page has been reviewed or endorsed by any code body, manufacturer or trade association.

Need the roof area as well?

Once you know the rafter, the sloped area follows from the same pitch factor.

Calculate roof area See the pitch chart
Back to the calculator
Scroll to Top