Rafter Length Calculator · Rise, Run, Pitch & Truss Count

Rafter Length Calculator

Rafter length & truss count from rise, run, pitch and spacing

I want to calculate…
Rafter Calculation Diagram
king post RAFTER Rise Run Span θ
Rafter runs from the ridge apex to the eave · Rise is vertical height · Run is half the building span · θ is the pitch angle.
Roof Details
Run is half the building span (ridge center to outer wall). Pitch can be entered as X:12 ratio or degrees.
Truss Details
Truss count = ⌈Roof length ÷ Spacing⌉ + 1. Spacing is measured on-center; typical values are 24 in (61 cm) or 16 in (41 cm).
Results
✅ Standard Pitch
Rafter Length
—
—
Rise
—
Run
—
Rafter length
—
Pitch
—
📋 Summary
Enter the roof dimensions to see the rafter length and truss count.
Trusses needed
—
Spacing
—
Roof length
—
Rafter + overhang
—
📊 Rafter Quick Reference
Item
Typical Value
Notes
Rafter length
√(Rise² + Run²)
Pythagorean theorem.
Pitch
4:12 – 12:12
18°–45° for residential roofs.
Run
Half of building span
Ridge center to outer wall.
Truss spacing
16 in or 24 in OC
40 cm or 61 cm common.
Overhang
12–24 in (30–60 cm)
Eave projection.
Truss count
⌈Length ÷ Spacing⌉ + 1
Plus 1 for a closed end.
Rafter angle
= pitch angle
Same at top and bottom cuts.
Estimate only. Confirm actual dimensions, span ratings and code requirements with your truss manufacturer before ordering.

Powered by Toolraxy

\n'; var escaped = toolHtml.replace(/&/g, '&').replace(/"/g, '"'); embedCodeTextarea.value = ''; }window.toggleEmbedPanel = function () { if (embedPanel.style.display === 'none' || embedPanel.style.display === '') { generateEmbedCode(); embedPanel.style.display = 'block'; } else { embedPanel.style.display = 'none'; } };window.copyEmbedCode = function () { embedCodeTextarea.select(); if (navigator.clipboard) { navigator.clipboard.writeText(embedCodeTextarea.value).then(function () { alert('Embed code copied!'); }).catch(function () { alert('Press Ctrl+C'); }); } else { alert('Press Ctrl+C'); } };/* ─────────── Events ─────────── */ function bindAll() { [riseInput, runInput, pitchInput, roofLengthInput, spacingInput, overhangInput, extraTrussInput].forEach(function (el) { el.addEventListener('input', calculate); el.addEventListener('change', calculate); });pitchUnitType.addEventListener('change', function () { var prevVal = parseFloat(pitchInput.value); if (!isFinite(prevVal)) return; if (this.value === 'deg') { var deg = Math.atan(prevVal / 12) * R2D; pitchInput.value = roundVal(deg, 2); } else { var ratio = Math.tan(prevVal * D2R) * 12; pitchInput.value = roundVal(ratio, 2); } updatePitchLabel(); calculate(); });document.querySelectorAll('input[name="calcMode"]').forEach(function (el) { el.addEventListener('change', function () { updateCalcMode(); calculate(); }); });document.querySelectorAll('input[name="knowMode"]').forEach(function (el) { el.addEventListener('change', function () { updateKnowMode(); calculate(); }); });attachUnitConversion(riseInput, riseUnit); attachUnitConversion(runInput, runUnit); attachUnitConversion(roofLengthInput, roofLengthUnit); attachUnitConversion(spacingInput, spacingUnit); attachUnitConversion(overhangInput, overhangUnit); }if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { bindAll(); updateCalcMode(); updateKnowMode(); calculate(); }); } else { bindAll(); updateCalcMode(); updateKnowMode(); calculate(); }})();

Creator & Maintainer

Image of Faiq Ur Rahman, CEO & Founder Toolraxy

Faiq Ur Rahman

Founder & CEO, Toolraxy

Faiq Ur Rahman is a web designer, digital product developer, and founder of Toolraxy, a growing platform of web-based calculators and utility tools. He specializes in building structured, user-friendly tools focused on health, finance, productivity, and everyday problem-solving.

Share:

Rate this Tool

User Ratings:

0
0 out of 5 stars (based on 0 reviews)
Excellent
Very good
Average
Poor
Terrible

ADVERTISEMENT

ADVERTISEMENT

Introduction

Cutting a rafter is a one-shot operation. Once the birdsmouth is notched and the plumb cut is made, there is no putting timber back so the length has to be right before the saw comes out. That length is the hypotenuse of a right triangle formed by the rise from plate to ridge and the run from ridge to outer wall, and getting it wrong usually traces back to one of two things: confusing run with span, or working in mixed units. This calculator takes the measurements you already have and produces the rafter length directly, along with the pitch angle you will need for the plumb cuts at both ends. It is used by carpenters laying out a cut list, owner-builders checking a truss supplier’s drawings, and anyone replacing a damaged rafter on an existing roof where the original dimensions are no longer legible.

 

How to Use the Rafter Length Calculator

  1. Choose the calculation mode, Rafter length for a single rafter, or Truss count for a full roof schedule.

  2. Under Roof Details, select which two values you can supply: Rise & Run, Rise & Pitch, or Run & Pitch.

  3. Fill in the two fields that appear, selecting the correct unit for each.

  4. Set the pitch unit to :12 for a ratio or ° for degrees, matching your drawings.

  5. If you switched to truss mode, enter the Roof length measured along the eaves.

  6. Set the Truss spacing from your design, 400 mm and 600 mm are the common metric values.

  7. Add the Overhang where the rafter projects past the wall, plus any extra trusses for hips or gable ends.

  8. Read the rafter length or truss count in the hero display, with rise, run and pitch listed below.

 

