Skip to content
rightquantity.com

Pergola Calculator

A pergola calculator returns the posts, beam footage, rafter count and rafter length for a free-standing rectangular pergola. Posts sit at both ends and at your chosen spacing along each long side. Beams run the full length of each side, and rafters span the width at your chosen spacing along the length.

Last reviewed September 2026Method & sourcesReport an error

Pergola Calculator

6 to 24 feet

6 to 20 feet

Rafter Spacing
More options (2)

6 to 10 feet

0 to 24 inches

Not to scale.

Posts Needed

6

Shopping list

  • Posts6 posts
  • Beams (linear feet)24 ft
  • Rafters7 at 12 ft each
Breakdown
Posts Needed6
Beam Linear Feet24.0 ft
Rafters Needed7
Rafter Length (each)12.00 ft

How to Calculate Pergola

A basic rectangular pergola has posts along both long sides at a chosen spacing. The count is `length ÷ post spacing, rounded up, plus one`, for posts at both ends and any spacing in between, doubled for both sides. A beam runs along the top of each side's posts, so beam linear footage is simply twice the pergola's length. Rafters span across the width, resting on top of the two beams. They are spaced along the length at a chosen on-center interval (`length in inches ÷ rafter spacing, rounded up, plus one`, for a rafter at both ends and any spacing in between). Each rafter's length is the pergola's width plus an overhang allowance at each end, a common design detail that extends the rafters slightly past the beams.

Example: 12 ft × 10 ft pergola, 8 ft post spacing, 24 in. rafter spacing

A 12 ft × 10 ft pergola, 8 ft post spacing, 24 in. rafter spacing, 12 in. overhang at each end: 1. Posts along length: ceil(12 ÷ 8) + 1 = 2 + 1 = 3, doubled for both sides: 6 posts 2. Beam linear feet: 12 × 2 = 24 ft 3. Rafters: ceil(12 × 12 ÷ 24) + 1 = 6 + 1 = 7 4. Rafter length: 10 + 2 × (12 ÷ 12) = 10 + 2 = 12 ft That pergola needs 6 posts, 24 linear ft of beam material, and 7 rafters at 12 ft each.

Pergola: Compare Scenarios

ScenarioPosts NeededBeam Linear FeetRafters NeededRafter Length (each)
Small (8x8 ft pergola)416.0 ft510.00 ft
Medium (12x10 ft pergola)624.0 ft712.00 ft
Large (20x16 ft pergola)840.0 ft1118.00 ft

What Is Pergola?

A pergola calculator converts a pergola's footprint, post spacing, and rafter spacing into the posts, beam linear footage, and rafter count and length needed to build it. It is the outdoor-structure counterpart to this site's Shed Material calculator, for one of the most common standalone DIY backyard projects.

Pergola: Pros and Cons

Pros

  • Scales posts, beams, and rafters together from just the footprint and two spacing choices, instead of estimating each separately
  • Includes a rafter overhang allowance, a common design detail that a raw width-only rafter length would miss
  • Works for any rectangular pergola footprint and spacing combination

Cons

  • Assumes a simple rectangular footprint with posts only along the two long sides. An attached pergola (ledger-mounted to a house on one side) needs a different post layout than this free-standing design
  • Doesn't size post, beam, or rafter lumber dimensions for the actual span and local snow/wind load. Those are structural decisions for your specific climate and pergola size, best confirmed against your local code or a span table
  • Doesn't include roofing, shade cloth, or lattice sometimes added on top of the rafters. This covers the structural frame only

Pergola: What a Pro Checks

  • This covers a free-standing rectangular pergola only. An attached, ledger-mounted pergola needs a different post layout on the house side, since it doesn't need its own posts there.
  • Confirm your post, beam, and rafter lumber sizes against a span table or your local building code before building. This calculator sizes counts and lengths from your footprint and spacing, not the lumber dimensions needed for your local snow or wind load.
  • Choose rafter spacing by the look and shade density you want, not structural necessity, for most pergola sizes. 24 in. gives a lighter, more open look, while 16 in. gives denser shade coverage and a sturdier feel for supporting shade cloth or climbing plants.

Frequently Asked Questions

How many posts does a pergola need?

For a free-standing rectangular pergola, posts run along both long sides at your chosen spacing. A 12 ft long pergola at 8 ft post spacing needs 3 posts per side (6 total), including one at each end.

How far apart should pergola posts be spaced?

Commonly 6-10 ft apart, though the right spacing depends on your beam size and span capacity. A larger beam can span further between posts than a smaller one.

How long should pergola rafters be?

The pergola's width, plus an overhang allowance at each end (commonly 12 in.) if your design includes one. A 10 ft wide pergola with 12 in. overhangs needs 12 ft rafters.

16 in. or 24 in. rafter spacing for a pergola?

24 in. is common for a lighter, more open look with less material. 16 in. gives more shade coverage and a sturdier feel for supporting shade cloth or climbing plants. It's largely an aesthetic and shade-density choice rather than a structural requirement for most pergola sizes.

Does this calculator size the lumber for structural loads?

No. It calculates post, beam, and rafter counts and lengths from your chosen footprint and spacing, not the lumber dimensions needed to safely span those distances under your local snow or wind load. Check a span table or your local building code for that separately.