Rafter Length Calculator
Rafter cut length to the sixteenth, with the ridge deduction and the overhang measured along the slope. Common, hip and valley, and the jack common difference.
Rafter Length Calculator
Background.
The rafter length itself is a right triangle, and if that were the whole problem nobody would need a calculator for it. What makes rafters go wrong is everything around the triangle: the run is not half the room, the overhang is not the overhang, and a hip does not run on 12.
Start with the run. It is half the building width measured outside face of plate to outside face of plate, minus half the ridge board thickness. That last deduction is the one that gets forgotten, and it is not trivial — on a 6:12 roof a 1.5 inch ridge board takes 0.75 inches off the run, which becomes 0.84 inches off the rafter. Cut every common rafter in a 40-foot house without it and all sixty-two are the better part of an inch too long, which shows up as a ridge that will not close or rafters that hang past the plate. The theoretical length in the worked example is 14 ft 6 7/16 in; the length you actually cut is 14 ft 5 9/16 in.
Then the overhang. A 12 inch eave is a horizontal projection measured on the plan — it is what sticks out past the wall when you look down at the roof. Along a 6:12 slope those 12 inches become 13 7/16 inches of rafter, and on a hip rafter the same eave becomes 18 inches, because the hip's tail runs diagonally as well as uphill. Treating the projection as a slope length is a small error on a shallow roof and a large one on a steep one: at 12:12 a 24 inch eave is nearly 34 inches of rafter.
The hip is where the arithmetic stops being obvious. A common rafter climbs its rise over 12 inches of run. A hip rafter on an equal-pitch 90 degree corner climbs the same rise over the diagonal of a 12 inch square, which is √(12² + 12²) = 16.9706 inches. That is why the second line of every framing square rafter table is stepped on 17 rather than 12 — 17 being a working approximation of 16.9706 that runs about 0.17 percent long, which is under a sixteenth of an inch on a 20 foot hip but is worth knowing about. This page uses the exact 16.9706 and tells you what to set on the square. The consequence you can feel is that a hip's plumb cut is shallower than the roof: on a 6:12 roof the roof plane is 26.565 degrees but the hip's own slope is 19.471 degrees, and cutting a hip at the common rafter's angle is a classic and expensive mistake.
A useful sanity check falls out of the geometry. At 6:12 the common unit length is √(144 + 36) = 13.4164 inches per foot of run and the hip unit length is √(288 + 36) = √324 = exactly 18 inches per foot of common run. Those are the two numbers printed on lines 1 and 2 of a real framing square, and they come out of the formulas rather than being looked up — which is a reassuring thing to see when you are trusting a calculator with a cut.
Jack rafters are common rafters with shortened runs, so they step on 12 and their plumb cut is the roof angle. What matters about them is that they step down by a constant. Line 3 of the framing square rafter table gives that constant: the spacing in feet times the common unit length. At 6:12 and 16 inches on centre it is 17.889 inches, which is 17 7/8 to the nearest sixteenth. Lay out the longest jack, then subtract that once for each successive one. On a 24 foot wide roof at 16 inch centres there are eight jacks per hip side, with the longest sitting on a 128 inch run — not nine, because a jack at the full 144 inch run would be the common rafter itself.
One deduction this page deliberately refuses to make. For a common rafter the ridge shortening is unambiguous and is applied. For a hip, a valley or a jack it is not: the shortening depends on whether the member lands against the ridge, against a common rafter or into a nailer, and it involves half the receiving member's thickness taken at 45 degrees. There is no single correct number, so the page reports the theoretical length to the centreline and says so beside the answer rather than inventing a figure. Rounding a rafter long is recoverable with a saw; guessing a shortening is not. For the same reason every length is rounded to the nearest sixteenth rather than truncated — a span may only ever be rounded down, but a cut length rounded down is a rafter that does not reach.
What this page does not do is decide whether the rafter is strong enough. That is a span question, governed by IRC 2021 Tables R802.4.1 and R802.5.1 and by the NDS design values, with deflection limits in Table R301.7 — which allows L/180 for rafters steeper than 3:12 with no ceiling attached, a looser limit than any floor gets. It does not size a ridge beam, rafter ties, collar ties, or the connections at either end, and it assumes a symmetrical roof of equal pitch on both sides with equal-pitch 90 degree hips. Unequal pitches move the hip off 45 degrees in plan and change everything on this page. Adopted code editions and local amendments differ between jurisdictions, and a licensed structural engineer or architect must sign off before work proceeds.
What is rafter length calculator?
A rafter is a sloping roof member running from the wall plate up to the ridge. Its cut length is the sum of two parts: the body, from the ridge to the outside face of the plate, and the tail, which is the eave overhang measured along the slope.
Both parts are computed the same way — as a horizontal run times a unit length. The unit length is the amount of rafter per 12 inches of horizontal run, and it is √(144 + rise²) for a common or jack rafter. For a hip or valley on an equal-pitch 90 degree corner the member runs diagonally, so over the same 12 inches of common run it covers 16.9706 inches of its own run, and its unit length is √(288 + rise²).
The run for a common rafter is half the building width less half the ridge board thickness. Halving the width is what converts a span into a run; deducting half the ridge is what converts a theoretical length that meets at a point into a real length that meets a board. IRC 2021 R802.3 requires the ridge board to be not less than 1 inch nominal thickness and not less in depth than the cut end of the rafter, so a dressed 2x ridge gives a 0.75 inch deduction.
The cut angles follow from the member's own slope. The plumb cut, which is vertical when the rafter is in place, is set at arctan(rise ÷ unit run) off square; the level or seat cut is its complement. For a common rafter that plumb angle equals the roof pitch angle. For a hip it is shallower, because the hip covers the same rise over a longer run.
This calculator produces lengths, angles, framing square settings and member counts. It does not check structural capacity, size a ridge beam or rafter ties, handle unequal pitches, or compute the double cheek cuts on a hip.
How to use this calculator.
- Pick the member you are cutting. Common runs on 12, hip and valley run on 16.97, a jack runs on 12 but stops short of the ridge.
- Enter the building width outside plate to outside plate. This is the full span — the calculator halves it. Entering half the width is the most common way to get an answer that is half as long as it should be.
- Enter the pitch as the rise per 12 inches of run: the first number of an x:12 pitch.
- Enter the ridge board thickness. 1.5 inches for a dressed 2x, 3 inches for a doubled 2x, or 0 if you want the theoretical length with no deduction. It is only applied to common rafters.
- Enter the eave overhang as a horizontal projection on the plan, not as a length along the slope. Subtract the fascia thickness first if your eave line is set from the face of the fascia.
- Pick the spacing, which drives the rafter count and the jack common difference, and enter the building length along the ridge for the count.
- Read the cut length, then read the plumb and level cut angles and the framing square setting. Check that the two angles add to 90 degrees — they always should.
- For jacks, lay out the longest one at the length given and step every following one down by the common difference.
- Read the note beside the answer before cutting. It says whether the ridge deduction was applied, what was counted, and what the number excludes — the birdsmouth seat depth, the cheek cuts and any hip shortening.
- Confirm the rafter is big enough for the span using the code span tables or an engineer, because this page does not check that.
The formula.
Everything on the page comes from two unit lengths and a run. The unit length is the rafter length per 12 inches of horizontal run: √(12² + rise²) for a common or jack rafter, and √(12² + 12² + rise²) = √(288 + rise²) for a hip or valley, because the hip covers the diagonal of a 12 inch square — 16.9706 inches — for every 12 inches the common rafter covers. Body length = (plan run ÷ 12) × unit length. Overhang length = (horizontal projection ÷ 12) × unit length. Cut length is their sum. The common rafter's run is half the building width minus half the ridge thickness. The plumb cut angle is arctan(rise ÷ unit run) and the level cut is 90° minus that. The jack common difference is (spacing ÷ 12) × the common unit length. Working the example: a 24 ft building gives a half width of 144 in, less 0.75 in for half of a 1.5 in ridge, leaving a run of 143.25 in. At 6:12 the common unit length is √(144 + 36) = √180 = 13.4164 in, so the body is (143.25 ÷ 12) × 13.4164 = 160.158 in. The 12 in overhang becomes (12 ÷ 12) × 13.4164 = 13.416 in. The cut length is 173.575 in, which is 14 ft 5 9/16 in to the nearest sixteenth. The total rise at the ridge is (144 ÷ 12) × 6 = 72 in. The plumb cut is arctan(6 ÷ 12) = 26.565° and the level cut is 63.435°. The jack common difference at 16 in centres is (16 ÷ 12) × 13.4164 = 17.889 in, or 17 7/8. The same roof's hip rafter uses √(288 + 36) = √324 = exactly 18 in per foot of common run, giving a body of (144 ÷ 12) × 18 = 216 in, an 18 in tail and a 234 in cut length — 19 ft 6 in — with a plumb cut of arctan(6 ÷ 16.9706) = 19.471°. That hip length can be checked without any unit-run constant at all: the hip runs from the plate corner at (0, 0, 0) to the ridge end at (144, 144, 72), a space diagonal of √(144² + 144² + 72²) = √46 656 = 216 in exactly. Every intermediate value is carried at twenty significant digits and rounded only at the end, and cut lengths are rounded to the NEAREST sixteenth rather than truncated, because a cut length rounded down does not reach.
A worked example.
A 24 ft by 40 ft gable roof at 6:12, framed with a 2x ridge board and a 12 inch eave, rafters at 16 inches on centre. The run is 144 inches — half of 288 — less 0.75 inches for half the 1.5 inch ridge, so 143.25 inches. At 6:12 the unit length is 13.4164 inches of rafter per foot of run, which gives a body of 160.158 inches. The 12 inch eave projection becomes 13.416 inches along the slope. Add them and the cut length is 173.575 inches: 14 ft 5 9/16 in. That ridge deduction is worth 0.84 inches. Without it the answer is 14 ft 6 7/16 in, and there are sixty-two rafters on this roof — thirty-one per slope over 40 feet at 16 inch centres, doubled for both sides — so forgetting it means cutting sixty-two rafters seven eighths of an inch long. They will not close at the ridge. The ridge sits 72 inches above the plate. The plumb cut at the top is 26.565 degrees off square and the seat cut at the plate is 63.435 degrees; they add to 90, which is the check to run on any rafter layout. Each rafter needs 16 foot stock, so the order is 992 lineal feet before waste. Switch the same roof to hip framing and the numbers move in a way that is worth seeing. The hip's unit length is √(288 + 36) = exactly 18 inches per foot of common run, so its body is 216 inches — 18 feet on the nose — its 12 inch eave becomes 18 inches of tail, and its cut length is 19 ft 6 in on 20 foot stock. Its plan run is 220.6 inches, the 45 degree diagonal of the 156 inch common run plus overhang. And its plumb cut is 19.471 degrees, not 26.565: the hip climbs the same 72 inches of rise over a longer run, so it lies flatter. Cutting a hip at the common rafter's angle is the single most expensive mistake on this page, and it is why the framing square setting output says 17 rather than 12. The jacks that die into that hip step on 12 like commons. There are eight per hip side at 16 inch centres, the longest on a 128 inch run at 13 ft 0 1/2 in, and each one below it is 17 7/8 inches shorter. Eight, not nine — a ninth jack would sit on the full 144 inch run, which is the common rafter's place.
Frequently asked questions.
How do I calculate rafter length from the span and pitch?
Why is my rafter too long by about an inch?
Why does a hip rafter use 17 instead of 12?
How long is a 12 inch overhang on the rafter?
What is the jack rafter common difference?
How many jack rafters are there per hip?
Why doesn't the page deduct anything for a hip or a jack?
Why round to the nearest sixteenth instead of down?
Does this tell me what size rafter to use?
What if the two roof slopes have different pitches?
References& sources.
- [1]International Code Council — IRC 2021 Section R802.3, Ridge: "a ridge board … shall be not less than 1 inch (25 mm) nominal thickness and not less in depth than the cut end of the rafter." This is the basis for the 1.5 in default ridge thickness and for the half-ridge deduction applied to common rafters.
- [2]International Code Council — IRC 2021 Tables R802.4.1 and R802.5.1, ceiling joist and rafter spans. Cited for what this page explicitly does NOT do: it computes rafter geometry, not rafter capacity. A rafter length from this page still has to satisfy a span table or an engineer's design.
- [3]International Code Council — IRC 2021 Table R301.7, Allowable Deflection of Structural Members, including the L/180 limit for rafters having a slope greater than 3:12 with no finished ceiling attached to the rafters, and L/240 for all other structural members. Quoted on the page to make clear that rafters are held to a looser deflection limit than floors.
- [4]Seattle Department of Construction and Inspections — 2021 Seattle Residential Code Chapter 8, Roof-Ceiling Construction, a municipal adoption of IRC 2021 Chapter 8, published as an open PDF that contains the full R802 text including R802.3, R802.4 and R802.5. Listed because the ICC's own copy refuses automated retrieval; the R802.3 sentence quoted above was read from a code-reference reproduction of that section rather than from this PDF, whose text layer could not be extracted.
- [5]Thallon / Wagner, Complete Book of Framing — roof framing chapter. Source for the trade conventions this page implements: "Run = ½ building width – ½ ridge board width"; "For every 12″ of common rafter run, there is 16.97″ (17″ approx.) of run for hip and valley rafters"; and the treatment of the tail as its own run and rise (TRun, TRise) rather than as a slope length.
- [6]American Wood Council — Span Tables for Joists and Rafters, 2021 edition. The rafter tables and the "Explanation of Tables" section establish the PS 20-20 dressed sizes and the convention that a rafter span is measured along the horizontal projection rather than along the slope — the distinction this page's horizontal run output exists to make explicit.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled