Rafter Length Calculator
Get common, hip, or valley rafter length, plumb and seat cut angles, overhang tail length, and total lumber needed for a given roof pitch and span, with a live diagram.
This calculator gives planning-stage lengths and angles based on standard framing geometry. Always check your local building code and, for anything load-bearing, confirm final rafter sizing with a structural engineer.
Rafter Length vs. Roof Pitch
This shows how much longer the rafter gets as the pitch steepens, while the run stays the same. The indigo dot marks your chosen pitch. It's why a steep roof always needs longer (and often more expensive) rafter stock than a low-slope roof covering the exact same building width.
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Find the run (half the building span)
Run = 24 ft ÷ 2 = 12 ft
The run is the flat horizontal distance the rafter covers, from the outside wall to the center of the building.
- 2
Subtract half the ridge board thickness
Adjusted Run = 12 − (1.5 in ÷ 2 ÷ 12) = 11.938 ft
The rafter stops at the ridge board's face, not its centerline, so the run gets slightly shorter.
- 3
Find the roof angle
θ = atan(6 ÷ 12) = 26.57°
The pitch, expressed as an angle, is what turns a flat run into a sloped rafter length.
- 4
Calculate the rise
Rise = 11.938 × tan(26.57°) = 5.97 ft
This is how much height the rafter climbs from the wall plate up to the ridge.
- 5
Calculate the rafter length
Rafter Length = Run ÷ cos(26.57°) = 13.347 ft
This is the straight-line length from the wall plate to the ridge, before any overhang is added.
- 6
Add the overhang tail length
Tail Length = 1 ÷ cos(26.57°) + fascia allowance = 1.181 ft
The eave overhang follows the same roof angle, so it adds a bit more than its flat measurement to the total board length.
- 7
Add up the total rafter length
Total Length = 13.347 + 1.181 = 14.527 ft
This is the full board length the rafter needs to cover, ridge to tail.
- 8
Round up to a standard lumber length
Stock Length = 16 ft
Rounding up to the next common dimensional lumber length avoids ordering an odd, hard-to-find board size.
- 9
Estimate rafters needed for a 30 ft long roof
Rafter Count = 46 | Total Lumber = 810 ft
Based on 16" on-center spacing on both sides of the roof, plus a 10% waste allowance for cuts and mistakes.
✓ Final Answer: cut 14.53 ft rafters (16 ft stock) at a 26.6° plumb cut.
What Is a Rafter Length Calculator?
A rafter length calculator turns two simple numbers — how wide your building is and how steep your roof pitch is — into the exact board length you need to cut for every rafter on the job. Instead of pulling out a framing square and working through the math by hand for every rafter, you get the run, rise, rafter length, cut angles, and overhang all at once.
This tool covers the full picture a carpenter actually needs before cutting the first board: the plain rafter length from wall to ridge, how much longer that gets once you add an eave overhang, the plumb and seat cut angles for a speed square or framing square, and — if you enter your building's length — roughly how many rafters and how much total lumber the whole roof will take.
Run, Rise, and Rafter Length: The Three Numbers That Matter
Every rafter length calculation comes down to a right triangle. The run is the flat horizontal distance from the outside wall to the center of the building — normally half the building's total span, since a standard roof is symmetric. The rise is how much height the rafter climbs over that same horizontal distance, driven entirely by the roof's pitch. The rafter itself is the hypotenuse of that triangle, and it's always longer than either the run or the rise on their own.
The formula is straightforward trigonometry: Rafter Length equals Run divided by the cosine of the roof angle. The steeper the pitch, the bigger that angle gets, and the longer the rafter gets for the exact same building width. This calculator runs that formula automatically, using whichever pitch format you're most comfortable with — a rise-per-12-inches ratio like 6/12, or a straight angle in degrees.
How This Calculator Works, Step by Step
Getting a rafter length right takes more steps than a single formula, especially once overhangs and ridge boards enter the picture. This calculator walks through each one in order.
- Step 1 — Find the run, either from half the building span or a run you already know.
- Step 2 — Subtract half the ridge board's thickness, since the rafter's actual bearing point is the ridge board's face, not its centerline.
- Step 3 — Convert the pitch into an angle: θ = arctangent(rise ÷ 12) for a ratio pitch.
- Step 4 — For a hip or valley rafter, lengthen the run by a factor of about 1.414 to account for the diagonal path across the building corner.
- Step 5 — Calculate the rise: Rise = Run × tangent(θ).
- Step 6 — Calculate the rafter length: Rafter Length = Run ÷ cosine(θ).
- Step 7 — Add the overhang tail length and a fascia board allowance, if there's an eave overhang.
- Step 8 — Round the total up to the nearest standard lumber length so you're ordering a board size that's actually in stock.
Common Rafters vs. Hip and Valley Rafters
A common rafter runs straight from the wall plate to the ridge, perpendicular to both — the most typical rafter on a simple gable roof. A hip rafter runs diagonally, from an outside corner of the building up to the ridge, forming the sloped edge you see where two roof planes meet at a hip roof's corner. A valley rafter does the same job in reverse, running along the inside corner where two roof planes meet and drain into each other.
Because hip and valley rafters travel diagonally across the building's corner rather than straight across its width, their horizontal run is longer than a common rafter's run on the same roof — on a standard 45-degree hip corner, by a factor of roughly 1.414, or the square root of 2. This calculator applies that adjustment automatically when you switch the rafter type, so hip and valley lengths come out correct without you needing to do the diagonal geometry by hand.
Why the Ridge Board Thickness Matters
It's a small detail, but it adds up: a rafter doesn't actually run all the way to the building's exact centerline. It stops at the face of the ridge board, which sits on that centerline with its own thickness on either side. If you skip this adjustment, every rafter comes out slightly too long — and slightly too long is a real problem once dozens of rafters are all fighting to fit under the same ridge line.
This calculator subtracts half the ridge board's thickness from the run automatically once you enter it, so the rafter length that comes out is the real, buildable number, not the theoretical centerline-to-centerline distance.
Understanding the Overhang Tail Length
Most roofs extend past the wall in an eave overhang, both to shed water away from the siding and to give the roofline a finished look. That overhang follows the same roof angle as the rest of the rafter, which means its true length is longer than the flat horizontal distance it appears to cover.
Enter your overhang's horizontal run and, optionally, a fascia board thickness, and this calculator adds the correctly angled tail length to your total rafter length — the same board length you'll actually be marking and cutting, ridge to tail, in one continuous piece.
Plumb Cuts and Seat Cuts: Setting Your Speed Square
Once you know the roof angle, the two cuts every rafter needs are simple to set. The plumb cut, made at the ridge end and often at the tail, is set to the roof angle itself, measured off vertical. The seat cut, which sits flat on the wall's top plate at a birdsmouth notch, is set to the complementary angle — 90 degrees minus the roof angle, measured off horizontal.
This calculator reports both angles directly, so you can set a speed square or framing square once and cut every rafter to the same, consistent angle without re-deriving the geometry for each board.
Worked Example: A 24-Foot-Wide Building at 6/12 Pitch
Say you're framing a 24-foot-wide building with a 6/12 roof pitch, a 1.5-inch ridge board, and a 1-foot eave overhang. The run starts at 12 feet, then drops to about 11.94 feet once the ridge board's half-thickness is subtracted. The 6/12 pitch works out to an angle of about 26.57 degrees.
The rafter length from wall to ridge comes out to about 13.35 feet. Adding the 1-foot overhang's angled tail length — around 1.12 feet, plus a small fascia allowance — brings the total rafter length to roughly 14.5 feet. Since that's longer than a 14-foot board but shorter than a 16-foot one, this calculator would recommend ordering 16-foot stock, leaving a bit of trim waste on every board.
Why Pitch Has Such a Big Effect on Rafter Length
It's easy to underestimate how much a steeper roof pitch changes your lumber order. Two roofs covering the exact same building width can need meaningfully different rafter lengths just because one is steeper than the other, since a steeper angle pushes the cosine in the rafter length formula further from 1.
The chart above plots exactly this relationship: rafter length across a range of pitches, holding the run steady. It's a fast way to see the cost and material trade-off of going with a steeper, more dramatic roofline versus a lower-slope roof that saves on lumber length.
Estimating Total Rafters and Lumber for the Whole Roof
A single rafter length only tells part of the story once you're pricing out material for an entire roof. The advanced section of this calculator takes your building's length and your chosen rafter spacing — commonly 16 or 24 inches on-center — and works out roughly how many rafters the full roof needs, on both sides of the ridge.
Multiply that rafter count by the recommended stock length, add a waste allowance for cuts and mistakes, and you get a realistic total linear footage of lumber to budget and order — a genuinely useful number when you're heading to the lumber yard, not just planning one board at a time.
Who Uses This Calculator
This tool comes in handy across a wide range of roof framing projects:
- Framers and carpenters working out rafter lengths and cut angles before cutting the first board.
- DIYers and homeowners building a shed, porch roof, or small addition who want to sanity-check purchased plans.
- Estimators putting together a quick material takeoff for rafters before a formal lumber order.
- Anyone comparing how a steeper roof pitch changes both the rafter length and the total lumber cost for a project.
Frequently Asked Questions
How do you calculate rafter length?
Find the run (usually half the building's span), find the roof angle from the pitch, then divide the run by the cosine of that angle: Rafter Length = Run ÷ cos(angle). If there's an overhang, add its angled tail length on top of that.
What is the difference between rafter run and rafter length?
The run is the flat horizontal distance the rafter covers, from the wall to the center of the building. The rafter length is the actual sloped board length needed to span that same distance at the roof's pitch — always longer than the run once the roof has any pitch at all.
How much longer is a hip rafter than a common rafter?
On a standard roof where the hip meets two equally pitched roof planes at a 45-degree corner, the hip rafter's horizontal run is about 1.414 times (the square root of 2) longer than a common rafter's run on the same building, which makes the hip rafter itself noticeably longer too.
Why do I need to know the ridge board thickness?
The rafter's run stops at the ridge board's face, not at the building's exact centerline. Subtracting half the ridge board's thickness from the run gives the real, buildable rafter length instead of a slightly-too-long theoretical one.
What rafter spacing should I use?
16 inches on-center is the most common spacing for residential roofs and matches standard sheathing panel sizes well. 24-inch spacing is sometimes used with thicker sheathing or engineered rafters to save on material, but always check your local building code and span tables for your specific rafter size and species before finalizing spacing.
How do I set my speed square for a rafter plumb cut?
Set the speed square's pivot point at your roof's angle in degrees, which this calculator reports directly. For a ratio pitch like 6/12, that works out to about 26.57 degrees — the same angle used for both the ridge-end plumb cut and the tail cut at the overhang.
Does a steeper roof pitch really need much longer rafters?
Yes. Because rafter length grows with 1 ÷ cosine of the roof angle, the length increases faster than the pitch itself as the roof gets steeper. Two roofs on the same building width can need noticeably different rafter lengths purely because one pitch is steeper than the other.
Is this calculator accurate enough for ordering lumber?
It gives accurate planning-stage geometry based on the numbers you enter, including a recommended standard stock length. Always double-check your specific building code, span tables for your rafter size and lumber species, and get a structural engineer's sign-off for anything load-bearing before finalizing an order.