By Zencalcy Editorial TeamLast reviewed About us
A fence is a series of posts and the bays between them. Posts go at every corner and gate plus the regular spacing between, and each bay holds one set of rails. Getting the spacing right first avoids a sliver bay at the end of the run.
Posts, rails and panels for a fence run.
posts = ⌈length ÷ spacing⌉ + 1 + 2 × gates bays = ⌈length ÷ spacing⌉ − gates rails = bays × rails per bay
Post spacing is measured on centers. A 6 foot panel fence wants posts at 72 inches on centers so the panel laps onto each post; rails run continuously between posts, one at the top, one at the bottom, and one mid for a 6 foot fence.
| Symbol | Meaning |
|---|---|
| L | Total fence run length. |
| s | Post spacing on centers. |
| g | Number of gates. |
13 bays need 14 run posts, plus 4 gate posts — 18 total, and 11 rail bays after two gate openings, so 22 rails.
Continue with the Paint Calculator, Wallpaper Calculator, Tile Calculator, or the Flooring Calculator — or browse more home & garden projects and all construction calculators.
At 8 foot spacing, 13 bays need 14 posts for the run itself, plus two posts for each gate. Corners always get a post even if the spacing would not land there.
Results use standard construction estimating arithmetic: volumes from measured area and depth, unit weights from published material densities, and code-referenced spans or clearances where the page names a code. Quantities are rounded up to whole saleable units and include the stated waste allowance. These tools are planning aids, not structural design, and do not replace a licensed engineer, a local code check, or a contractor's site measurement.
Reference material used to build and check this calculator:
Last reviewed: September 2026. See how we build and check every tool on the about page.
Estimate decking boards by length, screws, hidden fasteners and waste
Calculate concrete blocks needed for wall construction
Calculate full deck materials list including boards, joists, beams, posts, and cost estimates
Price hardwood the way the lumber yard does — by board footage.
Turn measured dimensions into the cubic yards concrete and gravel are sold in.
How many gallons it takes to cover an area at a given depth.
Content updated: September 2026