Roofing calculator
Rafter Calculator
A rafter calculator that turns your span and pitch into every cut length on the roof: common, hip, valley and jack rafters, plumb and level cut angles, birdsmouth seat and heel cuts, rafter count, ridge board and total lumber. The overhang is included, so the lengths you read are the lengths you cut. One wrong rafter length wastes lumber and a day of rework, so get the whole roof from one set of numbers before you pick up the saw.
- Free to use
- No sign-up
- Formula and sources shown

Got the number? Save it before it gets lost.
A result on a screen is easy to lose. Save this estimate in the app and it stays with the project, ready when you order.
Full width, outside of wall to outside of wall. The run is half the span, less half the ridge board.
6 is a 6/12 roof. 6 in of rise per 12 in of horizontal run.
The length the rafters run along. The ridge board is the same length.
16 in on-center for heavier loads and tile or slate; 24 in is the standard asphalt-shingle roof.
Level distance the rafter tail sticks out past the wall. The calculator adds the slope length of the tail.
Half the ridge thickness comes off the run, 0.75 in on a 1.5 in ridge board.
The birdsmouth code check uses the actual depth of the rafter you pick.
As wide as the wall plate: 3.5 in on a 2x4 wall, 5.5 in on a 2x6 wall.
Common rafter (to cut, with tail)
14 ft 5.56 in
13 ft 4.19 in to the ridge · 1 ft 1.44 in of tail · 26.57° plumb cut
Hip / valley rafter
19 ft 4.88 in
Hip plumb cut
19.47°
Jack difference (16 in o.c.)
17.89 in
Rise
5.97 ft
Rafters needed
62 (31 pairs)
Ridge board
40 ft
Total rafter lumber
897 ft
Birdsmouth heel / HAP
1.75 in / 6.36 in
Layout figures, not a structural design. Rafter size comes from the IRC span tables (R802.5) or an engineer. Confirm spans and loads with local code.
Turn this result into a priced plan
Save it to a project, add the rest of your materials, and send a client-ready quote. No retyping, no spreadsheet, no lost numbers.
Formula
Run = span ÷ 2 − ridge ÷ 2; rise = run × pitch ÷ 12; common length = √(run² + rise²); hip length = run × √(2 + (pitch ÷ 12)²); jack difference = spacing × √(1 + (pitch ÷ 12)²)
Worked example. A 24 ft span at 6/12 pitch, 40 ft long, rafters at 16 in on-center with a 12 in overhang: the run is 11.94 ft and the rise is 5.97 ft, so the common rafter is 13 ft 4.2 in to the ridge (14 ft 5.6 in with the tail), the hip rafter is 17 ft 10.9 in at a 19.47° plumb cut, each jack shortens by 17.89 in, and the roof needs 31 pairs, 62 rafters, plus a 40 ft ridge board and about 897 ft of rafter lumber.
A 24 ft span at 6/12 pitch needs a common rafter 13 ft 4.2 in long, a hip rafter 17 ft 10.9 in long, and 62 rafters at 16 in on-center for a 40 ft roof, with a plumb cut of 26.57 degrees. This page works out every rafter on a gable or hip roof from the span and the pitch: common, hip, valley and jack lengths, cut angles, birdsmouth, count, ridge board and total lumber, with the overhang included.
Key takeaways
- •On a 24 ft span at 6/12 pitch, the common rafter is 13 ft 4.2 in to the ridge (14 ft 5.6 in with a 12 in overhang) and the hip rafter is 17 ft 10.9 in. The hip is longer because it runs diagonally.
- •The plumb cut is the roof angle itself: 26.57° at 6/12 for a common rafter, but only 19.47° for the hip, because the hip travels 1.414 times as far horizontally for the same rise.
- •Each jack rafter shortens by a fixed amount, 17.89 in at 16 in centres on a 6/12 roof. Cut the longest jack, then take that difference off each next one.
- •A 40 ft gable roof needs 31 pairs (62 rafters) at 16 in on-center, or 21 pairs (42 rafters) at 24 in on-center, plus a 40 ft ridge board.
- •The run is measured to the centre of the ridge board, so half the ridge thickness comes off: a 1.5 in ridge shortens the run by 0.75 in, which shortens the common rafter by about 0.84 in.
- •Length is geometry, not structure. This calculator gives lengths and counts; the rafter size, 2x6, 2x8 or 2x10, comes from the IRC span tables (R802.5) or an engineer.
- •The framing square agrees with this calculator to a sixteenth of an inch: 13.42 in of common rafter per foot of run at 6/12, 18.00 in per foot for the hip, and a 17.89 in jack difference.
- •The overhang adds slope length, not horizontal length: a 12 in level overhang adds 13.42 in of rafter on a 6/12 roof, and 18 in of hip rafter.
How to use the rafter calculator
- Enter the building span in feet, the full width from outside of wall to outside of wall. The run is half the span, less half the ridge board.
- Enter the pitch as rise per 12 in of run: 6 for a 6/12 roof. The pitch angle, the rise and the slope factor all come from this one number.
- Enter the building length in feet. The rafter count comes from the length and the spacing, and the ridge board is the same length.
- Choose the rafter spacing: 16 in on-center for heavier loads and tile or slate, 24 in for the standard asphalt-shingle roof.
- Enter the overhang in inches, the level distance the rafter tail sticks out past the wall. The calculator adds the slope length of the tail to every rafter.
- Choose the ridge board thickness (1.5 in for a single 2x board) and the rafter size and seat width for the birdsmouth numbers.
- Read the common and hip lengths, the jack difference, the cut angles, the birdsmouth and the count. Then check the worked examples below against your own numbers before you cut.
Worked examples
1. The default: 24 ft span, 6/12 pitch, 40 ft long, 16 in spacing, 12 in overhang
- Run: 24 ÷ 2 − 1.5 ÷ 2 ÷ 12 = 11.94 ft; rise: 11.94 × 6 ÷ 12 = 5.97 ft
- Common rafter: √(11.94² + 5.97²) = √178.1 = 13.35 ft = 13 ft 4.2 in
- Tail: 12 in level overhang × 1.118 slope factor = 13.42 in, so the rafter to cut is 14 ft 5.6 in
- Hip rafter: 11.94 × √(2 + 0.5²) = 11.94 × 1.5 = 17.91 ft = 17 ft 10.9 in, at a 19.47° plumb cut
- Jack difference at 16 in centres: 16 × 1.118 = 17.89 in per jack
- Count: 40 × 12 ÷ 16 = 30 spaces + 1 = 31 pairs = 62 rafters; ridge board 40 ft; total lumber about 897 ft
- Birdsmouth on a 2x8 with a 3.5 in seat: 1.75 in heel cut, 6.36 in height above plate
2. A steeper roof: 28 ft span, 8/12 pitch, 36 ft long, 24 in spacing
- Run: 28 ÷ 2 − 0.0625 = 13.94 ft; rise: 13.94 × 8 ÷ 12 = 9.29 ft; angle 33.69°
- Common rafter: √(13.94² + 9.29²) = 16.75 ft = 16 ft 9 in; with the 12 in tail, 17 ft 11.4 in
- Hip rafter: 13.94 × √(2 + 0.667²) = 21.79 ft = 21 ft 9.5 in, at a 25.24° plumb cut
- Jack difference at 24 in centres: 24 × 1.202 = 28.84 in per jack
- Count: 36 × 12 ÷ 24 = 18 spaces + 1 = 19 pairs = 38 rafters; total lumber about 682 ft
- The steeper roof uses fewer rafters but longer ones, and the hip is 5 ft longer than the common, against 4.6 ft longer on the 6/12 roof
3. A low-slope roof: 20 ft span, 4/12 pitch, 30 ft long, 16 in spacing, 18 in overhang
- Run: 20 ÷ 2 − 0.0625 = 9.94 ft; rise: 9.94 × 4 ÷ 12 = 3.31 ft; angle 18.43°
- Common rafter: √(9.94² + 3.31²) = 10.47 ft = 10 ft 5.7 in
- Hip rafter: 9.94 × √(2 + 0.333²) = 14.44 ft = 14 ft 5.3 in
- Jack difference at 16 in centres: 16 × 1.054 = 16.87 in per jack
- Count: 30 × 12 ÷ 16 = 22.5, rounded up to 23 spaces + 1 = 24 pairs = 48 rafters
- A low-slope roof is where the hip matters most: the hip is 38% longer than the common, against 34% on the 6/12 roof
Common rafter length: the formula and the framing square
A common rafter is the hypotenuse of a right triangle. The run is the horizontal leg, half the span, less half the ridge board, and the rise is the vertical leg, run times pitch over 12. The length is the square root of run squared plus rise squared, and the slope factor, the length per foot of run, is the square root of 1 plus the pitch squared. At 6/12 the slope factor is 1.118, so every foot of run is 13.42 in of rafter.
| Pitch | Angle | Common per ft of run | Rise per ft of run | Common, 12 ft run |
|---|---|---|---|---|
| 3/12 | 14.04° | 12.37 in | 3.00 in | 12 ft 4.4 in |
| 4/12 | 18.43° | 12.65 in | 4.00 in | 12 ft 7.8 in |
| 5/12 | 22.62° | 13.00 in | 5.00 in | 13 ft 0.0 in |
| 6/12 | 26.57° | 13.42 in | 6.00 in | 13 ft 5.0 in |
| 7/12 | 30.26° | 13.89 in | 7.00 in | 13 ft 10.7 in |
| 8/12 | 33.69° | 14.42 in | 8.00 in | 14 ft 5.1 in |
| 10/12 | 39.81° | 15.62 in | 10.00 in | 15 ft 7.4 in |
| 12/12 | 45.00° | 16.97 in | 12.00 in | 16 ft 11.6 in |
Per-foot figures are the framing-square rafter table values, rounded to the nearest hundredth of an inch. The 12 ft run column is the length to the ridge centreline, before the ridge deduction and before any overhang.
The framing square says the same thing the calculator does, and checking one against the other is the fastest way to catch a mistake. At 6/12 the square reads 13.42 in of common rafter per foot of run; multiply by the 11.94 ft run of the default roof and you get 160.2 in, or 13 ft 4.2 in. Exactly what the calculator gives. If your square and your calculator disagree by more than a sixteenth, one of them has the wrong pitch or the wrong run, and the run is usually the culprit: most people forget the ridge deduction, or measure the span to the inside of the walls instead of the outside.
The same slope factor gives you the roof area from the plan area, because the slope stretches the roof in one direction only. A 6/12 roof has 11.8% more surface than its footprint, so a 24 × 40 ft footprint is 960 sq ft of plan and about 1,073 sq ft of roof surface before the overhang. That is the number that decides how much roofing to buy, and the roofing calculator works it out from the same pitch.
For the roof area, squares and shingle bundles, use the roofing calculator, which takes the same span, length and pitch and returns the covering. For the truss version of the same roof, use the roof truss calculator.
Hip and valley rafters: why the hip is longer and shallower
A hip rafter runs from the end of the ridge to an outside corner, diagonally across the plan. On a regular hip roof the two roof planes have the same pitch and meet at 45 degrees in plan, so the hip's horizontal run is the common run times the square root of 2, 1.414, and its length is the common run times the square root of 2 plus the pitch squared. At 6/12 that factor is exactly 1.5, so the hip is 18 in long for every foot of common run, against 13.42 in for the common itself.
| Pitch | Hip per ft of common run | Hip angle (plumb cut) | Hip length, 12 ft run | Hip vs common |
|---|---|---|---|---|
| 4/12 | 17.44 in | 13.26° | 17 ft 5.3 in | +38% |
| 6/12 | 18.00 in | 19.47° | 18 ft 0.0 in | +34% |
| 8/12 | 18.76 in | 25.24° | 18 ft 9.1 in | +30% |
| 10/12 | 19.70 in | 30.51° | 19 ft 8.4 in | +26% |
| 12/12 | 20.78 in | 35.26° | 20 ft 9.4 in | +22% |
Hip length is measured to the same ridge point as the common rafter. The hip angle is the plumb cut for the hip, always shallower than the common plumb cut, because the hip travels further horizontally for the same rise.
The hip sits at a shallower angle than the common, and that surprises people who assume the same pitch means the same angle. Both rafters reach the same ridge height, but the hip gets there diagonally, travelling 1.414 times as far horizontally for the same rise, so on a 6/12 roof the common is at 26.57° and the hip at 19.47°, a difference of 7.1°. Mark the hip plumb cut with 6 and 17 on the framing square, not 6 and 12: the 17 is the diagonal of the 12 in square, 16.97 in, rounded for the trade.
A valley rafter is the mirror image of a hip: it runs from the ridge down into an inside corner where two roof planes meet, and geometrically it has exactly the same length and the same plumb cut as the hip on the same roof. What changes is the treatment, not the numbers. A valley sits in a trough, so it needs backing and a bevel where the hip needs a cheek cut, and the valley takes the water, so the flashing and the underlayment matter more. The lengths this calculator gives apply to both; the cutting notes in the next section apply to the hip.
On a hip roof the common rafters only run along the middle of the building, between the two ends of the ridge. The ridge on a hip roof is shorter than the building by one span: on a 24 ft wide, 40 ft long building the ridge is 16 ft, and the rest of the roof is framed with jacks. The calculator's rafter count is for a gable roof; on a hip roof, subtract the commons that the hips replace and add the jacks and the four hips.
Jack rafters: the common difference and the cut list
Jack rafters are shortened common rafters that frame into a hip or a valley instead of reaching the ridge. Hip jacks get shorter as they approach the corner; valley jacks get longer as they approach the ridge. Either way, each successive jack differs from the one before by the same fixed amount, the common difference, which is the rafter spacing times the common slope factor.
| Pitch | Jack difference, 16 in o.c. | Jack difference, 24 in o.c. | Jack difference, 12 in o.c. |
|---|---|---|---|
| 4/12 | 16.87 in | 25.30 in | 12.65 in |
| 6/12 | 17.89 in | 26.83 in | 13.42 in |
| 8/12 | 19.23 in | 28.84 in | 14.42 in |
| 10/12 | 20.83 in | 31.24 in | 15.62 in |
| 12/12 | 22.63 in | 33.94 in | 16.97 in |
The jack difference is the framing-square row headed difference in length of jacks. Cut the longest jack first, then subtract the difference for each next jack. The whole set comes off one measurement.
The practical way to cut jacks is to cut the longest one first and use it as the pattern. On the default roof the longest hip jack is the common rafter less one jack difference, 13 ft 4.2 in less 17.89 in, or about 11 ft 10.3 in to the ridge line, and each jack after it is 17.89 in shorter. Measure once, mark the whole set, and cut them in order so a mistake shows up as a pattern rather than a single wrong rafter. The cheek cut where the jack meets the hip is a side cut, marked with the framing square's side-cut row; the plumb cut at the top of the jack is the same 26.57° as the common.
The count matters here too. A hip end on a 24 ft span at 16 in centres has about eight jacks per side per end, and four hip ends on a full hip roof means thirty-two jacks before you count a single common. That is why a hip roof uses more lumber than a gable roof of the same footprint, and why the lumber total in the calculator, about 897 ft for the default gable, is a floor, not a ceiling, once hips are added.
Plumb cuts, level cuts and the birdsmouth
Every cut on a rafter comes from the pitch angle. The plumb cut is vertical when the rafter is in place, and its angle is the roof angle itself: arctan(pitch ÷ 12), or 26.57° at 6/12. The level cut, the seat of the birdsmouth, is horizontal, so it is 90° minus the plumb cut, or 63.43° at 6/12. The ridge cut, the tail cut and the birdsmouth heel cut are all plumb cuts at the same angle, which is why one speed-square setting marks the whole rafter.
| Pitch | Plumb cut | Level (seat) cut | Hip plumb cut | Birdsmouth heel, 3.5 in seat |
|---|---|---|---|---|
| 4/12 | 18.43° | 71.57° | 13.26° | 1.17 in |
| 6/12 | 26.57° | 63.43° | 19.47° | 1.75 in |
| 8/12 | 33.69° | 56.31° | 25.24° | 2.33 in |
| 10/12 | 39.81° | 50.19° | 30.51° | 2.92 in |
| 12/12 | 45.00° | 45.00° | 35.26° | 3.50 in |
The heel cut is the seat width times the tangent of the pitch angle. The hip plumb cut is always shallower than the common plumb cut on the same roof.
The birdsmouth is the triangular notch where the rafter sits on the wall plate: a level seat cut that bears on the plate and a plumb heel cut against the outside of the wall. The heel cut is the seat width times the pitch, 3.5 × 0.5 = 1.75 in at 6/12 on a 2x4 plate, and the height above plate, the rafter left above the seat, is the rafter depth divided by the cosine of the angle, less the heel cut: 6.36 in for a 2x8 at 6/12. The notch depth, measured perpendicular to the rafter, is the seat times the sine of the angle, 1.57 in at 6/12, and the IRC limits end notches to a quarter of the rafter depth, 1.81 in on a 2x8, so the default cut passes.
The full birdsmouth calculation, including the code check for every rafter size and the maximum seat for your pitch, is on the birdsmouth cut calculator. Get the notch right before you cut the whole set: cut one rafter, check it against the plate, and use it as the pattern for the rest.
Rafter count, ridge board and lumber
The count is simple arithmetic with one rounding step. The number of spaces is the building length in inches divided by the spacing, rounded up, and the number of pairs is the spaces plus one. One pair at each end. At 16 in on-center a 40 ft building has 30 spaces and 31 pairs, or 62 rafters; at 24 in it has 20 spaces and 21 pairs, or 42 rafters. The ridge board is the building length, 40 ft on the default roof, and the total rafter lumber is the rafter count times the cut length, about 897 ft on the default roof.
| Building length | 16 in o.c. pairs | 16 in o.c. rafters | 24 in o.c. pairs | 24 in o.c. rafters |
|---|---|---|---|---|
| 24 ft | 19 | 38 | 13 | 26 |
| 30 ft | 24 | 48 | 16 | 32 |
| 36 ft | 28 | 56 | 19 | 38 |
| 40 ft | 31 | 62 | 21 | 42 |
| 50 ft | 39 | 78 | 26 | 52 |
| 60 ft | 46 | 92 | 31 | 62 |
Pairs count both sides of the roof. Gable roofs only. A hip roof replaces some commons with jacks and adds four hip rafters, and the ridge is shorter than the building by one span.
Spacing is not a free choice. Sixteen inches on-center is the spacing for heavier snow or wind loads, for tile or slate roofing, and wherever the code or the engineer requires it; 24 in is the standard for most residential gable roofs with asphalt shingles. Wider spacing saves rafters but needs thicker roof sheathing and stronger rafters, and the spacing is part of the engineered design, never widen it to save money without the truss or lumber supplier's approval. The spacing also sets the jack difference, so changing the spacing after the jacks are cut means re-cutting the whole set.
Order the lumber with waste in mind. Rafter lumber comes in 2 ft increments, so a 14 ft 5.6 in rafter needs a 16 ft board, and the offcut is waste unless the roof has shorter jacks to cut from it. The 897 ft total on the default roof is the cut length, not the purchase length. Buy 16 ft boards for the commons and use the offcuts for the jacks and the blocking, and allow about 10% extra for defects and miscuts.
Rafter size and span: what this calculator does not do
Length is geometry; size is structure, and the two questions have different answers. Whether a 2x8 spans 11.94 ft depends on the species and grade of the lumber, the spacing, the dead load of the roofing, the snow load and the wind load, and the answer comes from the IRC span tables (R802.5.1) or the AWC span tables, not from a length calculator. A 2x8 of Douglas fir-larch No. 2 at 16 in centres spans further than the same size in spruce-pine-fir, and a roof carrying tile spans less than a roof carrying shingles.
The IRC prescriptive tables stop applying where the ground snow load is over 70 psf: above that, the roof must be engineered, and no span table will save you. The same is true of any roof with an unusual shape, a long span, a heavy covering or a cathedral ceiling with no ceiling joists. The tables assume a conventional framed roof with ceiling joists acting as ties, and a roof without ties pushes the walls out. If your roof has no ceiling joists, the rafters need a ridge beam sized by an engineer, not a ridge board.
The practical rule is to size first, then cut. Look up your span in the IRC or AWC tables for your species, grade, spacing and snow load, and confirm the size with your lumber supplier before you order. If the table says the span needs a 2x10 and you have 2x8s on site, the answer is not to cut them shorter. It is to order 2x10s, or to add a purlin or a ridge beam that shortens the span. Cutting a rafter to the right length does not make it the right rafter.
The load side of the question is on the snow load calculator, which works out the roof snow load in psf from your ground snow load, pitch and exposure under the ASCE 7 method. The load the span tables are built on.
Common rafter mistakes
- •Measuring the span to the inside of the walls instead of the outside. The span is wall to wall, outside to outside. Measuring inside understates the run and every rafter comes up short.
- •Forgetting the ridge deduction. Half the ridge board, 0.75 in on a 1.5 in ridge, comes off the run, and forgetting it makes every common rafter about 0.84 in too long at 6/12.
- •Measuring the pitch up the slope instead of along the run. Pitch is rise per 12 in of horizontal run; measuring 12 in up the rafter gives a pitch that reads too shallow, and the error grows with the pitch.
- •Cutting the hip plumb at the common angle. The hip sits at 19.47° on a 6/12 roof, not 26.57°. Cutting it at the common angle leaves a gap at the ridge that no amount of caulk will fix.
- •Using the gable rafter count on a hip roof. A hip roof replaces commons with jacks and adds four hips, and the ridge is shorter than the building by one span. The gable count understates the lumber by a third or more.
- •Sizing the rafter from the length calculator. Length is geometry; size comes from the IRC span tables or an engineer, and a 2x8 cut to the right length is still the wrong rafter if the span needs a 2x10.
- •Cutting the whole set from the first rafter without checking it. Cut one, set it on the plates, check the ridge height and the birdsmouth, and only then use it as the pattern.
- •Forgetting the tail. The overhang adds slope length, 13.42 in of rafter for a 12 in level overhang at 6/12, and a rafter cut to the ridge length with no tail has no eave at all.
How this calculator compares with the rivals
The rafter search is split between single-purpose tools and one strong all-rounder, and no rival gives the common, hip, valley and jack rafters plus the birdsmouth, the count and the lumber in one place with a full guide. That is the gap this page fills.
| Rival | What it offers | Where this page beats it |
|---|---|---|
| Simulations4All | Rafter Length Calculator | Common, hip, valley and jack rafters in one tool, with birdsmouth seat cut, plumb cut, HAP, tail length and ridge shortening; checked against the Rafter Length Manual, IRC R802.5 and framing-square data | The strongest rival, and the only one that matches this page on breadth. This page adds the worked examples with real numbers, the framing-square table, the rafter-count and lumber tables, the span-table guidance and the full guide, and it links to the birdsmouth and snow-load pages that carry the two questions a length calculator cannot answer. |
| Absurd Tools | Rafter & Roof Pitch Calculator | Common, hip, valley and jack lengths from a pitch, with the hip-shallower-than-common explanation and the framing-square reference | Good on the hip geometry and the explanation of why the hip is shallower. This page adds the rafter count, the ridge board, the total lumber, the birdsmouth and the worked examples, and covers the valley explicitly rather than by implication. |
| JobsiteWise AngleWise | Hip & Valley Rafter Calculator | Common and hip lengths, both plumb cuts and the jack cheek cut from pitch and common run | Good on the cheek cut, which this page does not calculate. This page adds the jack difference table, the rafter count, the birdsmouth, the overhang handling and the full guide, and the cheek cut is a marking detail, not a length. |
| FieldCalc | Hip & Valley Rafter Calculator | Hip and valley line length, hip pitch, common length and jack common difference for a regular hip, with overhang | Clean and correct on the four numbers a framer needs before cutting a hip. This page adds the rafter count, the ridge board, the lumber total, the birdsmouth and the span-table guidance it explicitly leaves out. |
| RafterCalculators.com | How to Read a Framing Square | The six rafter-table rows explained, with the full pitch table | The best reference for the square itself. This page turns the table into a calculator for the reader's own span and pitch, and adds the count, the lumber and the worked examples. |
| OneTripDIY | Rafter Calculator | Rafter length, angles and cuts with spacing and rafter count | Good on the count. This page adds the hip and valley rafters, the jack difference table, the birdsmouth code check and the span-table guidance. |
| Omni Calculator | A rafter length calculator in its construction set, common rafters only in the top results for this keyword | Omni's version covers the common rafter. This page is the superset the genuinely-new research called for: common, hip, valley and jack in one place, with the birdsmouth and the count. |
| CalculatorSoup | No dedicated rafter calculator in the top results for this keyword | Its strength is general-purpose calculators. |
The honest summary: Simulations4All is the rival to watch, because it already does the full set of rafter types in one tool and checks its numbers against the IRC. No rival combines that breadth with a rafter count, a lumber total, a birdsmouth code check, worked examples and a guide that explains the span tables, and none of them links the length question to the snow load that decides the rafter size. This page wins by being the only one that does all of it.
Assumptions
- •This calculator works out rafter geometry. Lengths, angles and counts. It does not size the rafter: whether a 2x6, 2x8 or 2x10 spans your distance depends on the species, grade, spacing and the snow and wind loads, which come from the IRC span tables (R802.5) or an engineer.
- •The hip and valley figures assume a regular hip roof, where both roof planes have the same pitch and meet at 45 degrees in plan. An irregular hip, with different pitches on the two sides, needs a different layout.
- •The run is measured to the centre of the ridge board, so half the ridge thickness is deducted. A 1.5 in ridge board shortens the run by 0.75 in.
- •Rafter counts assume a simple gable roof of the entered length with rafters at the entered spacing on both sides, plus one pair at each end. Hip roofs, valleys, dormers and overhangs change the count.
- •Lengths are given to the ridge and to the birdsmouth; the tail beyond the wall is added separately from the overhang, so the total length is the length to cut.
- •These are layout figures, not a structural design. Confirm spans, connections and bracing with your local code and an engineer before you build.
Sources✓ Verified
- International Residential Code (IRC), Section R802. Roof framing: rafter spans (Tables R802.5.1), ridge boards, ceiling joist and rafter ties, and the notching limits of R802.7.1.
- American Wood Council (AWC), Span Tables for Joists and Rafters. Allowable rafter spans by species, grade, spacing and load, the tables that decide whether a 2x8 spans your distance.
- Framing square rafter tables. Length of common rafter per foot of run, hip/valley per foot of run, and the jack difference at 16 in and 24 in centres, the numbers stamped on the blade, e.g. 13.42 in/ft common and 18.00 in/ft hip at 6/12.
- Simulations4All rafter length calculator. Common, hip, valley and jack rafters in one tool, checked against the Rafter Length Manual, IRC R802.5 and Johnson Level framing-square data.
Formula reviewed November 2026.
13 ft 4.2 in from the ridge to the birdsmouth, or 14 ft 5.6 in including a 12 in overhang. The run is 11.94 ft (half the 24 ft span less half the 1.5 in ridge board) and the rise is 5.97 ft, so the length is the square root of 11.94 squared plus 5.97 squared, 13.35 ft. The framing square says the same thing another way: 13.42 in of rafter per foot of run at 6/12, times 11.94 ft of run, is 160.2 in.
A hip rafter runs diagonally in plan, so its run is the common run times the square root of 2 (1.414), and its length is the common run times the square root of 2 plus the pitch squared. At 6/12 on a 24 ft span that is 11.94 × 1.5 = 17.91 ft, or 17 ft 10.9 in. The hip sits shallower than the common, 19.47° against 26.57°, because it travels further horizontally for the same rise. That is why the framing square has a 17 on it: a hip crosses the diagonal of a 12 in square, which is 16.97 in.
How much shorter each successive jack rafter is than the one before it, at your rafter spacing. It is the spacing times the common slope factor: at 16 in centres on a 6/12 roof it is 16 × 1.118 = 17.89 in, and at 24 in centres it is 26.83 in. Cut the longest jack, then take the difference off each next one. That is the number printed on the framing square as the difference in length of jacks.
At 16 in on-center, 31 pairs, 62 rafters, for a 40 ft gable roof: 40 × 12 ÷ 16 = 30 spaces, plus 1, gives 31 pairs. At 24 in on-center the same roof needs 21 pairs, or 42 rafters. The count is for the common rafters on both sides; a hip roof replaces some commons with jacks and adds the hip rafters themselves, and dormers and valleys add more.
26.57 degrees, the roof angle itself, arctan(6 ÷ 12). The plumb cut is the vertical cut at the ridge, and the level (seat) cut is 90 minus the plumb cut, or 63.43 degrees. The hip plumb cut is shallower, 19.47 degrees, because the hip runs diagonally. Set the same angle on a speed square to mark every cut on the rafter.
No, and any calculator that claims to is overreaching. Length is geometry; size is structure. Whether a 2x8 spans 12 ft depends on the species and grade, the spacing, the snow load and the wind load, and the answer comes from the IRC span tables (R802.5) or the AWC span tables, or from an engineer. This calculator gives you the lengths and counts; the span tables give you the size.
Converters to use with the Rafter Calculator
Switch units, compare bulk and bagged quantities, or check coverage, without leaving BuildCova.
RoofingRoofing Squares to Square Feet Converter1 square = 100 sq ft, plus bundles.
RoofingRoof Pitch to Degrees Converter6/12 pitch is 26.57°, any pitch.
RoofingShingle Bundles to Squares Converter3 bundles make 1 square (100 sq ft).More roofing calculators
RoofingGambrel Roof CalculatorA gambrel roof calculator that works out both slopes of a gambrel roof from the span, building length and the two pitches: both rafter lengths and angles, ridge height, roof area in squares and shingle bundles, rafter count, attic volume and headroom. Those numbers decide whether the barn loft is a usable room or a crawl space, so check them before you order lumber or shingles.
RoofingBirdsmouth Cut CalculatorA birdsmouth cut calculator that works out the notch that lets a rafter sit flat on the wall plate. Enter the pitch, seat width and rafter size, and get the heel cut, notch depth, height above plate and the code check. Cut the first rafter right and it becomes the pattern for the whole roof, so check the notch before you cut, not after.
RoofingSnow Load CalculatorA snow load calculator that works out what your roof actually carries in winter, in pounds per square foot, under the ASCE 7 method. Enter your ground snow load, roof pitch and site factors, and get the flat-roof and sloped-roof snow load, the total weight on the whole roof and the snow depth it represents. Size the roof for the load it will hold, not the load you hope for.
RoofingRoof Pitch CalculatorA roof pitch calculator that turns rise and run into everything a roof needs, the pitch in X:12, the angle in degrees, the slope percentage, the rafter length, the roof area from the footprint and the shingle squares with waste. Enter the pitch you measured, or the rise and run you have, and the calculator converts between every notation a roof gets described in.
RoofingSkylight CalculatorA skylight calculator that sizes the skylights for a room and prices them, so you get daylight without ordering glass that does not fit. Enter the room size and how it is used, and the calculator applies the daylighting rule for that room, picks the standard skylight sizes that fit between your rafters, counts how many you need and prices the units plus installation, adjusted for the roof type, because a tile roof costs more to flash than a shingle roof.
RoofingCompound Slope CalculatorA compound slope calculator for slopes that run in two directions at once. A roof valley, a hip, a ramp with a cross-fall and a shower floor all slope in two directions, and the slope you walk on, drain on or cut a rafter to is neither of the two slopes, but their resultant. Enter the two pitches and the plan run to get the resultant slope, angle and percent grade, the sloped length and, where two equal pitches meet at a square corner, the hip or valley rafter length.Was this calculator helpful?
Material requirements can vary based on product specifications and job conditions. Verify quantities with your supplier before ordering.