Rafter Spacing Calculator

Rafter Spacing Calculator

Calculate the number of rafters needed based on building length, rafter spacing, and roof type.

Enter Rafter Measurements

ft
Length along the ridge or along the wall for a shed roof.
in O.C.
Distance from the center of one rafter to the next.
Gable roofs have two sloped sides; shed roofs have one.

Rafter Spacing Calculation Results

Total Rafters Required —
Rafters Per Side —
Actual Spacing —
Spacing Bays —
Building Length —
Selected Spacing —
Roof Type —
Note: This calculator provides a rafter layout/count estimate. It does not determine whether a particular rafter size or spacing is structurally adequate for your roof.

How to Use the Rafter Spacing Calculator

1

Enter the Building Length

Enter the length of the building in feet. For a typical gable roof, this is the length along the ridge where the rafters will be laid out.

2

Select Rafter Spacing

Choose the desired rafter spacing in inches on-center (O.C.). Common options include 12, 16, 19.2, and 24 inches O.C.

3

Select the Roof Type

Choose Gable Roof for two roof slopes or Shed Roof for a single roof slope.

4

Calculate the Rafter Count

Click Calculate to see the estimated total number of rafters, rafters per side, actual spacing, and spacing bays.

What Is Rafter Spacing?

Rafter spacing is the distance between adjacent roof rafters, normally measured from the center of one rafter to the center of the next. This measurement is commonly called on-center (O.C.) spacing.

Rafter spacing determines how many rafters are needed along a building's length. Closer spacing requires more rafters, while wider spacing requires fewer rafters for the same building length.

Common spacing choices include 12 inches, 16 inches, 19.2 inches, and 24 inches on-center. The appropriate spacing depends on the rafter size, lumber characteristics, roof loads, sheathing requirements, and local construction requirements.

Rafter Spacing Formula

The basic rafter spacing calculation starts by converting the building length into inches and dividing it by the selected spacing.

Rafters Per Side = Ceiling(Building Length ÷ Rafter Spacing) + 1

For a gable roof, the result is multiplied by two because there are rafters on both roof slopes.

Gable Roof Total Rafters = Rafters Per Side × 2

For a shed roof, there is only one sloping roof plane, so the number of rafters is not doubled.

Shed Roof Total Rafters = Rafters Per Side

What Does This Rafter Spacing Calculator Calculate?

Total Rafters Required

Estimates the total number of rafters required based on the building length, selected spacing, and roof type.

Rafters Per Side

Shows the number of rafter positions required along one side of the roof.

Actual Spacing

Shows the selected on-center spacing used for the calculation.

Spacing Bays

Shows the number of spaces between the rafter positions along the building length.

Building Length

Displays the building length used in the calculation.

Roof Type

Identifies whether the calculation uses a gable roof or a shed roof.

Rafter Spacing Calculation Example

Suppose a building is 40 feet long and the selected rafter spacing is 16 inches O.C. For a gable roof, the calculator determines the rafter positions for one side and then doubles the result for both roof slopes.

Measurement Example
Building Length 40 ft
Rafter Spacing 16 in O.C.
Spacing Bays 30
Rafters Per Side 31
Gable Roof Total 62 rafters

For a shed roof using the same 40-foot length and 16-inch spacing, the estimated total would be 31 rafters because only one roof slope is being framed.

Common Rafter Spacing: 12, 16, 19.2 & 24 Inches

12" O.C.

Closer spacing that places more rafters along the building length. It may be considered where tighter framing is required.

16" O.C.

A very common residential framing spacing and a useful starting point for estimating rafter quantities.

19.2" O.C.

A less common spacing option that can be useful for certain framing and panel-layout applications.

24" O.C.

Wider spacing uses fewer rafters, but the structural requirements and sheathing requirements must be checked for the specific roof.

Rafter Spacing for Gable vs. Shed Roofs

Gable Roof

A gable roof has two sloping roof surfaces that meet at a ridge. The rafter positions are therefore required on both sides of the building.

Total rafters = rafters per side × 2

Shed Roof

A shed or lean-to roof has one continuous sloping roof surface. Rafters are installed across only one roof plane.

Total rafters = rafters per side

Rafter Spacing vs. Rafter Size

Rafter spacing and rafter size are related, but they are not the same measurement. Spacing describes how far apart the rafters are installed, while rafter size describes the dimensions and structural capacity of the individual lumber member.

Increasing the distance between rafters can increase the load carried by each rafter and can also affect the required roof sheathing. Therefore, selecting 24-inch O.C. spacing simply because it requires fewer rafters does not automatically mean it is suitable for a particular roof.

Rafter size and spacing should be checked against the actual roof span, lumber species and grade, snow and wind loads, roofing materials, sheathing requirements, and applicable local building requirements.

Understanding On-Center (O.C.) Spacing

On-center spacing means measuring from the centerline of one rafter to the centerline of the next rafter. For example, 16-inch O.C. spacing means the centers of adjacent rafters are 16 inches apart.

16" O.C. = 16 inches from the center of one rafter to the center of the next

O.C. spacing is different from measuring the clear gap between the edges of two rafters. The actual clear opening depends on the width of the lumber being used.

Rafter Spacing Measurements and Units

Building Length

Enter the building length in feet.

Rafter Spacing

Spacing is entered in inches on-center (O.C.).

Gable Roof

Rafters are counted for both roof slopes.

Shed Roof

Rafters are counted for one roof slope.

Important Information

This Rafter Spacing Calculator provides a convenient estimate of rafter quantity and layout based on the building length and selected O.C. spacing.

The result is not a structural engineering calculation and does not determine whether a particular rafter size or spacing is safe for a specific building.

Actual framing requirements can vary because of roof span, lumber species and grade, snow and wind loads, roofing materials, sheathing, roof openings, gable-end conditions, doubled rafters, hips, valleys, dormers, and local building requirements.

Always verify the final framing layout and structural requirements with appropriate span tables, building plans, or a qualified professional where required.

Frequently Asked Questions

How many rafters do I need for a 40-foot building at 16" O.C.?

Using the basic spacing calculation, a 40-foot building requires approximately 31 rafter positions per side at 16-inch O.C. spacing. A gable roof would therefore have approximately 62 rafters, while a shed roof would have approximately 31.

What is the most common rafter spacing?

16 inches on-center is a common rafter spacing used in residential framing. However, the correct spacing depends on the particular roof, materials, loads, and applicable construction requirements.

Does wider rafter spacing mean fewer rafters?

Yes. Increasing the spacing between rafters generally reduces the number of rafters required for the same building length.

What does 16 inches O.C. mean?

16 inches O.C. means the center of one rafter is 16 inches from the center of the next rafter.

Does a gable roof need twice as many rafters?

For this calculator's basic layout method, yes. The rafter positions are counted for each of the two roof slopes, so the per-side count is doubled for a gable roof.

Does a shed roof use the same rafter count?

A shed roof has one sloping roof plane, so the calculator uses the rafter-position count once rather than doubling it.

Does rafter spacing determine rafter size?

No. Rafter spacing is only one factor in determining framing requirements. Rafter size also depends on span, lumber properties, loads, roof materials, and other project conditions.

Related Calculators

Explore More Roofing Calculators

Use our other free roofing calculators to check roof measurements, geometry, rafter dimensions, and related calculations.

Scroll to Top