Construction, Carpentry & Concrete Roofing & Rafters IRC 2021 R802 rafter framing

Rafter Length Calculator (Common Rafter)

A common rafter is cut to a line length — the distance along its top edge from the ridge plumb cut to the heel of the birdsmouth — plus a tail that carries the overhang. This calculator gives you both, from the span or run, the pitch, the thickness of the ridge board and the horizontal projection of the eave. It also returns the total rise at the ridge, the plumb cut angle to set on a saw, how many rafters the roof takes at your spacing, and the shortest stock length that will cover the cut.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Dimension you are enteringUse span for a symmetric gable; use run for a shed roof, a porch, or an unequal-pitch roof.Full building span (plate to plate)
Span or runMeasure outside face of wall plate to outside face; the run is half of that on a symmetric gable.24 ft
Pitch (rise per 12 in of run)The x in a pitch written x:12, taken from the plans or a pitch gauge on an existing rafter.6 in
Ridge board thicknessActual thickness, not nominal — a 2x ridge board is 1.5 in; enter 0 if rafters butt to each other.1.5 in
Eave overhang (horizontal)Horizontal projection from the outside of the wall to the fascia — the calculator converts it to sloped tail length.12 in
Roof length along the ridgeThe dimension the rafters are laid out along; used only for the rafter count.40 ft
Rafter spacingCentre-to-centre spacing; it must match the spacing the span tables were checked against.16 in on centre
Roof planes to frameA gable roof needs a row of common rafters on each side of the ridge.Two — gable roof

It returns

  • Rafter line length — Ridge plumb cut to the heel of the birdsmouth, measured along the top edge.
  • Overall cut length with tail
  • Tail length — Sloped length of the overhang, from the birdsmouth heel to the tail cut.
  • Total rise at the ridge — Measured from the top of the wall plate over the full run.
  • Plumb cut angle — Set this off square on a mitre saw; the seat cut is 90° minus this.
  • Common rafters needed
  • Shortest stock length that works

The formula

L=(runridge24)x2+14412
θ=arctan(x12)
N=12Ls+1

In plain text: L = (run − ridge/24) × √(x² + 144) / 12

  • LRafter line length, ridge plumb cut to birdsmouth heel (ft)
  • runHorizontal run: half the span on a symmetric gable (ft)
  • ridgeActual ridge board thickness; divided by 24 converts half of it from inches to feet (in)
  • xRise in inches per 12 inches of run (in)
  • tailSloped tail length = horizontal overhang × slope factor (ft)

The slope factor √(x²+144)/12 converts any horizontal distance into distance measured along the roof, so the same multiplier gives the line length from the run and the tail length from the overhang.

Updated Category Roofing & Rafters Verified against published test cases Reading time 12 min

Line length, tail length and why they are measured separately

A common rafter has two distinct parts and they are laid out from different reference points. The line length runs from the ridge plumb cut down to the heel of the birdsmouth — the point where the rafter's top edge crosses the outside face of the wall plate. The tail continues past that point to carry the overhang. Framers set the line length first because it fixes where the rafter bears; the tail is often left long and cut to a chalk line once the rafters are up, so the fascia runs dead straight regardless of small variations in the wall.

Both lengths come from the same idea. Along a roof plane, every horizontal foot of travel corresponds to √(x² + 144)/12 feet of rafter, where x is the rise per 12 inches of run. That ratio is the slope factor. Multiply the horizontal run by it and you get line length; multiply the horizontal overhang by it and you get tail length. Nothing else in rafter layout is as consequential as remembering that the run and the overhang are both horizontal measurements.

The one adjustment is the ridge. Rafters meet a ridge board rather than a mathematical point, so each rafter stops half a ridge thickness short of the centreline. A nominal 2x ridge is 1.5 in thick, so you deduct 0.75 in from the run — measured horizontally, not along the rafter. Forget it and every rafter is long by about 0.84 in at 6:12, which pushes the ridge up and the walls out.

