Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Finance
    • Math
    • Health & Fitness
    • Education
    • Science
    • Real Estate
    • Chemistry
  • About Us
  • Contact Us
CalculatorZilo Logo
Home /  Rafter Calculator 
Carpentry Calculators

 Rafter Calculator 

Published onMay 5, 2026 Updated onOctober 24, 2026 6:48 am

Every common rafter is the hypotenuse of a right triangle built from the run and the rise, and getting that triangle right on paper is what makes the lumber order, the cuts and the ridge line up on site. This calculator works the triangle from your span and pitch, or from a known total rise, then adjusts for eave overhang and ridge board thickness, suggests the stock board length to order, and counts rafters at 24 inch on-center spacing.

Rafter Calculator
Common-rafter geometry for gable roofs: length, rise, run and angle, plus overhang, ridge and rafter count

Wall to wall, outside to outside.

6 = 6:12 pitch.

Rafter stops at ridge centerline; half the thickness comes off the run.

Ridge length. Count assumes 24-inch on-center spacing.

0 ft

Rafter length (including overhang)

Run0 ft
Rise0 ft
Pitch angle0 deg
Order length (next whole foot)0 ft
Rafters needed (24 in o.c., one slope)0

Framing math only. Verify cuts with a rafter square and follow local building codes for spans and lumber sizes.

Quick Answer

For a 20 ft span at 6:12 pitch with no overhang and no ridge adjustment, the run is 10.00 ft, the rise is 5.00 ft, and the rafter length is 11.18 ft at a 26.57 degree angle, so you order 12 ft boards. A 30 ft roof length needs 16 rafter positions per slope at 24 inch spacing. Those are the exact outputs of the pre-filled calculator above.

Key takeaways

  • Run is not half the span once real framing shows up: add the overhang, subtract half the ridge thickness, both converted from inches to feet first.
  • The overhang grows the rafter along the slope. A 12 inch overhang at 6:12 adds about 13.4 inches of board, not 12.
  • The order length is the bare line length rounded up to the next whole foot, with no cutting allowance added. Size up when your yard sells 2 ft increments.
  • The rafter count is per slope. A gable roof needs a rafter on both sides of every position, so double the count for the board order.
On this page
  • Quick Answer
  • How to use the rafter calculator
  • The rafter formulas, with the unit conversions done honestly
  • Worked example: a 20 ft span at 6:12
  • Rafter lengths by pitch for a 20 ft span
  • Birdsmouth cuts, the ridge, and what the length really measures
  • Length is not sizing: spans, spacing and codes
  • What competing calculators miss
  • Frequently asked questions
  • Add This Calculator to Your Website

How to use the rafter calculator

Pick the mode that matches what you know, pitch or total rise, fill in the span, and click Calculate Rafter. Results stay hidden until you calculate.

  1. Choose a mode: “From Roof Pitch” if you know the pitch (6 for 6:12), or “From Known Rise” if you measured the height and want the pitch worked out for you.
  2. Enter the roof span in feet: the full outside-to-outside building width. The pre-filled example uses 20 ft.
  3. Add the eave overhang and ridge thickness in inches: both default to 0. Leave them at 0 for the pure textbook triangle; enter real values for a cut-ready length.
  4. Optionally enter the roof length in feet: the ridge length, for the rafter count at 24 inch on-center spacing. Leave it blank and the count row stays hidden.
  5. Read the panel: rafter length first, then run, rise, pitch angle with the pitch restated as x:12, the order length, and the count when requested. Copy or share buttons save the whole result as one line of text.

Bad entries stop with a plain message instead of a number: a missing or zero span, a zero pitch or rise, a negative overhang or ridge thickness, and a ridge so thick it eats the whole run (“Ridge thickness is too large for this span.”). Blank overhang, ridge and roof length fields are treated as zero or skipped, never as errors.

The rafter formulas, with the unit conversions done honestly

A common rafter is the hypotenuse of a right triangle. The run is the horizontal leg, the rise is the vertical leg, and Pythagoras does the rest. The part most write-ups gloss over is that the span is entered in feet while the overhang and ridge are entered in inches, so the inches are divided by 12 before they touch the run.

Run = (Span ÷ 2) + (Overhang ÷ 12) − (Ridge thickness ÷ 2 ÷ 12), all in feet
Pitch mode: Rise = Run × Pitch ÷ 12  |  Rise mode: Pitch = Rise ÷ Run × 12
Rafter length = √(Run² + Rise²)
Pitch angle = arctan(Pitch ÷ 12), and a pitch angle calculator converts between the two forms on its own
Rafter count = floor(Roof length × 12 ÷ 24) + 1 per slope at 24 inch spacing

Two consequences follow from doing the overhang inside the triangle instead of tacking it on afterwards. First, the rise in pitch mode is figured on the full run including the overhang, so the tail of the rafter sits at the same pitch as the rest of the roof, which is how a real rafter is laid out. Second, the length grows along the slope: each foot of horizontal overhang adds the rafter length factor for your pitch, 1.118 ft at 6:12, 1.202 ft at 8:12. Tools that add the overhang flat, foot for foot, quietly short every rafter.

