# How long are my rafters?

Computes common rafter length from the building span, roof pitch, ridge board and overhang, with the rise, roof angle, lumber length to buy and how many rafters you need.

- Page: https://www.acalculator.org/construction/rafter-calculator
- JSON spec: https://www.acalculator.org/construction/rafter-calculator.json
- Version: 32d37d711576

## Default answer

Example with the default inputs (Building span 24 ft, Roof pitch (in 12) 6, Overhang 12 in, Ridge board thickness 1.5 in, Building length 40 ft, Rafter spacing 16 in): Each rafter is 14.46 ft long (buy 16 ft boards); you need 62 rafters.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| span | Building span | The width of the building, outside of wall to outside of wall. |
| pitch | Roof pitch (in 12) | Inches of rise for every 12 inches of run, for example 6 for a 6/12 roof. |
| oh | Overhang | How far the eave sticks out past the wall, measured level. |
| ridge | Ridge board thickness | The thickness of the ridge board; 1.5 in for a 2× board. 0 for none. |
| len | Building length | The length of the wall the rafters sit along. |
| oc | Rafter spacing | The distance from the center of one rafter to the next. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| rafterFt | Rafter length (ft) | The length along the slope, ridge to tail, in feet. |
| rafterM | Rafter length (m) | The same length in metres. |
| rafterIn | Rafter length (in) | The same length in inches. |
| buy | Board length to buy (ft) | The rafter length rounded up to the next even foot. |
| count | Rafters | Rafters on both sides of the ridge. |
| riseFt | Rise (ft) | How high the roof rises over the run: run × pitch ÷ 12. |
| riseM | Rise (m) | The rise in metres. |
| runFt | Run (ft) | Half the span minus half the ridge board, in feet. |
| angle | Roof angle (°) | The angle of the roof above level: arctan(pitch ÷ 12). |
| factor | Slope factor | Rafter length per unit of run: √(12² + pitch²) ÷ 12. |

## Method

Run = (span − ridge) ÷ 2; slope factor = √(12² + pitch²) ÷ 12; rafter = (run + overhang) × slope factor; rise = run × pitch ÷ 12; angle = arctan(pitch ÷ 12); rafters = 2 × (⌈building length ÷ spacing⌉ + 1).

## Assumptions

- Common rafters from the ridge board to the tail, measured along the top edge (the line length); no bird’s mouth or plumb-cut allowance.
- The overhang is measured level, from the outside of the wall.
- Boards are sold in 2 ft steps (Kreg Tool: 6 to 20 ft in 2 ft increments); longer rafters may need a special order.
- Spacing is 16 in on center by default, with one rafter at each end of each side.

## Worked examples

1. span = 7.3152, pitch = 5, oh = 0, ridge = 0, len = 12.192, oc = 0.4064 gives factor = 1.083333, rafterFt = 13, buy = 14, riseFt = 5, count = 62. Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem.
2. span = 7.3152, pitch = 6, oh = 0.3048, ridge = 0.0381, len = 12.192, oc = 0.4064 gives runFt = 11.9375, rafterFt = 14.464565, buy = 16, angle = 26.565051. Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem; Kreg Tool, Ultimate Guide to Lumber Dimensions (2× lumber is 1.5 in thick; lengths in 2 ft steps). https://learn.kregtool.com/learn/understand-lumber-sizing/.
3. span = 8, pitch = 9, oh = 0.5, ridge = 0.04, len = 10, oc = 0.6 gives factor = 1.25, rafterM = 5.6, riseM = 2.985, count = 36. Source: Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem.

## FAQ

### How do I calculate rafter length?

A rafter is the long side of a right triangle whose legs are the run and the rise. Rafter = run × √(12² + pitch²) ÷ 12. For a 24 ft span at 5/12 the run is 12 ft and the rise 5 ft, so the rafter is √(144 + 25) = 13 ft.

### What is the run of a rafter?

The level distance the rafter covers: half the building span, minus half the ridge board’s thickness. A 24 ft span with a 1.5 in ridge board has a run of 12 ft − 0.75 in = 11.9375 ft.

### What does a 6/12 pitch mean?

The roof rises 6 inches for every 12 inches it runs. Its slope factor is √(12² + 6²) ÷ 12 = 1.118, so each foot of run needs 1.118 ft of rafter, and the roof angle is arctan(6 ÷ 12) = 26.57°.

### How do I add the overhang?

Add the level overhang to the run before you multiply by the slope factor. A 12 in overhang at 6/12 adds 1 × 1.118 = 1.12 ft of rafter.

### How many rafters do I need?

Divide the building length by the spacing, round up, and add one for the end; then double it for both sides. A 40 ft wall at 16 in on center needs 40 × 12 ÷ 16 = 30, plus 1 = 31 per side, 62 in all.

### What length of lumber should I buy?

Round the rafter length up to the next even foot, because dimensional lumber is sold in 2 ft steps. A 14.46 ft rafter needs a 16 ft board. Kreg Tool lists lengths from 6 to 20 ft; longer boards may need a special order.

## Sources

- OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem. https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem (retrieved 2026-10-01)
- Kreg Tool, Ultimate Guide to Lumber Dimensions: Actual vs Nominal Sizes (a nominal 2× board is 1.5 in thick; most dimensional lumber comes in 6 to 20 ft lengths in 2 ft increments). https://learn.kregtool.com/learn/understand-lumber-sizing/ (retrieved 2026-10-01)
- NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement: 1 ft = 12 in = 0.3048 m. https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-01)
