Rafter calculator
How long is each rafter, and how many do you buy? Give it your walls and a pitch, and see the roof framed with every board’s length.

The plan
Every piece, sized and counted from the sizes you gave.
- Roof angle
- 26.6°
- Ridge
- 20 ft long
| Piece | Size | Length | How many |
|---|---|---|---|
| Rafter | 2×6 | 10 ft 7/16 in | 22 |
| Ridge board | 2×8 | 10 ft 11 1/2 in | 2 |
| Barge rafter | 2×6 | 10 ft 7/16 in | 4 |
| Lookout | 2×6 | 1 ft 7 1/2 in | 12 |
| Lookout | 2×6 | 9 11/16 in | 4 |
| Lookout | 2×6 | 9 3/16 in | 4 |
| Corner rafter | 2×6 | 2 ft 10 3/16 in | 4 |
| Sub-fascia | 2×6 | 10 ft 10 7/16 in | 4 |
| Top plate | 2×4 | 19 ft 5 in | 2 |
| Top plate | 2×4 | 15 ft 5 in | 2 |
| Top plate | 2×4 | 8 ft 5 5/8 in | 8 |
| Stud | 2×4 | 5 3/4 in to 3 ft 9 in | 44 |
In all 2×4: 226 ft · 2×6: 342 ft · 2×8: 22 ft
hauscraft.app/calculators/rafter-calculator/
How it is worked out
- Rafters run from each wall up to a ridge board along the peak, no further apart than the spacing you choose. The first stands just inside each end wall.
- Each rafter is notched to sit on the 2×4 plate on top of its wall, and runs on past the wall to the overhang.
- A sub-fascia closes the rafters’ ends along each eave. A barge rafter runs up each rake, carried on lookouts from the first rafter inside the wall.
- Each outside corner of the eaves has a short rafter at 45° from the corner in to the first rafter it meets.
- The gable ends are framed up to the roof in studs under a plate that follows the slope.
- Boards come up to 20 ft long. A rafter that would need to be longer, with no wall or beam under it to joint it over, is turned down, and we say why.
We lay out and count the sizes you pick, close enough to plan a weekend and price the lumber. Span tables, your local code and, on a bigger job, an engineer settle what size each board has to be.
Questions
- How long is a rafter?
- It depends on the half-width of the building, the pitch and the overhang. The list gives each rafter’s length as it is cut, from the ridge board to the end of the overhang.
- Does it cut the birdsmouth?
- Yes. Each rafter is drawn notched over the plate it sits on, and its length is measured with the notch in it.
- Can it frame a hip roof?
- It frames roofs whose shape is the same all the way along, such as gables, sheds, gambrels and saltboxes. A hip roof falls outside that.
Talk it over
Ask other owners how they built theirs in Request a build, and when yours is done, show it in Builds and projects: how you went about it, what you’d do again and what you wouldn’t.
From an AI assistant
Add HausCraft’s MCP server, https://hauscraft.app/mcp, to Claude or any assistant that takes one, and ask it for this calculation: it answers with the same list. What it asks, and every calculator.
Other calculators

Wall framing calculator
Know how many studs to buy, and where they stand. Every stud, plate and header, around your door or window.Open the wall framing calculator
Stair calculator
Make a stair that fits the height you climb. Even risers, treads and stringers.Open the stair calculator
Deck framing calculator
Know what to buy before you dig a footing. Footings, posts, beams, joists and planks, counted.Open the deck framing calculator
Roof truss calculator
Know how many trusses to order. Every truss, with its chords and webs.Open the roof truss calculator
Shed roof calculator
Know how tall the high wall has to be. One slope of rafters and the wall under it.Open the shed roof calculator
Gambrel roof calculator
Get a barn roof’s two slopes to meet. Both slopes’ rafters, each with its length.Open the gambrel roof calculator
Saltbox roof calculator
See what moving the ridge does to the back slope. A short steep slope and a long shallow one.Open the saltbox roof calculator
Floor joist calculator
Know how many joists a floor takes. Joists, rim boards and the subfloor.Open the floor joist calculator
Fence calculator
Know what to buy for a run of fence. Posts, rails and boards, counted.Open the fence calculator
Plant spacing calculator
Know how many plants fill a bed. Every plant in its place, counted, and the mulch to cover the bed.Open the plant spacing calculator
Vegetables
Tomato24 in apart
Bell pepper15 in apart
Jalapeño15 in apart
Cucumber12 in apart
Zucchini24 in apart
Lettuce6 in apart
Carrot3 in apart
Green bean4 in apart
Pole bean6 in apart
Pea3 in apart
Radish3 in apart
Onion4 in apart
Garlic6 in apart
Potato12 in apart
Sweet corn15 in apart
Spinach4 in apart
Kale15 in apart
Broccoli15 in apart
Cabbage15 in apart
Cauliflower15 in apart
Beet4 in apart
Eggplant18 in apart
Pumpkin36 in apart
Butternut squash36 in apart
Sweet potato12 in apart
Swiss chard8 in apart
Okra15 in apart
Celery8 in apart
Brussels sprouts18 in apart
Asparagus18 in apart
Leek4 in apart
Rhubarb36 in apart
Herbs
Basil12 in apart
Parsley6 in apart
Cilantro6 in apart
Mint12 in apart
Rosemary24 in apart
Thyme6 in apart
Oregano12 in apart
Chives4 in apart
Dill12 in apart
Sage18 in apart
Lavender18 in apart
Fruit
Start from your address
Tell Klaus where your house is. He asks a couple of questions about it and lays it out with you.






