Rafter Calculator
Calculate rafter length from the horizontal run and roof pitch, using the right-triangle relationship between run, rise, and pitch angle.
How this calculator works
A rafter, its horizontal run, and its vertical rise form a right triangle. Roof pitch tells you the angle of that triangle, expressed as inches of rise per 12 inches of run. Once you know the angle, the rafter length is simply the run divided by the cosine of that angle — the same right-triangle math used for any slope.
This calculator takes your horizontal run and roof pitch, finds the angle, and returns the sloped rafter length.
Formula: Angle = arctangent(pitch ÷ 12). Rafter length = run ÷ cos(angle).
Worked example
A 12 ft run at a 6-in-12 pitch:
- Angle = arctan(6 ÷ 12) ≈ 26.57°
- Rafter length = 12 ÷ cos(26.57°) ≈ 13.42 ft
Notes
This gives the rafter’s straight-line length along the roof slope, from the wall plate to the ridge — it does not include any overhang. If your roof has an eave overhang, add that length separately, converted to slope length the same way.
The actual board you cut is usually a bit longer than this theoretical figure, to leave room for the ridge board’s thickness and the birdsmouth notch where the rafter sits on the wall plate. Framers account for these on site rather than in the raw run-to-rafter math.
How to use
Enter the horizontal run (the flat distance from wall plate to ridge) and your roof’s pitch as inches of rise per 12 inches of run. The calculator returns the sloped rafter length so you know roughly how long each rafter board needs to be before accounting for cuts and overhang.
This gives the theoretical rafter length from run and pitch. Actual layout (birdsmouth cuts, ridge thickness, overhang) is a framing task — verify measurements on site.
Frequently asked questions
What's the difference between rafter length and run?
Run is the flat, horizontal distance from the wall plate to the ridge, measured as if the roof were level. Rafter length is the actual board length along the slope, which is always longer than the run because it accounts for the rise created by the pitch angle. The steeper the pitch, the bigger that difference gets.
Does this include the overhang or eave?
No. This calculator gives you the rafter length from the wall plate to the ridge only. If your roof has an overhang past the wall, measure that horizontal distance separately, convert it to slope length using the same angle, and add it to the rafter length from this calculator.
Why do I need the pitch as a ratio like 6-in-12?
Roof pitch is traditionally expressed as inches of rise for every 12 inches of horizontal run, such as 6-in-12. That ratio is what lets you find the roof's angle using the arctangent function, which this calculator then uses to convert your horizontal run into an actual sloped rafter length.
How much extra length should I add when cutting the actual board?
This calculator gives the theoretical centerline length only. In practice, framers add extra material to account for the birdsmouth notch at the wall plate and the ridge board's thickness at the top, then trim to fit on site. There's no fixed number for this — it depends on your specific ridge and birdsmouth layout.
Estimates only. Verify quantities with your supplier before purchasing.