How the Rafter Length Calculator Formula Works

The rafter is the hypotenuse of a right triangle whose other two sides are the rise and the run. Every other figure on the page is derived from that single relationship or from the pitch angle that the triangle defines.

Formula: Rafter Length = √(Rise² + Run²)
Formula: Pitch Angle θ = atan(Rise ÷ Run)
Formula: Pitch Ratio = tan(θ) × 12
Formula: Building Span = 2 × Run
Formula: Truss Count = ⌈Roof Length ÷ Spacing⌉ + 1
Formula: Rafter with Overhang = Rafter Length + Overhang ÷ cos(θ)

Whichever two values you supply, the third is computed first, then the rafter length follows. Rise and run must both be greater than zero when they are the two known values, and pitch must fall between 0° and 89°. In truss mode, roof length and spacing must be positive, and the count always rounds up before adding the closing truss.

 

Worked Example

A carpenter is replacing a rafter on a gable roof where the pitch is known to be 7:12 and the run measures 3.6 m from ridge to outer wall. The existing rafter has a 500 mm eave overhang.

  • Pitch angle = atan(7 ÷ 12) = 30.26°

  • Rise = 3.6 × tan(30.26°) = 3.6 × 0.5833 = 2.10 m

  • Rafter length = √(2.10² + 3.6²) = √(4.41 + 12.96) = 4.17 m

  • Building span = 2 × 3.6 = 7.2 m

  • Pitch ratio confirmed = tan(30.26°) × 12 = 7.00:12

  • Slope overhang = 0.5 ÷ cos(30.26°) = 0.5 ÷ 0.8634 = 0.58 m

  • Total cut length = 4.17 + 0.58 = 4.75 m

The takeaway: this rafter needs 4.17 m of length from ridge to plate, and 4.75 m in total once the eave overhang is added along the slope. Note that the overhang contribution is larger than the horizontal projection, 0.58 m rather than 0.50 m  because the extra length is measured along the incline, not across the ground.

Frequently Asked Questions

What is the formula for rafter length?

Rafter length equals the square root of the rise squared plus the run squared. It is the Pythagorean theorem applied to the right triangle formed by the rise from plate to ridge, the run from ridge to wall, and the rafter itself.

 

Do I measure the run or the span?

Measure the run, the horizontal distance from the ridge centreline to the outer face of the wall. It is half the building’s width on a symmetrical gable. Using the full span instead doubles the calculated rafter length.

 

How do I convert a 5:12 pitch to degrees?

Take the arctangent of 5 divided by 12. The result is 22.62°. A 4:12 pitch is 18.43°, a 6:12 is 26.57°, and an 8:12 is 33.69°. The calculator performs this conversion automatically when the pitch unit is changed.

 

Does the rafter length include the overhang?

No. The rafter length runs from the ridge plumb cut to the outer edge of the wall plate. The overhang is a separate addition, projected along the slope by dividing the horizontal overhang by the cosine of the pitch angle. Add the two for the total cut length.

 

Why does my rafter need to be longer than the calculated length?

Because the calculation gives the theoretical length from ridge to plate. In practice you need extra for the ridge board thickness, for the overhang, and for any birdsmouth that removes material from the underside. Most carpenters add 50 to 100 mm of margin and trim to fit.

 

How do I account for the ridge board?

The run should be measured to the centreline of the ridge board, not to the far face. If the ridge is a 50 mm board, the effective run for each rafter is reduced by 25 mm. The calculator assumes you have measured the run correctly; adjust your measurement rather than the result.

 

What is the standard pitch for a house roof?

In North America, 6:12 (26.57°) is the most common residential pitch, with 4:12 and 8:12 also widely used. European roofs tend to run slightly steeper. Pitches below 4:12 restrict the roofing materials that can be used.

 

Can I use this calculator for a hip rafter?

The common rafter length calculation is the same for hip and gable roofs. Hip rafters are longer because they run diagonally to the corner of the building, and their length is calculated separately using the hip run, which is the diagonal of the half-span rectangle.

 

What happens if I enter the pitch in degrees instead of a ratio?

The calculator handles both. When the unit selector is set to degrees, the value is used directly as the pitch angle. When it is set to :12, it is converted using the arctangent before use. Switching between the two converts the existing value so the physical pitch stays the same.

 

How much does the pitch change the rafter length?

A steeper pitch increases the rafter length for the same run. Going from a 4:12 to a 8:12 pitch on a 4 m run lengthens the rafter from 4.22 m to 4.72 m, roughly half a metre, or about 12 percent.

 

Can I cut rafters without a framing square?

Yes, but the framing square is the traditional way to lay out the plumb cuts at the correct pitch. Without one, you can use the pitch angle in degrees and a protractor, or cut a template rafter and use it to mark the rest.

 

Does this tool work for metric rafter sizes?

Fully. Every length field accepts millimetres, centimetres, metres, inches or feet, and pitch can be entered as a ratio or in degrees. The output echoes back in the unit used for the run, so a metric layout stays metric throughout.

Disclaimer

This rafter length calculator provides geometric dimensions for planning and cutting purposes only. It does not perform structural design, does not verify rafter sizing against span tables, and does not account for snow, wind or seismic loads. Rafter dimensions depend on span, spacing, species, grade and load, none of which are captured here. Always confirm the rafter specification against the applicable building code and, where the roof spans a habitable space or carries an unusual load, consult a qualified engineer before cutting or installing material.

ADVERTISEMENT

ADVERTISEMENT