Roofing calculator

Rafter Calculator

Calculate roof rafter length, run, rise, rafter count, total lumber, and estimated material cost from your roof dimensions and pitch.

Calculate your rafters

Enter your roof width, roof length, pitch, overhang, and rafter spacing to estimate rafter dimensions and lumber cost.

Choose the measurement system you want to use.
ft
Width of the building from outside wall to outside wall.
ft
Length of the building along the ridge.
/ 12

Not sure of your roof pitch? Calculate your pitch first .

ft
Horizontal overhang beyond the outside wall.
in
Common spacing is 12, 16, or 24 inches on center.
$/ft
Optional. Used to estimate the lumber material cost.
Common rafter length
17.7 ft

About 17 ft 8 in

Horizontal run 16.0 ft
Vertical rise 8.0 ft
Rafter count 31
Rafter spacing 16 in
Total lumber 549.0 ft
Cost per rafter $44.25
Estimated lumber cost $1,371.00
Roof pitch 6/12
Rafter dimensions

Run: 16.0 ft · Rise: 8.0 ft · Length: 17.7 ft

Calculation assumption:

This calculator estimates the geometric length of a common roof rafter using the building width, roof pitch, and horizontal overhang. Rafter count is estimated from roof length and spacing. Actual framing requirements, lumber sizing, cuts, span limits, loads, and structural requirements should be verified against applicable building codes and project specifications.

How to use the rafter calculator

This rafter calculator helps you estimate the length and quantity of common roof rafters before purchasing lumber or planning a roof framing project. You only need a few basic roof measurements.

  1. Enter the building width.
  2. Enter the roof or building length.
  3. Enter the roof pitch, such as 4/12, 6/12, or 8/12.
  4. Enter the horizontal rafter overhang.
  5. Enter your rafter spacing, such as 16 inches on center.
  6. Enter an optional lumber price per linear foot.
  7. Click Calculate rafters.

The calculator estimates the common rafter length, horizontal run, vertical rise, number of rafters, total linear feet of lumber, and estimated material cost.

Rafter length calculator

Rafter length is determined from the horizontal run and vertical rise of the roof. For a simple gable roof, the building width is divided in half to find the basic horizontal run. Any horizontal overhang is then added to the run.

For example, a 30-foot-wide building has a 15-foot half-span. With a 1-foot horizontal overhang, the rafter run is 16 feet.

The roof pitch determines how much the roof rises for every 12 inches of horizontal run. A 6/12 roof rises 6 inches for every 12 inches of run.

How to calculate rafter length

You can calculate rafter length using the Pythagorean theorem. First, calculate the horizontal run and vertical rise. Then use those two measurements to find the sloping rafter length.

Rafter length = √(run² + rise²)

For a roof with a pitch expressed as X/12:

Rise = run × (pitch ÷ 12)

The calculator performs these calculations automatically and displays the result in both decimal feet and feet-and-inches format.

Rafter calculator formula

The basic rafter calculation uses three steps:

  1. Find the run: divide the building width by two and add the horizontal overhang.
  2. Find the rise: multiply the run by the roof pitch divided by 12.
  3. Find the rafter length: use the square root of the run squared plus the rise squared.

Rafter dimensions

Rafter dimensions describe the geometric measurements needed to lay out a common rafter. The most important values are the run, rise, and sloping rafter length.

The run is the horizontal distance from the centerline of the roof to the outside wall, plus any horizontal overhang included in the calculation.

The rise is the vertical distance created by the roof pitch over that run.

The rafter length is the diagonal distance from the upper end of the rafter to the point represented by the calculated run.

Rafter span calculator

A rafter span refers to the distance a structural member must span between its supports. Span is different from the geometric rafter length calculated from roof pitch.

This calculator estimates rafter length from roof geometry. It does not determine whether a particular lumber size is structurally adequate for a given span.

Actual allowable rafter spans depend on factors such as lumber species, grade, lumber size, spacing, roof loads, snow load, dead load, wind conditions, and local building requirements.

How many rafters do I need?

The number of rafters depends mainly on the roof length and the spacing between rafters.

For example, if rafters are installed 16 inches on center, the calculator divides the roof length by the rafter spacing and estimates the number of rafter positions required along the roof.

The actual framing layout can vary depending on end conditions, gable framing, hips, valleys, openings, and the specific roof design.

Rafter lumber cost calculator

The estimated lumber cost is based on the calculated rafter length, number of rafters, and the lumber price you enter.

Total lumber = rafter length × number of rafters
Estimated cost = total lumber × lumber price per linear foot

For example, if the calculator estimates 30 rafters at 18 feet each, the total calculated lumber length is approximately 540 linear feet. At $2.50 per linear foot, the estimated material cost would be $1,350.

This is a material estimate rather than a retail quote. Actual lumber costs vary by lumber size, species, grade, location, supplier, waste, and market prices.

Rafter length in feet and inches

Construction measurements are often expressed in feet and inches rather than decimal feet. For this reason, the calculator displays the rafter length in both formats.

For example, a calculated length of 17.67 feet is approximately 17 feet 8 inches. The decimal value is useful for calculations while the feet-and-inch value is easier to use when working with typical construction measurements.

Common roof pitches and rafter lengths

Roof pitch affects rafter length because a steeper roof creates more vertical rise over the same horizontal run.

For the same building width, increasing the roof pitch increases the rafter length because the vertical rise becomes greater.

What size lumber do I need for rafters?

Rafter length alone does not determine the required lumber size. Structural rafter sizing depends on the actual span and loads carried by the roof.

Factors can include lumber species and grade, rafter spacing, roof covering, snow load, wind load, dead load, live load, deflection limits, support conditions, and local building codes.

Use the calculator to estimate geometric dimensions, but verify the structural design with the applicable building requirements or a qualified building professional.

Frequently asked questions

How do you calculate rafter length?

Calculate the horizontal run and vertical rise first, then use the Pythagorean theorem: rafter length equals the square root of run squared plus rise squared.

How do you calculate rafter length using pitch?

For a roof pitch expressed as X/12, multiply the horizontal run by X divided by 12 to find the rise. Then calculate the diagonal rafter length using the run and rise.

What is the formula for a rafter calculator?

The basic formula is rafter length = √(run² + rise²). For a pitch expressed as X/12, rise = run × X/12.

How many rafters do I need?

Rafter quantity depends on the roof length and rafter spacing. Enter both values into the calculator to get an estimated number of rafter positions.

Does the calculator include rafter overhang?

Yes. Enter the horizontal overhang and it will be added to the horizontal run before calculating the rafter length.

Can I calculate rafter cost?

Yes. Enter your estimated lumber price per linear foot. The calculator uses the estimated rafter length and rafter count to calculate total linear feet and estimated lumber cost.

Can I use meters instead of feet?

Yes. Select meters and centimeters in the measurement unit selector. The calculator converts the measurements internally and displays the results using the selected system.

What is the difference between rafter length and rafter span?

Rafter length is the sloping geometric length of the rafter. Rafter span refers to the distance a structural member spans between its supports. They are related but are not the same measurement.

Does this calculator tell me what size rafter to use?

No. The calculator estimates rafter geometry and lumber quantity. Structural rafter sizing requires additional information about loads, lumber properties, spacing, supports, and applicable building codes.