Pergola Calculator
Estimate the posts, beams, rafters, top slats and concrete for a freestanding pergola from its size, rafter spacing and overhang, with stock lumber lengths to buy.
By CalcBuilt Editorial TeamUpdated September 9, 2026Formulas checked against manufacturer specs, see how we calculate.
Results
- Posts
- 4 posts
- 6x6, 11 ft each: 8 ft above grade plus 3 ft in the ground. Buy 12 ft posts.
- Beams
- 2 beams
- 14 ft each, length plus both overhangs. Usually doubled 2x10 (two boards per beam); buy 14 ft stock.
- Rafters
- 10 rafters
- 12 ft each at 16 in on center; 2x8, buy 12 ft stock
- Concrete
- 8 bags
- 2 x 50 lb (23 kg) bags per post, about 0.11 cu yd
- Hardware
- 4 post bases
- 4 standoff post bases, 8 x 1/2 in carriage bolts (2 per post) for the beams, and 20 hurricane ties or structural screws for the rafters. Planning estimate; local code and permit rules govern.
Pergola formula
Posts = 4 (6 when the length is over 14 ft); Post length = height + 3 ft in the ground
Beams = 2, each Length + 2 x overhang
Rafters = Length (in) / rafter spacing, rounded up, + 1, each Width + 2 x overhang
Slats = Width (in) / slat spacing, rounded up, + 1, each Length + 2 x overhangWorked example
A 16 x 12 ft pergola with 24 in rafter spacing, 1.5 ft overhangs and slats 12 in on center: the length is over 14 ft, so 6 posts. Beams: 2, each 16 + 3 = 19 ft, so buy 20 ft stock. Rafters: 16 x 12 / 24 = 8, plus 1 = 9, each 12 + 3 = 15 ft, so buy 16 ft boards. Slats: 12 x 12 / 12 = 12, plus 1 = 13, each 19 ft.
With 8 ft to the beams the posts are 8 + 3 = 11 ft, so buy six 12 ft 6x6s. At 2 bags per post, 12 bags of concrete.
Quick reference
| Length | Posts | Beam length | Rafters at 16 in | Rafters at 24 in |
|---|---|---|---|---|
| 8 ft | 4 | 10 ft | 7 | 5 |
| 10 ft | 4 | 12 ft | 9 | 6 |
| 12 ft | 4 | 14 ft | 10 | 7 |
| 14 ft | 4 | 16 ft | 12 | 8 |
| 16 ft | 6 | 18 ft | 13 | 9 |
| 20 ft | 6 | 22 ft | 16 | 11 |
How to estimate pergola lumber
A freestanding pergola is four posts, two beams running the length on top of the posts, and rafters crossing the beams. Beams are the length plus the overhang on each end; rafters are the width plus overhangs. Divide the length in inches by the rafter spacing, round up and add one for the last rafter. Pergolas longer than about 14 ft get a middle pair of posts so the beams do not sag.
Round every piece up to the next stock length. Beams and rafters are usually cut with a decorative end profile, which needs a few extra inches, so a 14 ft beam should come from 14 ft stock only if you can live with a plain end.
Posts, footings and hardware
Posts either sit in concrete or on standoff bases bolted to concrete piers. Set-in-concrete posts are simpler and stiffer against wind; bases keep the wood out of the ground so it lasts longer. Either way, dig below the frost line and use ground-contact treated lumber, cedar or redwood.
Bolt the beams through the posts with 1/2 in carriage bolts rather than nails or lag screws, and tie each rafter to the beams with a hurricane tie or a long structural screw. Check the local span table for the beam size: a doubled 2x10 handles most 12 ft post spacings, while 4x4 posts and doubled 2x8 beams suit small pergolas under about 10 ft.
Key facts
- A 4x4 post is 3.5 in square and a 6x6 is 5.5 in square; 6x6 posts look proportionate and resist racking on pergolas over about 10 ft.
- The IRC exempts one-story detached accessory structures of 200 sq ft or less from a building permit, but many cities require one for any pergola attached to the house.
- Set posts at least 24 in deep and below the local frost line; this estimate allows 3 ft of post in the ground.
- Rafters 12 in on center cast about twice the shade of rafters at 24 in; slats on top of the rafters add shade without more posts or beams.
- Dimensional lumber is sold in 2 ft steps from 8 to 20 ft, so a beam that works out to 19 ft is bought as a 20 ft board.
Frequently asked questions
How many posts does a 12 x 10 pergola need?
Four, one at each corner. Once the length passes 14 ft, add a middle pair for six posts so the beams do not sag.
How many rafters for a 12 ft pergola?
At 16 in on center, 12 x 12 / 16 = 9, plus 1 = 10 rafters. At 24 in on center it is 7 rafters.
How long should pergola posts be?
Add about 3 ft to the height of the beams for the part in the ground. An 8 ft high pergola uses 11 ft of post, so buy 12 ft 6x6s.
What size lumber should I use for a pergola?
6x6 posts, doubled 2x10 beams and 2x8 rafters are the usual choice for a 10 to 12 ft pergola. Small pergolas under 10 ft can use 4x4 posts, 2x8 beams and 2x6 rafters. Check span tables for anything larger.
Sources and references
Next steps for this project
The usual order for a framing, decks & fences project. See all framing, decks & fences calculators.
Results are estimates based on standard formulas and typical product specifications. Confirm quantities with your supplier and local code before ordering.