Rafter Calculator

By Shivam · Last updated

Use this free rafter calculator to find the length of a common rafter from your roof pitch and building width, plus the plumb and seat cut angles, ridge height, birdsmouth limit, and how many rafters you need. Tap the i button beside any field for a plain-English explanation. Part of our roofing calculators.

Quick answer: rafter length = (half the span + overhang) × √(1 + (pitch ÷ 12)²). For a 24-foot-wide building with a 6:12 roof and no overhang, that is 12 × 1.118 = 13.42 feet.

Calculate your rafter length

i
Pick how you describe the roof steepness. Most plans give a pitch such as 6:12. If you measured an angle with a digital level, choose angle.
i
Gable has two sloping sides that meet at a ridge, so each rafter covers half the width. Shed (one slope) has a single slope, so each rafter covers the full width and there is no ridge board.
i
Enter the first number of a pitch such as 6:12. The second number is always 12 here. Not sure of your pitch? Use our roof pitch calculator first.
i
Used for every length you enter and every length shown. Pitch and angles do not depend on the unit.
i
The full width of the building between the outside faces of the walls the rafters sit on. Required for the rafter length.
i
How far the rafter tail extends past the wall, measured horizontally. Leave 0 for no overhang.
i
Gable roofs only. Thickness of the ridge board. Half of it is deducted from each rafter because the rafter stops at the face of the ridge. Use 0 for a ridge beam or if you prefer to trim on site.
i
The depth of your rafter board, for example 7.25 for a 2×8 (actual size in inches). Used for the maximum birdsmouth depth. Enter it in the same unit as above.
i
The length of the roof along the ridge. With the spacing below it gives the number of rafters.
i
The distance from the centre of one rafter to the centre of the next. 16 in or 24 in is typical in the US. Use the same unit as above.
Enter your roof pitch and building width, then press Calculate. Your rafter length, cut angles, and a diagram will appear here.
Common rafter length (with overhang)
Span Rise Rafter 0
Roof pitch
Roof angle
Length, no overhang
Overhang along slope
Ridge height (rise)
Plumb cut angle
Seat cut angle
Max birdsmouth depth
Stock length to buy
Rafters needed

Rafter length at other pitches (same span)

Estimates for planning only. Confirm measurements on site and follow your local building code. This tool does not size rafters for load; see the span section below. See our Disclaimer.

What a rafter calculator does

A rafter is the sloped board that runs from the top of a wall up to the ridge and carries the roof. Cutting one too short is an expensive mistake, and cutting one too long wastes a good piece of lumber. A rafter calculator turns two things you already know, the building width and the roof pitch, into the length of the board you need to cut.

This tool goes a bit further than a bare length. It also gives the cut angles for both ends, the ridge height, a rough limit for the birdsmouth notch, and the number of rafters for a given spacing. A diagram redraws as you type, and a small chart shows how the length changes at other pitches, which helps if you are still choosing between, say, a 5:12 and a 7:12 roof. If you do not know your pitch yet, start with the roof pitch calculator, then come back here. Once you have the framing sorted, the roof calculator gives you roof area and shingle quantities.

How to calculate rafter length

If you want to calculate rafter length by hand, the idea is a right triangle. Half the building width is the horizontal run, the height of the ridge above the wall is the rise, and the rafter is the sloped side. That makes it a Pythagorean problem:

  • Run = half the span (minus half the ridge thickness, if you use a ridge board)
  • Rise = run × (pitch ÷ 12)
  • Rafter length = √(run² + rise²)

A shortcut gives the same answer: multiply the run by √(1 + (pitch ÷ 12)²). That square root is the same area multiplier used on our roof pitch calculator, so a 6:12 roof always has a factor of 1.118.

Worked example

Take a building 24 feet wide with a 6:12 roof. The run is 12 feet. The rise is 12 × 0.5 = 6 feet. The rafter length is √(12² + 6²) = √180 = 13.42 feet. That is the length along the top edge of the rafter from the ridge to the outside face of the wall, before any overhang. Enter 6 for the pitch and 24 for the width to check it.

How to calculate rafter length using pitch

Pitch enters the formula through one number, the multiplier. Each pitch has a fixed factor, so once you know it, finding the rafter length is a single multiplication by the run. The table below applies it to a 24-foot span with no overhang or ridge board, so you can see what a steeper roof costs in lumber.

PitchMultiplierRafter length (24 ft span)
3:121.03112.37 ft
4:121.05412.65 ft
5:121.08313.00 ft
6:121.11813.42 ft
7:121.15813.89 ft
8:121.20214.42 ft
9:121.25015.00 ft
10:121.30215.62 ft
12:121.41416.97 ft

