Rafter Calculator

rafter calculator
Rise and RunPitch and RunAngle and Run
Results:
Total Rafter Length:
Roof Angle: °
Roof Pitch: / 12
Theoretical Rafter:
function updateLabels(){var mode=document.getElementById('calc_mode').value;var lbl=document.getElementById('label_input2′);if(mode==='rise_run'){lbl.innerHTML='Total Rise (ft):';}else if(mode==='pitch_run'){lbl.innerHTML='Pitch (in per 12in):';}else{lbl.innerHTML='Angle (degrees):';}}function calculateRafter(){var run=parseFloat(document.getElementById('run_input').value);var val2=parseFloat(document.getElementById('input2').value);var overhang=parseFloat(document.getElementById('overhang').value)||0;var ridge=parseFloat(document.getElementById('ridge').value)||0;var mode=document.getElementById('calc_mode').value;if(isNaN(run)||isNaN(val2)){alert('Please enter valid numeric values for Run and the secondary dimension.');return;}var rise,angle,pitch;if(mode==='rise_run'){rise=val2;angle=Math.atan(rise/run);pitch=(rise/run)*12;}else if(mode==='pitch_run'){pitch=val2;angle=Math.atan(pitch/12);rise=(pitch/12)*run;}else{angle=val2*(Math.PI/180);pitch=Math.tan(angle)*12;rise=Math.tan(angle)*run;}var theoreticalLength=Math.sqrt(Math.pow(run,2)+Math.pow(rise,2));var adjRun=run-(ridge/2/12);var adjRise=(adjRun/run)*rise;var adjLength=Math.sqrt(Math.pow(adjRun,2)+Math.pow(adjRise,2));var overhangRun=overhang/12;var overhangLength=overhangRun/Math.cos(angle);var totalLength=adjLength+overhangLength;document.getElementById('totalLen').innerHTML=totalLength.toFixed(3)+' ft ('+toFeetInches(totalLength)+')';document.getElementById('angleVal').innerHTML=(angle*(180/Math.PI)).toFixed(2);document.getElementById('pitchVal').innerHTML=pitch.toFixed(2);document.getElementById('theoVal').innerHTML=theoreticalLength.toFixed(3)+' ft';}function toFeetInches(val){var feet=Math.floor(val);var inches=((val-feet)*12).toFixed(2);return feet+"' "+inches+'"';}

Using the Rafter Calculator

A rafter calculator is an essential tool for carpenters, DIY builders, and architects. It eliminates the guesswork involved in calculating the precise length of common rafters, ensuring that your roof structure is stable and fits perfectly onto your ridge board and wall plates.

To use this calculator effectively, you will need to provide the horizontal distance (Run) and one other measurement such as the vertical height (Rise) or the roof's pitch. The tool then applies the Pythagorean theorem and trigonometric adjustments to give you the "cut length" required for the wood.

Total Run
The horizontal distance from the outside of the wall plate to the center of the ridge board. This is usually half of the total span of the building.
Total Rise
The vertical height from the top of the wall plate to the top of the ridge. This determines the steepness of the roof.
Pitch
Represented as the number of inches the roof rises for every 12 inches it runs (e.g., a 6/12 pitch).
Overhang
The distance the rafter extends past the exterior wall, creating the eaves of the house.

How It Works: The Rafter Formula

Rafter calculation is based on right-angle geometry. The rafter itself forms the hypotenuse of a triangle where the base is the Run and the height is the Rise. However, real-world construction requires two major adjustments that this rafter calculator handles for you:

Rafter Length = √(Run² + Rise²) + Overhang Adjustment – Ridge Adjustment

  • The Pythagorean Theorem: Basic length is calculated as the square root of (Run squared + Rise squared).
  • Ridge Adjustment: Since the rafter meets a ridge board (often 1.5 inches thick), half of that thickness must be subtracted from the run before calculating the length.
  • Overhang Length: This is calculated by dividing the overhang run by the cosine of the roof angle.

Calculation Example

Example Scenario: You are building a shed with a total span of 20 feet. You want a 6/12 pitch and a 12-inch overhang. You are using a standard 2x ridge board (1.5 inches thick).

Step-by-step solution:

  1. Identify Run: Total Span is 20ft, so Run = 10ft.
  2. Calculate Rise: At a 6/12 pitch, Rise = 10 * (6/12) = 5ft.
  3. Determine Angle: Angle = arctan(6/12) ≈ 26.57°.
  4. Ridge Adjustment: Subtract 0.75 inches (half of 1.5″) from the 10ft run. Adjusted Run = 9.9375ft.
  5. Calculate Adjusted Length: √(9.9375² + 4.96875²) ≈ 11.11ft.
  6. Calculate Overhang: 12 inches / cos(26.57°) ≈ 13.42 inches (1.118ft).
  7. Total Cut Length: 11.11ft + 1.118ft = 12.228ft (approximately 12′ 2-3/4″).

Common Questions

What is a Birdsmouth Cut?

A birdsmouth cut is a notch made in the rafter so it can sit flat on the wall plate. While this calculator provides the total length, you must manually mark the birdsmouth based on the "HAP" (Height Above Plate) required for your specific lumber size.

Does pitch affect rafter strength?

Yes. Steeper pitches generally handle snow loads better but increase the surface area of the roof, which can increase wind resistance. Always consult local building codes for the minimum required pitch and rafter spacing for your area.

What is the difference between Span and Run?

Span is the total distance between the outside edges of the supporting walls. Run is typically half of the span (for a standard gable roof), representing the horizontal distance a single rafter covers.

Leave a Comment