Rafter Length Calculator
- Half the 24 ft span is a 12 ft run. At 6/12 pitch the slope factor is √(1 + (6/12)²) = 1.118, so the rafter to the ridge centreline measures 12 × 1.118 = 13.42 ft, rising 6 ft at 26.57°.
- Two real-world adjustments: the rafter butts against a 1.5 in ridge board, not the centreline, which shortens it by 0.07 ft measured along the slope; and a 12 in horizontal overhang adds a 1.12 ft tail. Cut length: 14.46 ft — buy the next lumber length up and confirm with a test rafter before cutting the set.
A rafter length calculator determines the cut length of a common rafter from three inputs: building span, roof pitch, and overhang. The theoretical length equals the horizontal run — half the building span — multiplied by the slope factor √(1 + (pitch/12)²). From there, the calculator subtracts the ridge deduction (half the ridge board's thickness, measured horizontally, then converted to slope length by the same slope factor) and adds the overhang tail to arrive at the final cut length. For example, a 24 ft span at 6/12 pitch has a 12 ft run and slope factor 1.1180, giving a 13.42 ft theoretical rafter at a 26.57° angle; with a 1.5 in ridge deduction and a 12 in overhang tail, the cut length is 14.46 ft. A 30 ft span at 8/12 with a 16 in overhang needs a 19.56 ft cut length and rises 10 ft over its 15 ft run, while a 20 ft span at 4/12 with no overhang and a doubled 3.5 in ridge gives 10.39 ft — the thick ridge costs 0.154 ft of deduction.
The method behind this calculator is the accepted standard because it follows the geometric relationship between a roof's horizontal run and its sloped length, a principle rooted in right-triangle trigonometry that builders have relied on for generations. The slope factor accounts for pitch precisely, and the ridge deduction correctly converts a horizontal measurement to slope length using that same factor. This page shows the formula in full, breaks down each step of the calculation, walks through worked examples like the ones above, and cites the sources that verify the numbers — so you can check the math yourself before you cut a single board.
Worked examples
24 ft span at 6/12 with a 12 in overhang
Theoretical rafter 13.42 ft at a 26.57° angle; after the ridge deduction and the tail, the cut length is 14.46 ft — buy 16 ft stock. (24 ft · 6 /12 · 12 in · 1.5 in)
| Rafter length to cut (incl. overhang, after ridge deduction) | 14.46 ft |
| Theoretical rafter (ridge centreline, no overhang) | 13.42 ft |
| Slope factor | 1.118 |
| Roof angle | 26.57° |
| Total rise over the run | 6 ft |
30 ft span at a steep 8/12
Cut length 19.56 ft, rising a full 10 ft over the 15 ft run — a roof this steep is why framers pre-cut with a calculator, not a tape on a ladder. (30 ft · 8 /12 · 16 in · 1.5 in)
| Rafter length to cut (incl. overhang, after ridge deduction) | 19.56 ft |
| Theoretical rafter (ridge centreline, no overhang) | 18.03 ft |
| Slope factor | 1.2019 |
| Roof angle | 33.69° |
| Total rise over the run | 10 ft |
20 ft span at 4/12, no overhang, doubled ridge
The thick 3.5 in ridge costs 0.154 ft of deduction and there is no tail to add back: cut length 10.39 ft. (20 ft · 4 /12 · 0 in · 3.5 in)
| Rafter length to cut (incl. overhang, after ridge deduction) | 10.39 ft |
| Theoretical rafter (ridge centreline, no overhang) | 10.54 ft |
| Slope factor | 1.0541 |
| Roof angle | 18.43° |
| Total rise over the run | 3.33 ft |
Run, pitch and the slope factor
Every common rafter has a theoretical length that comes from two measurements: its horizontal run and the roof's pitch. The run is simply half the building span, because a pair of rafters meets at the ridge and each one covers half the distance. Pitch is expressed as rise-over-12, meaning the number of inches the roof climbs for every 12 inches it runs horizontally. A 6/12 pitch, for example, rises 6 inches for each foot of run. Together, the run and the pitch define the slope, and the slope defines the length.
To convert a horizontal run into a rafter's theoretical length, multiply the run by the slope factor. The slope factor is calculated as the square root of 1 plus (pitch divided by 12) squared, or √(1 + (pitch/12)²). This factor accounts for the fact that the rafter travels diagonally rather than horizontally. At a 6/12 pitch, the slope factor is 1.1180. Multiply that by a 12 ft run and you get a 13.42 ft theoretical rafter length at a 26.57° roof angle. A rafter length calculator applies this same multiplication automatically once you enter the span and pitch.
The slope factor stays constant for any given pitch, so it works like a lookup multiplier. A 4/12 pitch has one factor, an 8/12 pitch has another, and so on. What changes from building to building is the run. A 30 ft span at 8/12 pitch has a 15 ft run and rises 10 ft over that run. A 20 ft span at 4/12 has a 10 ft run. In each case the theoretical length is the run times the slope factor for that pitch. The factor table approach lets you compute lengths quickly without re-deriving the geometry each time.
Theoretical length is not the final cut length, however. Two adjustments usually apply before you mark the board. First, the ridge deduction accounts for the thickness of the ridge board where the rafters meet. The deduction is half the ridge board's thickness, measured horizontally, then converted to slope length using the same slope factor. A doubled 3.5 in ridge on a 20 ft span at 4/12, for instance, costs 0.154 ft of deduction, bringing the cut length to 10.39 ft when there is no overhang. Second, an overhang tail adds length beyond the wall so the rafter can carry the eave. A 24 ft span at 6/12 with a 1.5 in ridge deduction and a 12 in overhang tail yields a 14.46 ft cut length. A 30 ft span at 8/12 with a 16 in overhang needs a 19.56 ft cut length. The slope factor governs each of these conversions from horizontal distance to actual board length.
- Run = half the building span (a 24 ft span gives a 12 ft run).
- Pitch = rise-over-12 (a 6/12 pitch climbs 6 in per 12 in of run).
- Slope factor = √(1 + (pitch/12)²); at 6/12 it equals 1.1180.
- Theoretical rafter length = run × slope factor (12 ft × 1.1180 = 13.42 ft).
- Ridge deduction = half the ridge thickness, converted to slope length with the same factor.
- Overhang tail adds length beyond the wall plate to reach the eave.
Worked examples
The fastest way to understand any rafter length calculator is to trace real numbers from span to cut length. In every example below, the run is half the building span, the theoretical length is the run multiplied by the slope factor √(1 + (pitch/12)²), and the cut length is the theoretical length adjusted for ridge deduction and overhang.
Take a 24 ft span at 6/12 pitch. The run is 12 ft and the slope factor is 1.1180, which gives a 13.42 ft theoretical rafter at a 26.57° angle. The ridge deduction is half the ridge board's thickness, measured horizontally, then converted to slope length by the same slope factor. With a 1.5 in ridge deduction and a 12 in overhang tail added on, the cut length becomes 14.46 ft.
A 30 ft span at 8/12 pitch tells a similar story but with a steeper roof. The run is 15 ft and the roof rises 10 ft over that run. After applying the slope factor and adjusting for a 16 in overhang, the cut length comes to 19.56 ft.
The third example shows what happens when there is no overhang to add back. A 20 ft span at 4/12 pitch with no overhang and a doubled 3.5 in ridge gives a 10.39 ft cut length. The thick ridge costs 0.154 ft of deduction, which is half the 3.5 in thickness converted to slope length. Without an overhang tail to offset that deduction, the cut length stays shorter than the theoretical length.
| Span | Pitch | Overhang | Cut length |
|---|---|---|---|
| 24 ft | 6/12 | 12 in | 14.46 ft |
| 30 ft | 8/12 | 16 in | 19.56 ft |
| 20 ft | 4/12 | None | 10.39 ft |
The ridge deduction everyone forgets
The ridge deduction everyone forgets
A common rafter's theoretical length is its horizontal run times the slope factor √(1 + (pitch/12)²), and the run is half the building span. That math is correct as far as it goes, but it gives you the length to the centerline of the ridge. In the real world, the rafter meets the face of the ridge board, not its centerline. If you cut to the theoretical length without accounting for the ridge board's thickness, your rafter will run long and push the ridge out of position. This is the single most common error people make when they use a rafter length calculator and then transfer those numbers to actual lumber.
The ridge deduction is half the ridge board's thickness, measured horizontally, then converted to slope length by the same slope factor. For a standard 1.5 inch ridge board, half the thickness is 0.75 inches, which is 0.0625 feet horizontally. When you convert that to slope length at a 6/12 pitch, the deduction comes out to 0.070 feet. If you are using a doubled 2x ridge with a finished thickness of 3.5 inches, half of that is 1.75 inches, or about 0.146 feet horizontally. Converted to slope length, the deduction grows to 0.154 feet. That may sound small, but it matters when you are trying to get a tight fit at the peak.
Here is how the deduction plays out in a real example. A 24 foot span at 6/12 pitch has a 12 foot run and a slope factor of 1.1180, giving a 13.42 foot theoretical rafter at a 26.57 degree angle. With a 1.5 inch ridge deduction and a 12 inch overhang tail, the cut length is 14.46 feet. The deduction is small, but it is built into that final number. Skip it and your rafter will not seat properly against the ridge.
A thicker ridge makes the deduction larger and easier to notice. A 20 foot span at 4/12 pitch with no overhang and a doubled 3.5 inch ridge gives a 10.39 foot cut length. The thick ridge costs 0.154 feet of deduction. Compare that to a single 1.5 inch ridge at the same pitch, where the deduction would only be 0.070 feet. The difference is not huge, but it is enough to throw off a cut if you ignore it. The same principle applies at steeper pitches and longer spans. A 30 foot span at 8/12 with a 16 inch overhang needs a 19.56 foot cut length and rises 10 feet over its 15 foot run. The ridge deduction is part of that cut length, and leaving it out would throw off the fit at the peak.
The tail: overhang measured horizontally
When you use a rafter length calculator, you will usually enter the overhang as a flat, horizontal measurement. A 12 inch overhang means the rafter tail extends 12 inches outward, measured level from the wall plate. But the board itself is cut along the slope, so the actual piece of wood that forms that tail is longer than 12 inches. At a 6/12 pitch, a 12 inch horizontal overhang translates to a 1.12 ft piece of rafter running down the slope.
This conversion uses the same slope factor that governs the main rafter. A common rafter's theoretical length is its horizontal run times the slope factor, which is the square root of 1 plus the quantity of pitch divided by 12, squared. The run is half the building span. For a 24 ft span at 6/12 pitch, the run is 12 ft and the slope factor is 1.1180, giving a 13.42 ft theoretical rafter sitting at a 26.57 degree angle. The overhang tail follows the same rule: multiply the horizontal overhang by the slope factor to get the sloped length of the tail.
Because the overhang is added to the theoretical body length and then adjusted for the ridge, the cut length combines three things. Take the 24 ft span at 6/12 pitch example. The theoretical rafter is 13.42 ft. Add the 12 inch overhang tail, converted to its 1.12 ft sloped length, and subtract the ridge deduction. The ridge deduction is half the ridge board's thickness, measured horizontally, then converted to slope length by the same slope factor. With a 1.5 in ridge deduction and the 12 in overhang tail, the cut length is 14.46 ft.
The same logic applies at steeper pitches and larger overhangs. A 30 ft span at 8/12 with a 16 in overhang needs a 19.56 ft cut length and rises 10 ft over its 15 ft run. The 16 inch horizontal overhang grows more at 8/12 than it would at 6/12 because the slope factor is larger. Conversely, when there is no overhang, the tail adds nothing. A 20 ft span at 4/12 with no overhang and a doubled 3.5 in ridge gives a 10.39 ft cut length, where the thick ridge costs 0.154 ft of deduction.
Birdsmouth and plumb cuts
Once the rafter length calculator gives you a theoretical number, you still have to lay out the birdsmouth and plumb cuts before any lumber touches a saw. The plumb cut sits at the top of the rafter, where it meets the ridge board, and its angle matches the roof angle exactly. In the first verified example, a 24 ft span at 6/12 pitch produces a 13.42 ft theoretical rafter at a 26.57° angle, so the plumb cut is set to 26.57°. The birdsmouth, by contrast, is the notch at the lower end of the rafter. It has two parts: a seat cut that rests flat on the wall plate, and a heel cut that follows the roof angle down the outside face of the wall.
The seat cut must sit fully on the wall plate so the load transfers cleanly to the framing below. Its depth depends on the wall plate thickness and the rafter size, but the principle stays the same: the seat cut is level, while the heel cut remains plumb. Because the birdsmouth removes material from the theoretical rafter line, the actual board you buy needs to be longer than the theoretical length suggests. The ridge deduction also plays a role here. It equals half the ridge board's thickness, measured horizontally, then converted to slope length using the same slope factor used for the main rafter. A 1.5 in ridge deduction on a 6/12 roof, paired with a 12 in overhang tail, brings the cut length of that first example to 14.46 ft.
Different spans and pitches shift these numbers but not the method. A 30 ft span at 8/12 with a 16 in overhang requires a 19.56 ft cut length and rises 10 ft over its 15 ft run, so the plumb cut angle is steeper than the 6/12 case. A 20 ft span at 4/12 with no overhang and a doubled 3.5 in ridge gives a 10.39 ft cut length; the thick ridge costs 0.154 ft of deduction, which is half the ridge thickness converted to slope length at the lower pitch.
Before cutting a full stack of rafters, always cut one pattern rafter and test-fit it in place. Check that the plumb cut seats tightly against the ridge board, the birdsmouth sits flat on the wall plate without rocking, and the tail reaches the correct overhang distance. A pattern that checks out saves you from repeating a layout error across every rafter in the roof. Once the pattern fits, mark the rest from it.
Buying lumber for rafters
Once a rafter length calculator gives you the cut length, your next job is translating that number into actual lumber you can buy. Lumberyards and home centers do not cut boards to custom lengths for rafters. They sell dimensional lumber in standard stock lengths, typically in 2-foot increments: 8, 10, 12, 14, 16, 18, and 20 feet. You must round every cut length up to the next available stock length.
Take the verified example of a 24 ft span at 6/12 pitch. The theoretical rafter length is 13.42 ft, and after applying a 1.5 in ridge deduction and a 12 in overhang tail, the cut length comes to 14.46 ft. You cannot buy a 14.46 ft board, so you round up to 16 ft stock. The same logic applies to larger roofs: a 30 ft span at 8/12 pitch with a 16 in overhang requires a 19.56 ft cut length, which means you need 20 ft boards. Even on smaller jobs the rule holds — a 20 ft span at 4/12 with no overhang and a doubled 3.5 in ridge gives a 10.39 ft cut length, so you buy 12 ft lumber.
Never buy exactly one board per rafter at the rounded-up length. Professional framers always order extra material for two reasons. First, you need a pattern rafter — one perfectly cut rafter you lay against the roof to confirm the plumb cut, birdsmouth, and tail fit before you commit to cutting the rest. If the pattern reveals an error in your math or your marking, you have only wasted one board. Second, cutting rafters invites mistakes. A misaligned saw line, a birdsmouth cut too deep, or a snapped board during installation can sideline a rafter. Having spare lumber on site keeps the crew working instead of waiting for a lumberyard delivery.
A practical approach is to add at least two extra boards to your total count: one for the pattern rafter and one or more as a waste allowance. For a roof with 20 rafters, ordering 22 or 23 boards at the rounded-up stock length is reasonable. If your rafter length calculator output is close to the next stock size, the offcut from each board may be large enough to use elsewhere, but do not count on offcuts for critical structural members.
- Round every cut length up to the next standard stock length (14.46 ft → 16 ft boards).
- Cut one pattern rafter first and test-fit it before cutting the rest.
- Order at least one extra board for the pattern and one or more for mistakes or damage.
FAQs
How long is a rafter for a 24 ft span at 6/12 pitch?
The rafter length is 13.42 ft to the ridge centreline. After applying a 1.5 in ridge deduction and adding a 12 in overhang, the actual board to cut is 14.46 ft. This accounts for the ridge board thickness and the overhang tail.
What is the slope factor for a 6/12 pitch?
The slope factor is √(1 + (6/12)²) = 1.1180. Multiply the horizontal run by this factor to get the sloped length. For example, a 12 ft horizontal run at 6/12 pitch gives a sloped rafter length of 13.42 ft.
Why subtract for the ridge board?
Rafters from both sides butt into the board's faces, so each side gives up half the board's thickness. For a standard 1.5 in ridge board, this means subtracting 0.75 in horizontally from the run before calculating the rafter length.
Is overhang measured along the slope or horizontally?
Overhang is measured horizontally, as drawn on plans. A 12 in overhang at 6/12 pitch adds 12 × 1.1180 = 13.4 in (1.12 ft) of rafter tail. The horizontal overhang dimension is multiplied by the slope factor to get the actual sloped tail length.
What angle do I cut the rafter ends at?
Cut the rafter ends at the roof angle, which is arctan(pitch/12). For a 6/12 pitch, the angle is 26.57°. For an 8/12 pitch, the angle is 33.69°. Use this same angle for both the ridge cut and the birdsmouth plumb cut.
Does this work for hip rafters?
No. Hip rafters run at 45° in plan and use a different, longer factor than common rafters. This calculator is designed for common rafters only. The hip roof calculator covers hip rafter lengths using the appropriate factors for those members.