Worked example: a 20 ft span at 6:12

The pre-filled example is the textbook case: 20 ft span, 6:12 pitch, no overhang, no ridge adjustment, 30 ft roof length. Running it gives a 10.00 ft run, 5.00 ft rise, 11.18 ft rafter and 16 rafter positions.

1. Run: 20 ÷ 2 = 10.00 ft→ 2. Rise: 10 × 6 ÷ 12 = 5.00 ft→ 3. Length: √(100 + 25) = 11.18 ft→ 4. Angle 26.57 deg, order 12 ft boards, 16 positions

Now the same roof framed for real: 24 ft span, 8:12 pitch, a 12 inch eave overhang, a 1.5 inch ridge board and a 40 ft roof length. The run becomes 12 + 1 − 0.0625 = 12.94 ft, the rise 8.63 ft, the rafter 15.55 ft at 33.69 degrees, the order length 16 ft boards, and the count 21 positions per slope. The ridge adjustment alone shortened the run by three quarters of an inch, small on one rafter and the difference between a tight ridge and a gaping one across forty feet of roof. Rise mode checks out against the same triangle: enter a 28 ft span with a 7 ft rise, an 18 inch overhang and the same ridge, and the tool returns a 5.44:12 pitch at 24.39 degrees with a 16.95 ft rafter.

Rafter lengths by pitch for a 20 ft span

Steeper pitches buy attic headroom with board length. Every row below is a run of this calculator at a 20 ft span with no overhang and no ridge adjustment, so the run is 10.00 ft throughout.

PitchAngleRiseRafter lengthOrder length
3:1214.04 deg2.50 ft10.31 ft11 ft boards
4:1218.43 deg3.33 ft10.54 ft11 ft boards
5:1222.62 deg4.17 ft10.83 ft11 ft boards
6:1226.57 deg5.00 ft11.18 ft12 ft boards
8:1233.69 deg6.67 ft12.02 ft13 ft boards
10:1239.81 deg8.33 ft13.02 ft14 ft boards
12:1245.00 deg10.00 ft14.14 ft15 ft boards

Read the order column with a lumber yard in mind: yards stock even lengths (8, 10, 12, 14, 16 ft and up), so an 11 ft order length usually means buying 12 ft boards and trimming. The calculator reports the honest next whole foot rather than pretending every length exists on the rack.

Birdsmouth cuts, the ridge, and what the length really measures

The length this tool returns is the rafter’s line length: the straight slope distance from the ridge centerline to the tail, measured along the top edge line of the rafter. Two site details sit on top of that number.

The birdsmouth is the notch that seats the rafter on the wall: a horizontal seat cut resting on the top plate and a vertical plumb cut against the wall face. It removes material below the line, so it does not shorten the line length, but the seat cut depth is capped in practice because cutting too deep weakens the rafter at exactly the point carrying the wall load. Layout marks for the seat and plumb cuts come from the same pitch angle the tool reports, and test-fitting one pattern rafter before cutting the set is standard practice. Converting the tool’s decimal feet to the fractions on a tape, 11.18 ft is 11 ft 2 3/16 in near enough, is where an inches to fraction calculator earns its keep on layout day.

The ridge adjustment is the opposite case: it changes the line itself. Rafters on both slopes butt against the same ridge board, so each rafter’s run ends at the board’s centerline, half a thickness short of the theoretical peak. Enter the board’s actual thickness, 1.5 in for a nominal 2x ridge, which the USDA Forest Products Laboratory’s Wood Handbook chapter on commercial lumber confirms is the dressed size of 2 inch dimension stock. Leaving the ridge at zero returns the theoretical peak-to-tail length, which is the right answer for a ridge-less layout exercise and the wrong one for cutting.

Length is not sizing: spans, spacing and codes

This calculator answers “how long,” never “how big.” Whether a 2×6 may legally span your run at your snow load is a different question with a code table behind it.

Allowable rafter spans depend on lumber species and grade, spacing, roof live and dead load, and whether a ceiling is attached. The International Code Council’s 2021 IRC Chapter 8, Roof-Ceiling Construction tabulates those spans in the R802.4.1 tables, and the American Wood Council’s tutorial on loads and span tables walks through how the load side of the lookup works. The count here is fixed at 24 inch on-center spacing; drop to 16 inch spacing for heavier loads and the count formula changes with it, floor(length × 12 ÷ 16) + 1 per slope. A roof joist calculator covers the horizontal members that tie the rafter feet together, and once the frame is sized, a gable roof area calculator turns the same span, pitch and length into the surface area for sheathing and shingles.

What competing calculators miss