The three cuts, and the angles that make them

The ridge plumb cut is vertical when the rafter is in place. Because the rafter itself is tilted by the roof angle θ = arctan(x/12), a vertical line crosses the rafter's edge at θ off square — which is exactly what you dial into a mitre saw. At 6:12 that is 26.57°. On a framing square you get the same cut by holding 12 on the blade and 6 on the tongue and marking along the tongue.

The seat cut is horizontal, so it is the complement: 90° − θ, or 63.43° at 6:12. Together with the heel plumb cut it forms the birdsmouth, the notch that sits the rafter down onto the plate. The depth of that notch is a code question rather than a geometry question — the birdsmouth calculator sizes the seat so enough of the rafter's depth is left above the notch to carry the load.

The tail cut is usually plumb, so it takes the same angle as the ridge cut, and a level cut is added where a soffit returns to the wall. If you are cutting the tails before the rafters go up, remember that the overall length you cut to is the line length plus the tail length, both measured along the top edge.

Stepping off with a framing square gives the same answer without any of this arithmetic: you walk the square down the stock once per foot of run, then step off the fractional part. The calculator is faster and it does not accumulate the small error that each step of the square introduces, but knowing the square method tells you immediately when a number looks wrong.

Worked example: a 24 ft span at 6:12 with a 12 in overhang

A garage measures 24 ft across the plates. The roof is a 6:12 gable on a 2x ridge board, with 12 in eaves and rafters at 16 in on centre along a 40 ft length.

  1. Total run. 24 ÷ 2 = 12 ft.
  2. Ridge deduction. The ridge is 1.5 in thick, so deduct half of it: 0.75 in = 0.0625 ft. Run becomes 11.9375 ft.
  3. Slope factor. √(6² + 144) ÷ 12 = √180 ÷ 12 = 13.41641 ÷ 12 = 1.118034.
  4. Line length. 11.9375 × 1.118034 = 13.3465 ft. In inches that is 160.16 in, so 13 ft 4-3/16 in on the tape.
  5. Tail length. 1 ft of horizontal overhang × 1.118034 = 1.118 ft, or 13-7/16 in.
  6. Overall cut length. 13.3465 + 1.118 = 14.4646 ft — 14 ft 5-9/16 in. A 16 ft stick covers it with enough left for the plumb cuts.
  7. Total rise. 12 ft of run × 6/12 = 6 ft from the top of the plate to the top of the roof at the ridge centreline.
  8. Cut angles. Plumb cut arctan(6/12) = 26.57°; seat cut 63.43°.
  9. Count. 40 ft × 12 = 480 in; 480 ÷ 16 = 30 bays, so 31 rafters per side and 62 in total.

Cut one rafter, carry it up, and test-fit it at both ends of the building before you cut the other 61. That single check catches a wrong pitch, a missed ridge deduction and an out-of-square building in one go.

What the numbers tell you before you cut

The stock length decides your waste. Dimension lumber comes in even lengths to 20 ft and occasionally 24 ft. An overall length of 14.46 ft takes a 16 ft stick and leaves 16 − 14.46 = 1.54 ft of drop per rafter; at 62 rafters that is 95 ft of offcut, which is worth a second look at the overhang or at ordering precut stock. If the overall length lands just over a stock size, shortening the tail by an inch or two often drops you a size.

Line length does not tell you the rafter is strong enough. Size comes from the span tables in IRC section R802, which key on the horizontal span, the species and grade, the spacing, the ground snow load and whether a ceiling is attached. A 2x6 that works at 16 in on centre may not work at 24 in. Check the table for your case, or use an engineered design.

The count assumes an even layout with a rafter at each end. Real roofs add rafters at openings, doubled rafters at chimneys and skylights, and gable-end studs or a ladder framed rake. Treat the count as a starting order and add for those.

