PERGOLA CALCULATOR

How much lumber for a pergola?

Enter the size and spacing, get posts, beams and rafters instantly.

ft
ft
ft
in
in
in

Set purlins to 0 for none. Beam and post sizes must suit your spans — check a span table.

How many rafters does a pergola need?

Divide the length of the beams, overhangs included, by the rafter spacing, round down and add one. A 12 ft pergola with 1 ft overhangs has 14 ft beams: 168 inches ÷ 16 = 10.5, so 10 spaces and 11 rafters.

How many posts do I need?

Two rows of posts, one under each beam, no farther apart than your beams can span. A 12 ft long pergola with posts at most 8 ft apart needs 2 bays, so 3 posts on each side — 6 in all, 6 ft apart.

How far can pergola beams span?

It depends on the beam size, the wood species and the load, so check a span table such as the IRC deck beam table or ask an engineer. A pergola roof is light, but snow, a shade cloth or hanging plants add load.

How far apart should the rafters be?

Closer rafters cast more shade and use more lumber. Try a few spacings here and compare the rafter count; add purlins across the rafters for more shade.

What about the footings?

Each post needs a footing below the frost line in cold climates, sized for your soil — see the sonotube and post hole calculator for the concrete. Local codes may require a permit for a pergola attached to the house.

How long should the rafters be?

The rafter length is the pergola width plus an overhang at each end. Lumber is sold in set lengths, commonly in 2-foot steps, so round each rafter length up to the next stock length and trim after installation.

How the quantities are counted

The calculator puts posts along the two long sides, no farther apart than the maximum spacing you give, and splits the length into equal bays: the number of bays is the length divided by that spacing, rounded up, and each side has one more post than bays. Two beams run along the posts, each as long as the pergola plus the overhang at both ends. Rafters sit across the beams at the chosen spacing measured center to center, with one at each end of the beam, and optional purlins lie across the rafters in the same way.

A worked example

A 14 ft by 10 ft pergola with posts at most 8 ft apart, 12-inch overhangs, rafters every 16 inches and purlins every 12 inches. Length 14 ÷ 8 = 1.75, rounded up, gives 2 bays of 7 ft, so 6 posts. Each beam is 14 + 2 × 1 = 16 ft, and 192 inches ÷ 16 = 12 spaces, so 13 rafters of 12 ft. Purlins run along the 16 ft length and are spaced 12 inches apart across the 12 ft rafters, which makes 13 purlins. Without the overhangs the same design needs only 11 rafters, and tightening the spacing to 12 inches takes it to 17.

Common mistakes

Leaving out the overhang shortens both the beams and the rafters and undercounts the rafters. Measuring rafter spacing edge to edge instead of center to center overstates how many fit. Treating the post spacing as a target rather than a maximum is the third: the calculator spreads the posts evenly, so the real spacing is usually a bit smaller than the number you typed. Finally, the quantities are for the frame only; the span of the beams and the size of the footings are decided by the lumber and your local code.

Sources: layout arithmetic as described above; beam and joist spans for similar framing are tabulated in the International Residential Code, Table R507.5 series (see the deck beam span calculator). Check your local building department about permits and footing depth. Related: deck beam span calculator, sonotube calculator, lumber calculator and deck calculator.