Rafter tools are plentiful, and most of them get the central square root right. The differences live at the edges, which is where rafters get cut wrong:

  • Flat-overhang tools and charts (CalculoOnline among them): the worked example adds a 2 ft overhang as a flat 2 ft of length, and its reference chart lists 10.77 ft for a 20 ft span at 6:12, where the triangle gives 11.18 ft. Both errors point the same way: boards ordered short.
  • Angle-method guides with broken trig: one widely copied tutorial finds the rafter by dividing the run by sin(angle), which turns a 10 ft run at 25 degrees into a 23.66 ft “rafter” for a house 20 ft wide. The run is the adjacent side: the divisor is cos(angle), or skip the angle and use Pythagoras.
  • Run-only calculators (Brave Calculator’s common rafter page): clean and correct for run plus pitch, exactly the 11.18 ft answer for the standard example, but there is no span input, no overhang, no ridge adjustment and no count; the framer does three of the four framing inputs by hand.
  • Full framing suites (Simulations4All, Billdr): genuinely broader, with hip and valley geometry, lumber sizing and seat-cut inputs. The cost is a control panel a first-time user has to learn before the first number appears, and spacing defaults (16 inch) that silently differ from the 24 inch assumption many simple roofs are framed at.
  • The gap this page fills: span-first entry in either pitch or rise mode, overhang and ridge handled inside the triangle with the inch conversion stated, a stock length and a per-slope count in the same run, and the count’s one-slope basis printed on the result instead of left ambiguous.

Frequently asked questions

The rise in inches for every 12 inches of horizontal run. A 6:12 pitch rises 6 inches per foot of run, which is an angle of about 26.57 degrees.

Span is the full wall-to-wall width of the building. Run is the horizontal leg of one rafter’s triangle: half the span, plus the eave overhang, minus half the ridge board thickness.

Each rafter stops at the centerline of the ridge board, not at its face. Half the board’s thickness sits beyond the end of the rafter, so half the thickness comes off the run before the length is worked out. On a standard 1.5 inch ridge board the adjustment is 0.75 inches of run.

A two-part notch where the rafter meets the wall: a horizontal seat cut that rests on the top plate and a vertical plumb cut against the wall face. It seats the rafter without changing the line length this calculator returns.

At 24 inch on-center spacing the count is floor(roof length in inches ÷ 24) + 1 per slope. A 30 ft roof gives 16 positions. A gable roof has two slopes, so the board count for common rafters is double the positions, 32, before gable-end and spare allowances.

No. The order length is the calculated rafter length rounded up to the next whole foot, nothing more. It adds no cutting or waste allowance, so if your yard sells 2 ft increments, or you want a spare board for layout mistakes, order the next size up.

The tool works in feet and inches. Convert meters to feet first (1 m = 3.2808 ft) and centimeters to inches (1 in = 2.54 cm); the triangle math itself is unit-agnostic as long as every input uses the converted units.

Common rafters on a symmetrical gable roof only. Hip, valley and jack rafters follow different geometry, and gambrel or mansard roofs change pitch partway down, so none of those can be run through this tool honestly.

Add This Calculator to Your Website

Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.

Powered by Calculator Zilo

References

  1. International Code Council. 2021 International Residential Code, Chapter 8: Roof-Ceiling Construction (rafter span tables R802.4.1, ridge and framing details, heel-joint connections). Accessed October 24, 2026.
  2. American Wood Council. Tutorial for Understanding Loads and Using Span Tables (how live and dead loads feed the joist and rafter span tables). Accessed October 24, 2026.
  3. American Wood Council. Span Tables for Joists and Rafters, 2021 Edition (rafter length conversion diagram and span tables by species, grade and load). Accessed October 24, 2026.
  4. USDA Forest Products Laboratory, Wood Handbook: Wood as an Engineering Material. Chapter 6: Commercial Lumber, Round Timbers, and Ties (nominal versus dressed lumber sizes: 2 inch dimension stock dresses to 1.5 inches). Accessed October 24, 2026.
  5. Los Angeles County Department of Public Works. Wood Frame Prescriptive Provisions handout (roof rafter span tables for Douglas fir-larch No. 2 at common spacings). Accessed October 24, 2026.

Related calculators

Carpentry CalculatorsInches To Fraction Calculator An inches to fraction calculator turns a decimal measurement into the fraction you can actually find on a tape measure or ruler.Carpentry CalculatorsStringer CalculatorA staircase is one right triangle, and the stringer is the board you cut along its hypotenuse.Carpentry CalculatorsBoard Calculator Lumber is priced by volume, but it is sold in named sizes that are not the sizes the wood actually measures.Carpentry CalculatorsCut Length CalculatorCut a board into equal pieces and the last piece keeps coming out a hair short.Carpentry CalculatorsCost Per Board Foot CalculatorTwo lumber quotes can both sound reasonable and still be $40 apart on the same pile of wood, because yards price by the board foot while buyers think in boards.

CalculatorZilo

Free calculators for everything. Accurate, fast, no signup.

Categories

Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

Legal

Privacy Policy Terms and Conditions Disclaimer Cookie Policy DMCA Policy

Company

About Us Contact Us FAQ Accessibility Statement

We use cookies to analyze traffic and to serve ads that keep our calculators free. You can accept or decline cookies below. Learn more

© 2026 CalculatorZilo. All rights reserved.

  • Home
  • Calculators
    • Finance
    • Math
    • Health & Fitness
    • Education
    • Science
    • Real Estate
    • Chemistry
  • About Us
  • Contact Us
Search