ForHosting KIT · Home, food & hobbies

Pergola lumber calculator

A 12 by 10 ft pergola with rafters every 2 ft needs 4 posts, 2 beams of 12 ft and 7 rafters of 10 ft, 13 pieces in all. Enter the footprint and spacing to get a stick list before you order. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Length
12
Width
10
Rafter spacing
2
You get
Full bays
6
Remainder
0
Post count
4
Beam count
2

Planning a freestanding pergola starts with a lumber takeoff for the posts that hold the frame, the beams that run the long sides, and the rafters that form the open shade lattice across the top. This pergola lumber calculator accepts the footprint length and width plus the on-center rafter spacing you intend across the top, then returns a deterministic stick list: four corner posts, two primary beams along the length, and a rafter count that always includes both ends of the run. Keep length, width, and spacing in one unit system—feet with feet, metres with metres—so the rafter span equals the width and the beams match the length. Use the piece counts as a planning estimate before you size stock, add waste, or order hardware.

How posts, beams and rafters are counted

A rectangular freestanding pergola is modelled as four corner posts, two primary beams running the full length of the structure (one along each long side), and a set of rafters that span the width and sit on those beams.

Rafter positions always include both ends of the length so the lattice does not leave the last bay open: when the length is an exact multiple of the on-center spacing, the position count is length divided by spacing plus one; when a partial bay remains, the far end is still counted, which is floor of length over spacing plus two. Each rafter is treated as a stick of length equal to the footprint width (plan-view span from beam to beam).

Each beam is treated as a stick of length equal to the footprint length. The response also reports full bays, any remainder along the length, linear totals for beams and rafters, top-frame linear footage (beams plus rafters), and total piece count (posts plus beams plus rafters) so you can sketch a cut list or feed a materials spreadsheet without re-deriving the grid arithmetic by hand.

Input contract, units and error behaviour

Extremely small or absurdly large dimensions are rejected so floating-point division stays stable. There is no unit enum: you choose feet, inches, metres, or millimetres, but every field must share that system—mixing twelve feet of length with two-metre spacing will produce nonsense counts. If you prefer tighter shade, drop spacing; the rafter count rises while posts and beams stay fixed under this freestanding model.

Intermediate posts for very long runs, double beams, headers, purlins, and hardware are outside the three-field contract—extend the counts yourself after you review local code and stock sizes.

Where a quick lumber count pays off

Homeowners and DIYers use a pergola lumber calculator to turn a sketch of length, width, and preferred rafter rhythm into a first-pass shopping list before visiting the yard. Landscape and deck contractors paste the same numbers into job prep sheets so estimators quote posts, beams, and rafters consistently across proposals. Pin the returned counts in tests, keep units consistent, and treat the output as a planning estimate—not a sealed structural design—then apply your own waste percent, stock lengths, and engineering checks before you cut or order.

DIY shopping list from a sketch

Enter planned length, width, and rafter spacing to get corner posts, dual beams, and rafter sticks before you buy lumber.

Contractor estimate prep

Standardize freestanding pergola stick counts across proposals with the same OC grid math for every footprint.

How does the pergola lumber calculator count rafters?

Rafters are spaced along the length at your on-center spacing and always include both ends. Exact multiples use length/spacing+1 positions; a partial last bay uses floor(length/spacing)+2. Each rafter length equals the width.

Why are there always four posts?

The model is a rectangular freestanding frame with one post at each corner. Post height is not estimated. Add intermediate posts yourself if your span or code requires them.

How many beams does it assume?

Two primary beams along the length (one on each long side), each as long as the footprint length. Double beams or end headers are not included—add them to your cut list if your design uses them.

How many linear feet of lumber does a 12 by 10 pergola top need?

With rafters every 2 ft, the top frame needs 94 linear feet: the two 12 ft beams make 24 and the seven 10 ft rafters make 70. The four posts are counted separately.

Does the stick list include post height, purlins or hardware?

No. Posts are counted but not sized, because their height depends on the finished ground and the clearance you want. Intermediate posts, double beams, headers, purlins and hardware are left for you to add after checking local code.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/home/pergola-lumber

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/home/pergola-lumber \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"length":12,"width":10,"rafter_spacing":2}'
{
  "length": 12,
  "width": 10,
  "rafter_spacing": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "home.pergola_lumber",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How posts, beams and rafters are counted

Posts are returned as a count of four only—post height depends on finished grade and roof clearance, so this endpoint does not invent a vertical dimension.

Input contract, units and error behaviour

POST a JSON body with three required finite positive numbers: length, the footprint dimension along which rafters are spaced; width, the footprint dimension each rafter spans; and rafter_spacing, the on-center distance between adjacent rafters along the length. Values may arrive as JSON numbers or numeric strings. Missing fields, empty strings, non-finite values, zero, and negatives fail with invalid_input naming the field, and failed validation is not billed. Example: length twelve, width ten, rafter_spacing two (same units) yields four posts, two beams of length twelve, and seven rafters of length ten when twelve is an exact multiple of two, because positions equal six plus one.

Where a pergola lumber API earns its keep

Product configurators and yard web apps can call the API from a form without standing up a custom framing engine for a three-input rectangular takeoff.

Configurators and content widgets

Power a free browser tool or API-backed form that returns reproducible posts, beams, and rafters for SEO and lead capture.

What units should I use?

Any single linear system for length, width, and rafter_spacing together (feet, metres, etc.). Do not mix systems. The API does not convert units.

What does the pergola lumber calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →