Audited 30 Jul 2026·Last updated 31 Jul 2026·6 citations·Tier 1·0 uses

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

Rafter type
Outside face of plate to outside face of plate — the full span, not the room dimension and not half of it. The run is half of this, less half the ridge.
ft
The first number of an x:12 pitch. 4:12 is a shallow suburban roof, 6:12 typical, 12:12 a 45° roof. Both slopes are assumed equal.
in / 12
Dressed thickness: 1.5 in for a 2x ridge, 0.75 in for a 1x, 3 in for a doubled 2x. IRC 2021 R802.3 requires not less than 1 in nominal and not less in depth than the cut end of the rafter. Enter 0 for the theoretical length with no deduction.
in
The HORIZONTAL projection past the outside of the wall, measured on the plan — not the length along the slope. Subtract the fascia thickness first if your eave line is set from the fascia face.
in
Rafter spacing
Along the ridge. Used only for the common rafter count; a hip roof has four hip rafters whatever its length.
ft
Cut length
14 ft 5 9/16 in
Body plus overhang, measured along the top edge of the rafter, rounded to the nearest sixteenth of an inch. For a common rafter the ridge deduction is already taken off. For a hip, valley or jack it is NOT — that shortening depends on your detail and on half the member thickness taken at 45°, so this is the theoretical length to the centreline and you deduct from it. The figure excludes the birdsmouth seat depth and the double cheek cut. This page is geometry only and does not check whether the rafter is strong enough: rafter spans are governed by IRC 2021 Tables R802.4.1 and R802.5.1, local amendments govern, adopted editions differ between jurisdictions, and a licensed structural engineer or architect must sign off before work proceeds.
Deductions, counts and what this does not cover
RIDGE DEDUCTION: applied. The run is 144 in less 0.75 in for half the ridge, giving 143.25 in. IRC 2021 R802.3 requires a ridge board of not less than 1 in nominal thickness and not less in depth than the cut end of the rafter. COUNT: 62 common rafters — 31 per slope over 40 ft at 16 in o.c., doubled for both sides of a gable roof. Excludes gable-end studs, doubled rafters at openings and any structural ridge. UNIT LENGTH: 13.4164 in of rafter per 12 in of common run, which is line 1 of a framing square rafter table at a 6:12 pitch. OVERHANG: 12 in is treated as a HORIZONTAL projection and becomes 13.416 in measured along the slope. It excludes any fascia thickness — subtract the fascia from the projection first if the eave line is set from the fascia face. LENGTHS are rounded to the nearest sixteenth of an inch, measured along the top edge of the rafter, and do not include the birdsmouth seat cut depth or the height above plate, which are set by how deep you cut the seat. SCOPE: geometry only, on a symmetrical roof of equal pitch both sides with an equal-pitch 90-degree hip. This page does NOT check whether the rafter is strong enough. Rafter spans are governed by IRC 2021 Tables R802.4.1 and R802.5.1 and by the deflection limits in Table R301.7, which allows L/180 for rafters steeper than 3:12 with no ceiling attached. It does not size a ridge beam, rafter ties, collar ties or connections. CODE AND SIGN-OFF: local amendments govern and adopted code editions differ between jurisdictions. A licensed structural engineer or architect must confirm the framing and sign off before work proceeds.
Cut length in inches
173.5748 in
Body length
160.1584 in
Overhang along the slope
13.4164 in
Horizontal run of this member
155.25 in
Total rise at the ridge
72 in
Unit length per foot of run
13.4164 in
Roof pitch angle
26.5651°
Plumb cut angle
26.5651°
Level (seat) cut angle
63.4349°
Framing square setting
6 on 12
Jack common difference
17.8885 in
Members of this type
62
Stock length to order
16ft
Total lineal feet of stock
992ft

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.

  1. 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.
  2. 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.
  3. Enter the pitch as the rise per 12 inches of run: the first number of an x:12 pitch.
  4. 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.
  5. 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.
  6. Pick the spacing, which drives the rafter count and the jack common difference, and enter the building length along the ridge for the count.
  7. 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.
  8. For jacks, lay out the longest one at the length given and step every following one down by the common difference.
  9. 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.
  10. 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.

L = (run ⁄ 12) × Lu + (overhang ⁄ 12) × Lu · Lu = √(144 + r²) common, √(288 + r²) hip

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.

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.

rafter Typecommon
ridge Thickness In1.5
rafter Spacing In16
building Length Ft40
building Width Ft24
pitch Rise In6
overhang Horizontal In12

Frequently asked questions.