The rise tells you whether the roof clears. Six feet of rise on a 24 ft garage means the ridge sits 6 ft above the plate, before you add the ridge board depth. Check that against your height limit and against any dormer, wall or window the roof has to pass.

Rafter length per foot of run, by pitch

The rafter table stamped on a framing square, plus the saw settings. Column two is the line length gained per foot of run; multiply it by your run in feet to get line length in inches.
PitchLine length per ft of runPlumb cutSeat cutLine length for a 12 ft run
1:1212.0416 in4.76°85.24°12' 0-1/2"
2:1212.1655 in9.46°80.54°12' 2"
3:1212.3693 in14.04°75.96°12' 4-7/16"
4:1212.6491 in18.43°71.57°12' 7-13/16"
5:1213.0000 in22.62°67.38°13' 0"
6:1213.4164 in26.57°63.43°13' 5"
7:1213.8924 in30.26°59.74°13' 10-11/16"
8:1214.4222 in33.69°56.31°14' 5-1/16"
9:1215.0000 in36.87°53.13°15' 0"
10:1215.6205 in39.81°50.19°15' 7-7/16"
11:1216.2788 in42.51°47.49°16' 3-3/8"
12:1216.9706 in45.00°45.00°16' 11-5/8"

Line length per foot of run is √(x²+144), the number stamped on the first line of a framing square's rafter table. The plumb cut is arctan(x/12) and the seat cut is its complement.

Geometry here, structure in IRC R802

This calculator solves the layout geometry of a common rafter. It does not size the member. Rafter size, species, grade, maximum span and the required birdsmouth bearing come from the International Residential Code, chapter 8, section R802 and its span tables — the 2021 edition is assumed here — or from an engineered design where the roof falls outside those tables. Snow load, dead load and ceiling attachment all change the answer, and your jurisdiction may amend the code.

Mistakes that put every rafter out

  • Measuring the overhang along the rafter. The overhang input is horizontal. A tail measured on the slope already carries the slope factor, so entering it here applies that factor a second time. On a 6:12 roof a 13.4 in sloped tail entered as the overhang yields a 15.0 in tail — 1.6 in of error on every rafter.
  • Skipping the ridge deduction. Half the ridge thickness, taken off the run horizontally. At 6:12 a 1.5 in ridge shortens each rafter by 0.84 in along its length.
  • Deducting the full ridge thickness. Each rafter only meets one face of the ridge, so it is half, not all.
  • Using the span where the run belongs. On a symmetric gable the run is half the span. Enter the span and let the calculator halve it, or switch the selector to run.
  • Measuring line length along the bottom edge. Line length is measured on the top edge of the rafter, which is the edge the plumb cut lines are struck from.
  • Assuming both plates are level and the building is square. Shim the plates or scribe the birdsmouths; a 1/2 in dip at one plate shows up as a wave in the fascia.
  • Forgetting that a shed roof has one row of rafters, not two. Set the roof planes selector to one, or you order twice the lumber.

Beyond the common rafter

Common rafters are the simple case: they run square from plate to ridge in the direction of steepest slope. Hip and valley rafters run diagonally and need a different multiplier, √(x² + 288)/12, along with backing or dropping so the sheathing planes meet cleanly — the hip and valley rafter calculator handles those. Jack rafters shorten by a fixed common difference along the hip, which follows from the same slope factor and the spacing.

If you only need the pitch conversions — degrees, percent, slope factor — the roof pitch calculator is the quicker tool. If you are ordering material rather than cutting it, the roof area calculator turns the same span and pitch into sloped area and squares, and the board foot calculator converts the rafter list into board feet for pricing.

Beyond about 16 ft of run, site-cut rafters usually give way to trusses, which move the structural design to the truss manufacturer's engineer. Site cutting still wins where you want a cathedral ceiling, an unusual plan, or a small structure where a truss order is not worth the lead time.

Frequently asked questions

How do I calculate rafter length for a shed roof?

Enter the run rather than the span, because a shed roof has a single slope and the run is the full horizontal distance from the low wall to the high wall. Set the roof planes selector to one so the count is not doubled, and set the ridge thickness to zero unless the rafters butt into a ledger or a beam that takes up horizontal space. The line length is then run × slope factor, and the tail is handled the same way as on a gable.

What is the difference between line length and overall length?

Line length stops at the birdsmouth heel, where the rafter crosses the outside face of the wall plate. Overall length adds the tail that carries the overhang, so it is the length of stock the cut consumes. Layout uses line length because that is what sets the rafter on the wall; ordering uses overall length.

Do I deduct the full ridge thickness or half?

Half. Each rafter lands on one face of the ridge board, so its run stops half a thickness short of the ridge centreline. For a nominal 2x ridge that is 0.75 in of horizontal run. Deducting the whole 1.5 in makes every rafter 0.84 in short along its length at 6:12 (0.75 × 1.118), and you then get one of two problems: hold the birdsmouths down on the plates and the ridge settles about 3/8 in low, or hold the ridge at its design height and every plumb cut stands off the ridge board.

What angle do I set on my mitre saw for a 6:12 rafter?

26.57° for the plumb cuts at the ridge and the tail, and 63.43° for the seat cut of the birdsmouth. The plumb cut angle is always arctan(rise ÷ 12) and the seat cut is 90° minus that. Most saws only read to a tenth of a degree, so 26.6° is close enough; the birdsmouth is usually marked with a square rather than cut on a saw anyway.

How many rafters do I need for a 40 foot roof?

At 16 in on centre, 31 per side, so 62 for a gable roof. The arithmetic is 40 ft × 12 = 480 in, divided by 16 gives 30 spaces, and one more rafter than spaces gives 31. At 24 in on centre it is 21 per side. Add extra members for openings, chimneys and doubled rafters at skylights, and remember gable ends may be studded rather than rafted.

Is the tail length the same as the overhang?

No, on any roof that has a pitch. The tail is the horizontal overhang times the slope factor, so it is longer than the overhang by that factor; the two are equal only on a dead-flat roof, where the factor is 1. A 12 in horizontal overhang on a 6:12 roof gives a tail of 12 × 1.118 = 13.4 in measured along the rafter. Enter the horizontal projection here; the calculator converts it. Fascia height, soffit width and gutter position all key off the horizontal projection, which is why plans give it that way.

Does this size the rafter as well?

No. It gives geometry only. Rafter depth, species, grade, spacing and allowable span come from the IRC section R802 span tables or an engineered design, and they depend on the snow load, the dead load of the roofing, and whether a ceiling is attached to the rafters. A long line length is not by itself a structural problem; an undersized member at that span is.

Why is my cut rafter a little long even though the math is right?

Check three things in order: whether you deducted half the ridge thickness, whether you measured the run to the outside face of the plate rather than the inside, and whether the pitch is what you think it is. Pitch is the sensitive one. Reading 6:12 on a roof that is really 6-1/4:12 lifts the slope factor from 1.1180 to 1.1275, and on the 11.9375 ft run of the worked example above that is 1.4 in of extra rafter. A missed ridge deduction is smaller — 0.84 in at 6:12 — but it is the same error on every rafter, so it reads as a ridge that sits uniformly high rather than as one bad stick.

Can I use this for a metric roof?

Yes. Enter the span in metres or millimetres and the overhang and ridge thickness in millimetres or centimetres; the calculator normalises everything internally. The pitch still has to be entered as rise per 12 units of run, so convert a metric ratio first — a 1:2.4 roof is 12 ÷ 2.4 = 5, so 5:12. Results are reported in feet, so divide by 3.2808 for metres.

References

  • 2021 International Residential Code, Chapter 8 — Roof-Ceiling Construction (Section R802) — International Code Council
  • Roof Framing — Craftsman Book Company
  • Architectural Graphic Standards, 12th ed. — John Wiley & Sons