Notice that going from 6:12 to 12:12 adds about 3.5 feet to every rafter on this building. Across a long roof, that is a lot of extra lumber, and the chart under the calculator shows the same effect for your own span. Rafters are usually bought in standard lengths, so round up to the next stock length and check what is available before you commit to a pitch.

Overhang and ridge board

Two details change the length from the textbook answer.

Overhang. Most roofs extend past the wall to shed water away from the siding. Overhang is measured horizontally, so add it to the run before multiplying. With the 24-foot, 6:12 example and a 1-foot overhang, the run becomes 13 feet and the rafter is 13 × 1.118 = 14.53 feet. The overhang itself is 1.118 feet of that, measured along the slope.

Ridge board. If rafters meet at a ridge board, each rafter stops at the face of the board, not the centre line. Deduct half the board thickness from the run. For a 1.5-inch ridge board, that is 0.75 inch of run, which shortens each rafter by about 0.84 inch at 6:12. A structural ridge beam is handled differently, so use 0 in the calculator and trim on site if you are unsure.

Plumb, seat, and birdsmouth cuts

Length is only half the job. Each rafter needs three cuts.

  • Plumb cut at the top, where the rafter meets the ridge. It is vertical when installed. Against the rafter edge, the angle is 90° minus the roof angle, which is 63.43° for a 6:12 roof.
  • Seat cut at the bottom, the flat part that sits on the wall plate. It is horizontal when installed, so against the edge it equals the roof angle, 26.57° at 6:12.
  • Birdsmouth, the notch formed by the seat cut and a plumb cut, which lets the rafter sit on the plate.

With a framing square you do not need the angles at all. Set the square to the rise on one blade and 12 on the other, and the edges give you both cuts. The angles are useful if you cut with a miter saw or digital angle gauge.

Notches weaken a board, so codes limit how deep a birdsmouth can be. A limit of one quarter of the rafter depth is common, which is about 1.81 inches for a 2×8 that is 7.25 inches deep. The calculator shows this figure if you enter the depth. Treat it as a guide and confirm it with your local code.

How many rafters you need

Rafters are spaced along the length of the building, usually 16 or 24 inches on centre. Divide the building length by the spacing, round up, and add one for the end. Do this for each side of the ridge. For a 30-foot-long building at 16 inches on centre, that is 360 ÷ 16 = 22.5, rounded up to 23, plus 1, which gives 24 per side and 48 in total. The calculator does this when you fill in the length and spacing. Add a few spare boards for mistakes and for any doubled rafters at gable ends or openings.

Example: a cut list for a 24 × 30 foot garage

Here is a full run-through so you can follow every number. The garage is 24 feet wide and 30 feet long, with a 6:12 gable roof, a 1-foot overhang, a 1.5-inch ridge board, 2×8 rafters, and 16-inch spacing.

  1. Run. Half the width is 12 feet. Subtract half the ridge board (0.75 inch, or 0.0625 foot) to get 11.9375 feet. Add the 1-foot overhang for an effective run of 12.9375 feet.
  2. Length. Multiply by 1.118 to get about 14.46 feet along the slope.
  3. Stock length. That does not fit a 14-foot board, so buy 16-foot boards, with about 1.5 feet spare on each. You can cut the tail and plumb ends from that spare.
  4. Cut angles. Plumb cut 63.43°, seat cut 26.57°.
  5. Birdsmouth limit. A 2×8 is 7.25 inches deep, so a quarter is about 1.81 inches.
  6. Count. 30 feet at 16 inches on centre gives 24 per side, so 48 rafters.

That is 48 sixteen-foot boards, or 768 feet of lumber, before spares for gable-end framing and mistakes. Enter these same values in the calculator to confirm each line. For the slab under that garage, try the concrete slab cost calculator or the concrete yard calculator.

Shed roofs

A shed roof has one slope, so the rafter spans the full width instead of half. Choose Shed (one slope) in the calculator and it uses the full width as the run, ignores the ridge board, and counts rafters for one side only. For a 10-foot span at 4:12, the rise is 3.33 feet and the rafter is 10 × 1.054 = 10.54 feet, which means a 12-foot board.

Rafter span and size: what this calculator does not do

Many people search for a rafter span calculator or a rafter dimensions calculator, so it is worth being clear. This page calculates length and cuts. It does not decide whether a 2×6, 2×8, or 2×10 is strong enough, because that depends on the wood species and grade, the spacing, the roof pitch, the span, and the loads from snow, roofing, and wind.

For that question, use the span tables in your building code, ask your lumber supplier or an engineer, or try the American Wood Council’s free span calculator for wood joists and rafters. The AWC states that its tool covers single-span members under common dead, live, and snow loads, and that it does not address wind or seismic loads. In snowy or windy areas, get a professional to check the design.

Hip rafters

