# Pergola/Trellis Rafter Spacing Calculator

> Calculate the number of rafters needed to span a pergola or trellis structure at a given on-center spacing.

Page: https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/ (calculator). This is the page's Markdown copy; the HTML page is the canonical version.

Version 1.0.1, sources checked 2026-09-05, 2 published test vectors.

Rafters needed: 8 rafters for Pergola/Trellis Width 13 ft and Maximum Rafter Spacing 2 ft, the page's opening figures; on the metric page, 4 m and 0.6 m give 8 rafters. Sources are cited below.

## Inputs

A length, area or volume is entered with its unit. The page opens on the values below: a metric reader sees the metric column, a US customary reader the other.

| Input | id | Opens at (metric) | Opens at (US customary) | Accepts |
|---|---|---|---|---|
| Pergola/Trellis Width (Span Direction) | `pergolaWidth` | 4 m | 13 ft | mm, cm, m, in, ft, yd; range 0.01–12 m |
| Maximum Rafter Spacing (On-Center, per Design) | `maxRafterSpacing` | 0.6 m | 2 ft | mm, cm, m, in, ft, yd; range 0.01–1.2 m |

- **Pergola/Trellis Width (Span Direction)**: The overall width of the pergola or trellis in the direction the rafters span across.
- **Maximum Rafter Spacing (On-Center, per Design)**: The maximum on-center spacing allowed between rafters per the design or span table.

## The answer on the opening values

Worked exactly as the page works it, on the values each system opens on.

### Metric

| Result | Value |
|---|---|
| **Rafters needed** | 8 rafters |
| Bays across the pergola | 7 |
| Rafter centres, as laid out | 0.57 m |

### US customary

| Result | Value |
|---|---|
| **Rafters needed** | 8 rafters |
| Bays across the pergola | 7 |
| Rafter centres, as laid out | 1.86 ft |

## How it is worked out

Maximum rafter spacing depends on the rafter material, size, and any planned cover/planting load — confirm the spacing against the specific rafter species/size's span table or a designer's calculation for your load case.

The working the page shows, in order: Bays across the pergola; Rafter centres, as laid out; then rafters needed.

The method, derived in full:

- [Fastener Schedules, Supports and Counting Over a Grid](https://craftquantities.com/methodology/fastener-schedules-and-grid-counts/): Why a fixing count is never area divided by spacing, why the edges of a panel supply more fasteners than its middle, and why the tighter schedule at a roof corner is a requirement rather than caution.

What this calculation does not cover:

- Only the two lengths you type enter the arithmetic — the width is divided by the maximum spacing and one rafter is added — so rafter thickness never appears and the count sets out centre lines rather than faces; if the two outer rafters must finish flush inside the beam ends instead of being centred on them, take one rafter thickness off the width before entering it.
- The answer is the count on its own, and the tighter on-centre spacing that the rounding-up produces is not reported back, so mark the beams out by dividing your width by one less than the rafter count instead of stepping the maximum spacing along from one end and squeezing whatever is left into the last bay.
- One width and one spacing describe a single straight run divided evenly end to end, so a doubled rafter at each end, a widened bay over a gate or path, and an L-shaped or multi-bay frame all have to be run through separately with the shared rafter at each junction counted once.
- Nothing but the rafters is totalled here: the beams they sit on, the posts, the hangers and screws, and any lattice, battens or purlins laid across them on a trellis top are outside the figure.
- Rafter length is never asked for and no waste percentage is applied, so the number is how many sticks stand in the finished frame rather than a timber order — multiply it by your own cut length and add your own allowance for off-cuts and warped or split lengths.

A professional must decide:

- Structure: sizes, thicknesses, spans, reinforcement and bearing are a structural engineer's or the building official's decision. This is a quantity, not a design.

## Sources

As the calculator cites them (sources checked 2026-09-05):

- Rafter count = ceil(Pergola Width ÷ Maximum Rafter Spacing) + 1 — the standard support-count method (identical in principle to this site's joist/stud spacing calculators) applied to pergola or trellis rafter layout.

A code or standard has force only where a jurisdiction has adopted it, usually with local amendments; check what is in force with the authority where you build.

## Questions answered on the page

**Why does the calculator add 1 to the divided width?**

A rafter is needed at both ends of the span as well as at every interior spacing interval, so the count is the number of spacing intervals (rounded up) plus one for the starting rafter.

**Why round up the number of spacing intervals?**

Rounding up (ceiling) ensures the actual on-center spacing never exceeds the maximum allowed — if the width doesn't divide evenly, the extra rafter tightens the spacing slightly rather than leaving a gap that's too wide.

**What determines the maximum allowable rafter spacing?**

The rafter material and size and any planned cover or planting load, read off the span table for that species and size or a designer's calculation for your load case. Always confirm the spacing against those rather than assuming a default.

## Related calculators

- [Curved/Radius Wall Framing Stud Layout Calculator](https://craftquantities.com/calculators/materials-quantities/curved-wall-stud-layout-calculator/)
- [Decorative Column/Pilaster Wrap Material Calculator](https://craftquantities.com/calculators/materials-quantities/decorative-column-wrap-calculator/)

## Run it from a program

- REST: `GET https://api.craftquantities.com/v1/calculate/pergola-rafter-spacing-calculator` with each input as a query parameter, a length, area or volume with its unit; `https://api.craftquantities.com/v1/describe/pergola-rafter-spacing-calculator` lists the inputs.
- MCP: the `calculate` tool at https://api.craftquantities.com/mcp with `slug` `pergola-rafter-spacing-calculator`.
- Definition and test vectors: https://craftquantities.com/api/v1/calculators/pergola-rafter-spacing-calculator.json

---
Source: https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/
Craft Quantities: free to read, cite and link to; the pages are not licensed for republication. Quantities only: no prices, no design and no certification.