How do I calculate rafter length from the span and pitch?
Take half the building width measured outside plate to outside plate, subtract half the ridge board thickness, and you have the run. Multiply the run in feet by the unit length √(144 + rise²) to get the body. Then multiply the horizontal eave projection in feet by the same unit length to get the tail, and add them. For a 24 ft building at 6:12 with a 1.5 in ridge and a 12 in eave: run 143.25 in, unit length 13.4164 in, body 160.158 in, tail 13.416 in, cut length 173.575 in = 14 ft 5 9/16 in.
Why is my rafter too long by about an inch?
Almost certainly the ridge deduction. The theoretical rafter runs to the centreline of the ridge, but a real ridge board is 1.5 inches thick, so the run must lose 0.75 inches — which on a 6:12 roof is 0.84 inches of rafter length. Set the ridge thickness to 0 on this page and you will see the theoretical figure, 14 ft 6 7/16 in against the 14 ft 5 9/16 in you actually cut. The other candidate is treating the eave overhang as a slope length when it is a horizontal projection.
Why does a hip rafter use 17 instead of 12?
Because a hip on a 90 degree corner runs diagonally in plan. While a common rafter covers 12 inches of run, the hip beside it covers the diagonal of that 12 inch square, which is √(12² + 12²) = 16.9706 inches. Framing squares print 17 because it is easier to hold, and it runs about 0.17 percent long — under a sixteenth of an inch on a 20 foot hip. This page uses the exact 16.9706 and tells you to set 17 on the square. The practical consequence is that the hip's plumb cut is shallower than the roof: 19.471 degrees against 26.565 on a 6:12 roof.
How long is a 12 inch overhang on the rafter?
Longer than 12 inches, and how much longer depends on the pitch and the member. On a 6:12 common rafter a 12 inch horizontal projection is 13 7/16 inches of rafter; on the hip of the same roof it is 18 inches. At 12:12 a 12 inch projection is 16 15/16 inches on a common and 20 13/16 on a hip. The overhang input on this page is always the horizontal projection you would measure off a plan, because that is what an eave dimension on a drawing means — and the output converts it.
What is the jack rafter common difference?
It is how much shorter each successive jack rafter is as they march up the hip, and it is a constant: the spacing in feet times the common unit length. At 6:12 and 16 inch centres it is 17.889 inches, or 17 7/8 to the nearest sixteenth; at 24 inch centres it is 26.833 inches. It is printed as line 3 of a framing square rafter table for exactly this reason. Lay out the longest jack once, then step down by the common difference for every jack after it rather than measuring each from scratch.
How many jack rafters are there per hip?
One fewer than you would expect from dividing the run by the spacing, because the last position belongs to the common rafter. On a 24 ft wide roof at 16 inch centres the common run is 144 inches and 144 ÷ 16 = 9, but there are eight jacks — at runs of 16 through 128 inches — with the ninth position at 144 inches being the common rafter at the end of the ridge. A simple hip roof has four hips with two sides each, so multiply by eight for the whole roof: sixty-four jacks in this case.
Why doesn't the page deduct anything for a hip or a jack?
Because there is no single correct number to deduct, and inventing one would be worse than leaving it out. A common rafter meets a ridge board square, so the shortening is simply half the ridge thickness. A hip can land against the ridge, against a common rafter, or into a nailer, and the deduction involves half the receiving member's thickness taken at 45 degrees; a jack meets a hip the same way. The page therefore gives the theoretical length to the centreline, says so beside the answer, and leaves the shortening to whoever knows the detail. It also does not compute the double cheek cuts.
Why round to the nearest sixteenth instead of down?
Because a cut length and a span round in opposite directions. On the span pages of this site a length is always truncated downward, since a span rounded up is a span you cannot safely use. A rafter is the reverse: one rounded down does not reach the ridge, and one rounded up can be shaved with a saw. So cut lengths here are rounded to the nearest sixteenth — 173.575 inches becomes 14 ft 5 9/16 in — and the sixteenth is the finest graduation on a normal tape.
Does this tell me what size rafter to use?
No, and that is a deliberate scope limit. This page is geometry: lengths, angles and counts. Whether a 2x8 is big enough for a 14 foot rafter run under your snow load 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 from Table R301.7 — which allows L/180 for rafters steeper than 3:12 with no ceiling attached, looser than any floor gets. Use the wood beam span calculator or the code tables for capacity, and note that neither this page nor those tables sizes a ridge beam, rafter ties, collar ties or the connections.
What if the two roof slopes have different pitches?
Then this page does not apply, and the difference is not small. Everything here assumes a symmetrical roof with equal pitch on both sides and equal-pitch 90 degree hips. With unequal pitches the ridge is no longer over the centre of the span, so each side has its own run; the hip no longer bisects the corner at 45 degrees in plan, so its unit run is not 16.9706; and the jacks on the two sides of that hip have different common differences. An irregular hip is laid out from the plan geometry or by a framing program, not from a rafter table.

References& sources.

  1. [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. [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. [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. [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. [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. [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
Coming soon