Exterior

Rafter Length & Roof Pitch Calculator

Enter the building width, the roof pitch and the overhang. You'll get the rafter length to cut, the roof angle, the plumb and seat cuts for the birdsmouth, and a drawing of one rafter to scale.

  • Exact geometry, no rounding until the end
  • To-scale diagram
  • Feet or metric

1 Your measurements

Type feet and inches the way you'd write them, like 12' 6" or 30 3/8. Decimals work too.

ft
Outside of wall to outside of wall, across the gable.
6/12 means the roof rises 6 inches for every 12 inches it runs across. To measure, hold a level 12 inches long against the roof and measure straight down to it.
/12
in
Measured level from the outside of the wall to the end of the rafter.
in
1½" for a 2× ridge board.
in
3½" for 2×4 walls, 5½" for 2×6 walls.

2 Your rafter

Updates as you type
Rafter length
14' 5 9/16"
6/12 pitch, overhang included
Roof angle
26.6°
6 in 12
Buy
16 ft boards
next stock length up
ridge center wall overhang 14' 5 9/16" (6/12)
Side view of one rafter, to scale, from the ridge to the eave. The notch over the wall is the birdsmouth.
Cut list for one common rafter
Run (ridge center to outside of wall)12' 0"
Total rise at the ridge center6' 0"
Rafter line length, ridge center to wall13' 5"
Less half the ridge board− 13/16" (3/4" × slope factor)
Plus the tail (overhang)+ 1' 1 7/16"
Rafter length, ridge cut to tail cut14' 5 9/16"
Plumb cut (ridge and tail)26.6° from square, or 6 on the common scale of a speed square
Seat cutsquare to the plumb cut, 3 1/2" long
Birdsmouth heel cut1 3/4" tall (plumb)
Notch depth into the rafter1 9/16", 22% of a 2×8's depth
Plumb cut depth at the ridge8 1/8" (the ridge board must be at least this deep, IRC R802.3)
Slope factor1.118 (rafter length per foot of run)

Rafter size and spacing depend on span, snow load and roof weight, which this calculator doesn't check. Use your code's rafter span tables or an engineer.

Quick answer

Rafter length = (run − half the ridge thickness + overhang) × slope factor, where the run is half the building width and the slope factor is √(1 + (rise ÷ 12)²). For a 24 ft wide house with a 6/12 roof, a 1½" ridge and a 12" overhang, that's 14' 5 9/16".

Roof pitch to angle and slope factor

PitchAngleSlope factorRise over 12 ft of run
1/124.8°1.0031' 0"
2/129.5°1.0142' 0"
3/1214°1.0313' 0"
4/1218.4°1.0544' 0"
5/1222.6°1.0835' 0"
6/1226.6°1.1186' 0"
7/1230.3°1.1587' 0"
8/1233.7°1.2028' 0"
9/1236.9°1.259' 0"
10/1239.8°1.30210' 0"
11/1242.5°1.35711' 0"
12/1245°1.41412' 0"
14/1249.4°1.53714' 0"
16/1253.1°1.66716' 0"

Slope factor is the rafter length per foot of run. Multiply it by the run, or by the footprint area for roof area. Use the calculator above for your exact size.

How rafter length is worked out

Half the building width is the run: the level distance from the ridge center to the outside of the wall. Multiply the run by the pitch's slope factor, √(1 + (rise ÷ 12)²), and you have the rafter's line length. Then take off half the ridge board's thickness, because the rafter stops at the face of the ridge rather than its center, and add the overhang, also multiplied by the slope factor.

Worked example: a 24 ft wide house with a 6/12 roof

  • Run: 24 ft ÷ 2 = 12 ft (144 inches).
  • Slope factor for 6/12: √(1 + 0.5²) = 1.118.
  • Line length: 144 × 1.118 = 161 inches.
  • Less half a 1½" ridge along the slope: 0.75 × 1.118 = 0.84 inches. Plus a 12" overhang: 12 × 1.118 = 13.42 inches.
  • Rafter length: 173.57 inches, or 14' 5 9/16". A 16 ft board covers it.
  • The roof angle is 26.6°, and the birdsmouth over a 2×4 wall has a 1.75" heel cut.

Marking and cutting a rafter

  • Plumb cuts at the ridge and the tail are vertical once the rafter is in place. Hold the speed square's pivot point against the top edge of the rafter and turn the square until the rise number (6 for a 6/12 roof) on the COMMON scale lines up with that same edge. Draw along the square's straight edge.
  • The seat cut is square to the plumb cut and sits flat on the wall plate. It needs at least 1½ inches of bearing, and the notch should take no more than a quarter of the rafter's depth, the IRC's limit for notches at the ends of a rafter. On steep roofs that means a seat shorter than the wall is wide; the calculator shortens it for you.
  • Cut one pattern rafter and test it at both ends of the building before cutting the rest. Walls are rarely perfectly straight, and an error repeats on every rafter.
  • Pick crowns up. Sight down each board and install it with the bow facing the sky so the roof load straightens it.

Code points to know

  • The International Residential Code (IRC) section R802.3 calls for a ridge board at least 1 inch nominal thick and no shallower than the cut end of the rafter. A rafter's plumb cut is always deeper than the board itself (8.1 inches for a 2×8 at 6/12), so the ridge is normally one size up: 2×8 rafters get a 2×10 ridge.
  • Rafter size and spacing come from your code's rafter span tables, which depend on snow load, roof weight and lumber grade. This calculator works out lengths and cuts, not sizes.
  • Opposing rafters need ties or ceiling joists low in the attic to stop the walls from spreading, unless the ridge is a structural beam.

Frequently asked questions

How do I find the pitch of my roof?

Hold a level horizontally against the underside of a rafter or the roof surface, measure 12 inches along the level, and measure straight up from that point to the rafter. That number of inches is the rise, so 6 inches means a 6/12 pitch.

What angle is a 6/12 roof?

About 26.6°. A 4/12 roof is 18.4°, an 8/12 roof is 33.7° and a 12/12 roof is 45°.

Is rafter length measured on the top or bottom edge?

With plumb cuts at both ends, the length is the same along either edge between the cuts. We measure along the bottom edge from the ridge cut to the building line at the outside of the wall, then add the overhang.

How big should a birdsmouth be?

The seat needs at least 1½ inches of bearing on the wall, and the notch should take no more than a quarter of the rafter's depth, the IRC's limit for notches at the ends of rafters. On steep roofs the seat ends up shorter than the wall is wide; the calculator works out the seat length and notch depth for you.

How many rafters do I need?

Divide the length of the roof (along the ridge) by the rafter spacing, round up and add one, then double it for the two sides of a gable. A 30 ft long roof with rafters 16 inches on center needs 24 rafters per side, 48 in all.

Last reviewed 2026-10-23. See how we calculate for our sources and assumptions.

Add this calculator to your website

Free for blogs, contractors and DIY sites. Paste this where you want the calculator to appear. It resizes itself and works on phones.

Please keep the credit line. The calculator updates automatically when we improve it. Preview the widget.