On a hip roof, the hip rafter runs diagonally from the corner of the building to the ridge. Its horizontal run is the common run times √2, and its length follows from the same triangle. For a square corner, a 12-foot common run, and a 6:12 pitch, the rise is 6 feet and the hip rafter is √((12 × 1.4142)² + 6²) = √324 = 18.00 feet. Hips also need side cuts and a different layout, so treat this as a length estimate and check a framing guide before cutting.

Common mistakes to avoid

  • Using the full width as the run. A gable roof has two rafters per pair, so each one covers half the width.
  • Measuring overhang along the slope. Add overhang horizontally, then multiply, or you will cut the tails too long.
  • Forgetting the ridge board. Two rafters meeting a 1.5-inch board are each about three-quarters of an inch of run too long if you ignore it.
  • Mixing units. Entering the span in feet and the depth in inches gives nonsense. Convert first, or use one unit for everything.
  • Cutting every rafter from the calculator number alone. Walls can be out of square or level by a quarter inch or more. Cut one rafter, test it in place, and only then use it as the pattern for the rest.

Plan the rest of your project

Rafters are one step in a bigger build. These calculators cover the steps that usually come before and after framing the roof.

How this calculator works and what it assumes

I wrote the calculator in plain JavaScript that runs in your browser, so your numbers are never sent anywhere. It first turns your pitch or angle into a slope, then applies the formulas shown above. Results are rounded to two decimals.

To use it well, know what it assumes:

  • Common rafters on a simple gable or shed roof, with the same pitch on both sides.
  • Walls that are level and the same height, with a plumb-cut rafter meeting a flat-topped ridge board.
  • Lengths measured along the top edge of the rafter, from the ridge face to the tail cut.
  • Stock-length suggestions use common US lengths of 8 to 24 feet and appear when you pick feet or inches.

It does not size rafters, calculate hip or valley cuts, or account for collar ties, rafter ties, or uplift. I am a software engineer, not a licensed engineer or contractor, so treat the output as a planning figure and have a professional check anything that affects structure.

Change log: October 19, 2026, added links to related calculators and breadcrumb markup. October 6, 2026, first published with gable and shed roofs, cut angles, stock length, rafter count, and the pitch chart.

Frequently asked questions

How do I calculate rafter length?

Take half the building width as the run, multiply the pitch by the run to find the rise, and use the Pythagorean theorem: length equals the square root of run squared plus rise squared. For a 12-foot run at 6:12, the rafter is 13.42 feet.

How do I calculate rafter length using pitch?

Multiply the run by the square root of 1 plus the pitch divided by 12, squared. A 6:12 pitch has a multiplier of 1.118, so a 12-foot run gives a 13.42-foot rafter.

Does the rafter length include the overhang?

It can. Add the horizontal overhang to the run before multiplying by the pitch factor. The calculator shows the length with and without the overhang.

What is the plumb cut angle for a 6:12 roof?

The plumb cut is 63.43 degrees against the edge of the rafter, which is 90 degrees minus the 26.57 degree roof angle. The seat cut is 26.57 degrees.

How deep can a birdsmouth cut be?

A common limit is one quarter of the rafter depth, which is about 1.81 inches for a 2×8. Local codes vary, so confirm the limit with your building department.

Can this calculator tell me what size rafters to use?

No. It calculates length and cuts only. Rafter size depends on species, grade, spacing, span, and snow, roof, and wind loads, so use span tables in your code, the American Wood Council span calculator, or an engineer.

Does the calculator work for shed roofs?

Yes. Choose Shed (one slope). The run becomes the full width, no ridge board is used, and the rafter count covers one side.

Which stock length should I buy?

Buy the shortest standard board that is at least as long as the rafter. A 14.53-foot rafter needs a 16-foot board. The calculator suggests a length when you use feet or inches.

How do I find the pitch if I do not know it?

Measure the rise over a 12-inch run with a level and tape, or use the angle from a digital level. Our roof pitch calculator converts either into a pitch you can enter here.

Related calculators: work out roof area and shingles with the roof calculator, convert slope with the roof pitch calculator, or estimate the budget with the roof replacement cost calculator. Browse everything in roofing calculators.

Sources and further reading

The rafter length, rise, run, and multiplier come from right-triangle geometry. For rafter sizing and allowable spans, see the American Wood Council: AWC Releases Update to Span Calculator. For the angle and pitch math used here, see our roof pitch calculator and its worked examples. Notch limits and framing rules are set by your local code, so confirm them with your local building department.

About the author. I’m Shivam, a software engineer and the founder of Calctoolz. I research each formula in the original source and then implement the logic exactly as defined. Read more about Calctoolz, see our contact page, or find me on LinkedIn.
5/5 - (11 votes)