Roof Pitch & Rafter Length Calculator

Stephanie Ben-Joseph headshot Stephanie Ben-Joseph

Introduction: Why a roof triangle diagram helps

Roof pitch is the quickest way to describe how a roof rises across its span, and this calculator turns that ratio into a triangle you can inspect instead of guess at. Carpenters, architects, and DIY builders all benefit from seeing the run, rise, and rafter length together because small changes in one side immediately show up in the others. As you type new values, the triangle stretches or compresses and the caption reports the updated dimensions. That live feedback makes it easier to understand why a longer run flattens the roof while a greater rise steepens it.

Because the canvas redraws on window resize, the diagram stays readable whether you are checking measurements on a phone at the jobsite or reviewing a roof layout on a larger screen. The caption summarizes the geometry in text form, so screen-reader users and anyone working from a text-only copy still get the same roof-pitch information. The visual element therefore improves understanding without changing the calculation itself.

Formula: How run, rise, and rafter length relate on a roof triangle

A simple gable roof can be modeled as a right triangle, with the horizontal run, vertical rise, and sloped rafter forming its three sides. Denote the horizontal run by R , the vertical rise by V , and the rafter length by L . The Pythagorean theorem gives

Formula: L = sqrt(R^2 + V^2)

L = R 2 + V 2

The pitch ratio expresses steepness as rise over run. For building codes in imperial units this is often converted to a per‑twelve value: P = V R × 12 . The slope angle θ comes from trigonometry:

Formula: θ = arctan V / R

θ = arctan V R

These formulas feed the calculator’s logic. When you submit the form, the script computes the pitch, angle, rafter length, and slope percentage. The canvas uses the same numbers to scale the triangle so the algebra and the drawing stay aligned.

Worked example: a 3 m run and 1.5 m rise

A common roofing question is what rafter length comes from a known run and rise. For a workshop with a 3 m half-span and a 1.5 m rise, enter those values and press Compute. The result box shows a pitch of 6:12, an angle of about 26.6°, and a rafter length of 3.35 m. On the canvas the base extends three units while the vertical leg climbs one and a half units, so the sketch matches the proportions of the numbers you entered. If you double the rise to 3 m, the triangle becomes equilateral, the pitch increases to 12:12, and the angle reaches 45°.

That kind of visual jump is useful when you are deciding whether a roofline feels too flat or too steep. It also helps when material limits matter. If you know you are limited to 3.6 m lumber, adjust the run and rise until the displayed rafter length fits before you cut anything. Seeing the triangle cross the limit is easier to act on than trying to infer the same warning from formulas alone.

Roof pitch scenario comparison table

Use the roof pitch scenario table below as a quick way to compare a shallow roof, a moderate roof, and a steeper roof. Each row lists the run, rise, pitch, angle, and rafter length, so you can type the numbers into the form and watch the canvas change shape.

Run (m) Rise (m) Pitch (rise:12) Angle (°) Rafter (m)
2 0.5 3:12 14.0 2.06
3 1.5 6:12 26.6 3.35
4 3 9:12 36.9 5.00

These scenarios show how quickly the rafter length grows once the rise gets larger. Typing each row into the form gives you a fast reality check before you start framing, especially when you want to compare a low-slope shed roof with a more aggressive gable.

How to Interpret the Roof Triangle Diagram

The roof triangle diagram places the run along the bottom edge. A blue horizontal line represents the run, a green vertical line denotes the rise, and a black diagonal shows the rafter. A small square at the junction marks the right angle, while labels identify each side. Distances are scaled so the triangle fills most of the canvas regardless of the absolute dimensions. The caption repeats the run, rise, angle, and rafter length in text so you can confirm the visual reading.

Because the drawing updates with every keystroke, it works well as a quick design sandbox. If the triangle looks too flat, increase the rise; if it looks too steep, lengthen the run. Resizing the browser triggers a redraw, so the proportions remain accurate on phones, tablets, and desktop screens. That makes the diagram a dependable check while you are sketching a shed, verifying a gable, or talking through a layout on site.

Roof framing limitations and real-world adjustments

This roof pitch calculator models an ideal right triangle and does not account for ridge board thickness, birdsmouth cuts, or overhangs. In practice, carpenters often subtract half the ridge thickness from the run and adjust the rafter length to suit the wall plate and seat cut. Snow loads, wind forces, and material defects also affect the final framing plan. Even so, the triangle gives you a solid starting point before those details are added.

Real roofs can include hips, valleys, or dormers that make the geometry more complicated. This page stays focused on a single slope, but the same trigonometric ideas still apply when you move on to those features. Once you understand the basic run-rise triangle, it becomes easier to reason about diagonal projections and longer hip rafters.

Conclusion: Comparing roof pitch, angle, and rafter length

Using roof pitch, slope angle, and rafter length together makes it easier to compare framing options without losing sight of the geometry. Enter different runs and rises, watch the roof triangle redraw, and use the table and caption to confirm that the numbers match the shape you want. The visualization keeps the calculations from feeling abstract and gives you a quick check before you build.

Extend your planning by estimating loads with the Roof Snow Load Calculator, budgeting materials using the Roofing Shingle Calculator, or exploring insulation impacts through the Roof Insulation Payback Calculator. Together these tools cover the structural, material, and efficiency sides of a roofing project.

How to use this calculator for roof pitch and rafter length

  1. Enter Horizontal Run (m) as the horizontal span the roof rises across.
  2. Enter Vertical Rise (m) as the height gained over that run.
  3. Run the calculation, then try a second run-and-rise combination to see how the pitch and rafter length change before you commit to a framing decision.

Arcade Mini-Game: Roof Pitch & Rafter Length Calculator Calibration Run

Use this quick arcade run to practice spotting roof pitch setup mistakes, such as swapping run and rise or entering zero values, before you rely on the calculator output.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.

Enter run and rise values to compute roof pitch and rafter length.
The roof triangle will appear here, scaled to the run and rise you enter.