General calculator
Post Counter
A post counter calculator that turns a straight run length and your post spacing into the number of posts you need, for deck railings, pergolas, trellises, mailbox rows or any evenly spaced layout. Count the posts before you buy the lumber, and the run ends with a post instead of a gap. Miss one post and the last section has nothing to hold it.
- Free to use
- No sign-up
- Formula and sources shown

Got the number? Save it before it gets lost.
A result on a screen is easy to lose. Save this estimate in the app and it stays with the project, ready when you order.
Posts needed
4
Turn this result into a priced plan
Save it to a project, add the rest of your materials, and send a client-ready quote. No retyping, no spreadsheet, no lost numbers.
Formula
Posts = ceil((Run Length × 12) ÷ Spacing) + 1
Worked example. A 24 ft railing run with posts every 8 ft: (24 × 12) ÷ 96 = 3, plus 1 for the starting post = 4 posts.
To count posts, divide the run length by the post spacing, round up to the next whole number for the number of sections, and add one. A 24 ft run with posts every 8 ft has 3 sections and needs 4 posts. Count the sections first, since the post count is always one more than the sections.
Key takeaways
- •Posts = ceil(run length ÷ spacing) + 1. A straight 24 ft run with 8 ft spacing needs 4 posts.
- •Round up the number of sections, then add one post, because a run has a post at both ends.
- •Enter both the run length and the spacing in feet. The calculator treats them as a single, straight run.
- •Corners, returns, gates and ends are not added for you. Add one post at each corner, or count each straight run on its own.
- •Your project's code, design or the product maker sets the maximum spacing. This tool only counts.
How to use the post counter
- Measure the total length of one straight run in feet, from the center of the first post to the center of the last.
- Enter the run length.
- Enter the post spacing in feet. This is on center, from one post's center to the next.
- Read the number of posts.
- For an L-shaped or enclosed layout, count each straight run separately, then adjust the shared corner posts as described below.
- Use the result with the concrete column calculator or fence post calculator for footings.
Post count formulas
Sections = ceil[ Run length (ft) ÷ Spacing (ft) ]
Posts = Sections + 1
Actual spacing = Run length ÷ Sections
Rounding up the sections keeps the spacing at or below your maximum. The actual spacing is then a little smaller than the number you entered, unless the run divides exactly.
Post counter examples
Example 1: 24 ft run, posts every 8 ft (the calculator default)
- Sections = 24 ÷ 8 = 3
- Posts = 3 + 1 = 4
Example 2: 30 ft run, posts every 8 ft
- Sections = 30 ÷ 8 = 3.75, rounded up to 4
- Posts = 5, with an actual spacing of 30 ÷ 4 = 7.5 ft
Example 3: 9 ft run, posts every 4 ft
- Sections = 9 ÷ 4 = 2.25, rounded up to 3
- Posts = 4, with an actual spacing of 3 ft
Example 4: 100 ft run, posts every 8 ft
- Sections = 100 ÷ 8 = 12.5, rounded up to 13
- Posts = 14, with an actual spacing of 7.69 ft
Example 5: 16 ft pergola side with posts every 4 ft
- Sections = 4; posts = 5
Example 6: cost of Example 1
- 4 posts × $22 each = $88 (example price only, hardware and concrete extra)
Posts needed by run length and spacing
| Run length | 4 ft spacing | 6 ft spacing | 8 ft spacing | 10 ft spacing |
|---|---|---|---|---|
| 10 ft | 4 | 3 | 3 | 2 |
| 20 ft | 6 | 5 | 4 | 3 |
| 30 ft | 9 | 6 | 5 | 4 |
| 50 ft | 14 | 10 | 8 | 6 |
| 100 ft | 26 | 18 | 14 | 11 |
Posts for one straight run. Add posts for corners, gates and ends as your layout needs.
Why you add one
A run of posts has a post at each end, so the number of posts is always one more than the number of gaps. Three gaps between four posts is a common example. If you forget the extra post, the last section is left without support.
For a closed loop, such as a circular or square enclosure, the last post is also the first, so a closed loop needs the same number of posts as sections, with no extra one.
Corners, ends and gates
| Layout | How to count |
|---|---|
| One straight run | Use the calculator as is |
| L-shaped run with two straight sides | Count each side, then subtract one because the corner post is shared |
| Closed rectangle | Count each side, then subtract one shared post at each corner (four in all) |
| Run with a gate | Add the gate's two posts and deduct line posts that fall inside the opening |
| Run with an end return | Add a post at the end of the return |
Gate and corner posts are often larger and set deeper than line posts, so list them separately.
Typical post spacing by project
| Project | Typical maximum spacing | Notes |
|---|---|---|
| Deck railing | About 6 ft, sometimes up to 8 ft | Depends on the rail, the post size and local code |
| Wood privacy fence | About 6 to 8 ft | See the fence calculator |
| Chain link fence | Up to about 10 ft | See the chain link fence calculator |
| Pergola or arbor | Often 6 to 12 ft, based on the beam span | Structural, so check the design |
| Trellis or garden fence | About 4 to 8 ft | Depends on the load and wind |
| Mailbox or sign row | As designed | Often a single post |
Typical ranges only. Follow your design, the product's installation guide and local code. Deck railings in particular have strict strength requirements.
Spacing a run evenly
- Divide the run by the maximum spacing and round up to get the number of sections.
- Divide the run by the sections to get the actual spacing, such as 7.5 ft for a 30 ft run.
- Mark the first and last post centers, then mark each post at the actual spacing, working from one end.
- Check the marks against the actual spacing by measuring end to end, not post to post, to avoid a build-up of error.
- Adjust for obstacles such as trees or utilities before you dig, and call 811 before digging.
Footings and post depth
- •Post depth, hole size and concrete depend on the post's use and the soil and frost conditions. A common fence rule is to set the post about one-half to one-third of its above-ground height deep.
- •Deck railing posts are usually bolted to the deck framing, not set in the ground, and must meet the code's load requirements.
- •Estimate concrete for round holes with the concrete column calculator, and bags with the concrete bag calculator.
- •Multiply the concrete for one post by the post count, and add extra for gate and corner posts that need deeper holes.
Estimating post cost
Cost = Posts × Price per post + Concrete or hardware + Caps + Labor
Example only: 4 posts at $22 each is $88. Post caps, brackets, concrete, rails and labor are extra. Gate and corner posts are often larger and cost more.
Troubleshooting post layout
| Problem | Likely cause | What to do |
|---|---|---|
| Last section is very short | Run does not divide evenly | Divide the run by the number of sections for an even spacing |
| Ran out of posts at the end | Forgot the extra post | Use sections + 1 |
| Corners have too many posts | Counted the shared corner twice | Subtract the shared post for each corner |
| Posts look uneven | Measured post to post and built up error | Mark all centers from one end with a long tape |
| Spacing is over the limit | Entered spacing in inches | Check the units and re-enter in feet |
| Gate opening is too narrow | Left no room for the gate hardware | Add the hinge and latch gaps to the opening |
Terms explained
| Term | Meaning |
|---|---|
| On center | Measured from the center of one post to the center of the next |
| Run | A continuous straight line of posts |
| Section | The gap between two neighbouring posts |
| Line post | A post along the run, between the ends |
| Corner post | A post where the run changes direction |
| Terminal post | A post at the end of a run or at a gate |
| Return | A short run that turns back from the main run |
| Footing | The concrete or base that holds a post in the ground |
Common post counter mistakes
- •Forgetting to add the extra post at the end.
- •Entering the spacing in inches in a feet field.
- •Counting a shared corner post twice.
- •Using the maximum spacing for posts that carry a heavy load.
- •Measuring the run from the outside edges instead of post centers.
- •Ignoring gates, which need two posts of their own.
Metric conversions
| From | To |
|---|---|
| 1 foot | 0.3048 metres |
| 8 ft spacing | 2.44 metres |
| 24 ft run | 7.32 metres |
| 6 inches | 152 millimetres |
| 100 ft | 30.48 metres |
Closed loop vs open run: the count changes
The single most common counting mistake is treating a closed perimeter like an open run. An open run; a fence line with two ends, needs one extra post to finish it, because both ends need a post. A closed loop, a fence that returns to where it started, has no ends, so every section shares its posts and the count equals the number of sections. The table below gives both counts so you can check the calculator's answer at a glance.
| Total length | Spacing | Open run (posts) | Closed loop (posts) |
|---|---|---|---|
| 50 ft | 8 ft | 8 | 7 |
| 50 ft | 6 ft | 10 | 9 |
| 100 ft | 8 ft | 14 | 13 |
| 100 ft | 6 ft | 18 | 17 |
| 150 ft | 8 ft | 20 | 19 |
| 150 ft | 6 ft | 26 | 25 |
| 200 ft | 8 ft | 26 | 25 |
| 200 ft | 6 ft | 35 | 34 |
Open run = sections rounded up + 1. Closed loop = sections rounded up. Example: a 100 ft open run at 8 ft spacing is 100 ÷ 8 = 12.5, rounded up to 13 sections, plus 1 end post = 14 posts. The same 100 ft as a closed square needs 13 posts.
A yard with several sides is neither a single open run nor a single closed loop until you decide how the sides join. Count each straight run separately, then subtract one post for every corner where two runs share a post. Two 40 ft sides counted separately at 8 ft spacing give 6 + 6 = 12 posts; joined at a corner they need 11. The fence calculator handles multi-run yards the same way, and the fence post calculator works out the concrete for each hole once the count is settled.
Post sizes and materials by project
The right post is the one that matches the load, the height and the ground it stands in. A 4x4 is plenty for a garden fence and hopeless for a 6 ft privacy fence in a windy spot. Wood is the default for fences and decks, steel for chain link and heavy gates, and T-posts for farm and temporary fencing. Check the product label and local code for the exact size your project needs.
| Post type | Typical use | Common spacing | Setting depth guide |
|---|---|---|---|
| 4x4 wood | Garden fences up to 4 ft, deck railings | 6-8 ft | 2 ft, or below frost line |
| 4x4 wood, heavy duty | Privacy fences up to 6 ft | 6-8 ft | 2-3 ft, or frost depth + 6 in |
| 6x6 wood | Tall privacy fences, pergolas, gates | 6-8 ft | 3 ft, or below frost line |
| Steel pipe / square tube | Chain link, metal fences, heavy gates | 8-10 ft | 2-3 ft in concrete |
| Steel T-post | Farm, wire and temporary fences | 10-12 ft | Driven 18-24 in into firm ground |
| Vinyl post | Vinyl panel fences | 8 ft (panel width) | 2-3 ft in concrete |
The depth rule of thumb is one-third of the post length underground, or the frost depth plus 6 in, whichever is greater. A 6 ft fence on a 9 ft post set 3 ft deep follows the one-third rule; in frost country the frost depth usually decides instead.
Post length follows from the depth: add the above-ground height to the buried depth, then buy the next standard length up. A 6 ft fence with posts set 30 in deep needs 8 ft 6 in of post, so you buy 9 ft or 10 ft posts and cut to length. Buying posts exactly the finished length is the classic beginner mistake. There is no post left to bury. Pressure-treated wood rated for ground contact is the right choice for buried posts; above-ground rated timber rots at the soil line within a few years.
Concrete per post: bags by hole size
Once the count is settled, the next question is how much concrete each hole takes. The hole is a cylinder, so the volume is 3.1416 × radius² × depth, and an 80 lb bag of premix yields 0.60 cu ft. The table below rounds every figure up to whole bags, because you cannot buy part of a bag and a hole that is short of concrete is a post that moves.
| Hole diameter | Hole depth | Concrete per hole (cu ft) | 80 lb bags per hole |
|---|---|---|---|
| 8 in | 24 in | 0.70 | 2 |
| 10 in | 30 in | 1.36 | 3 |
| 10 in | 36 in | 1.64 | 3 |
| 12 in | 36 in | 2.36 | 4 |
| 12 in | 48 in | 3.14 | 6 |
| 18 in | 48 in | 7.07 | 12 |
Hole volume before subtracting the post itself. A 4x4 post displaces about 0.25 cu ft over a 3 ft depth, so these bag counts are slightly generous, the safe direction. Gate and corner posts usually get larger holes and an extra bag.
Example: concrete for a 100 ft fence
- 14 posts at 8 ft spacing, each in a 12 in hole 36 in deep.
- Concrete per hole: 2.36 cu ft, so 4 bags of 80 lb premix.
- Total: 14 × 2.36 = 33.0 cu ft = 1.22 cu yd.
- Bags: 33.0 ÷ 0.60 = 55, rounded up to 56 bags.
- Add 2 spare bags for holes that dig wider than planned.
Example: bags vs ready-mix break-even
- A 200 ft fence with 26 posts in 12 in holes 36 in deep needs 26 × 2.36 = 61.4 cu ft = 2.27 cu yd, or about 103 bags.
- At that quantity, compare the bag total against a short-load ready-mix delivery before ordering.
- As a rule of thumb, once the job passes about 1.5-2 cu yd, ready-mix is usually cheaper and far less work than mixing 90+ bags by hand.
Counting posts for decks, pergolas and railings
The same counting rule works anywhere posts are spaced along a length: divide the length by the maximum spacing, round up to whole sections, and add one for an open run. A deck railing, a pergola and a fence all follow it, but the spacing and the post sizes change. Plan the railing with the deck railing calculator and the deck itself with the deck calculator.
Example: deck railing, 20 ft run
- Railing posts are usually spaced no more than 5-6 ft apart.
- At 5 ft spacing: 20 ÷ 5 = 4 sections, plus 1 = 5 posts.
- At 6 ft spacing: 20 ÷ 6 = 3.33, rounded up to 4 sections, plus 1 = 5 posts.
- Either way this run needs 5 posts, but at 6 ft spacing they sit 5 ft apart once evened out.
Example: pergola, 12 ft × 16 ft
- A 4-post pergola puts one post at each corner: 4 posts.
- A 6-post pergola adds a middle post on each 16 ft side: 6 posts.
- Use 6x6 posts for a pergola; 4x4 posts look thin and flex under a heavy beam.
- Each pergola post needs a proper footing below the frost line. Check the footing calculator for the size.
Railings have one extra rule the calculator cannot check: most codes limit the gap between railing posts and require a top rail that resists a sideways load, and deck posts must be bolted to the frame, not just nailed. Check the local code before you build, and remember that a gate in a railing or a fence always adds two gate posts, one on each side of the opening. See the gate planner for the opening layout.
Related tools
- •Fence calculator for fence posts, sections and rails
- •Fence post calculator for post-hole concrete
- •Concrete column calculator for round footings
- •Deck railing calculator for balusters
- •Gate planner calculator for gate posts and hardware
- •Perimeter calculator for the run length
Assumptions
- •Assumes one straight run with equal spacing, and that the spacing is on center. Posts are rounded up to a whole number, so the actual spacing is equal to or smaller than the number you enter.
- •Corners and returns need an additional post at each turn, which the calculator does not add. Gates, ends and obstacles are not included.
- •Spacing should follow your project's code or design requirement, such as structural rules for deck railings and pergolas.
Sources✓ Verified
- International Residential Code (IRC) Section R312, Guards. Strength and opening requirements for deck guards and railings, which affect post spacing and attachment.
- Fence and rail manufacturer installation guides. Maximum post spacing, post size and embedment for the product.
- American Wood Council, Prescriptive Residential Wood Deck Construction Guide (DCA 6). Deck post, guard and footing guidance.
- 811, Call Before You Dig. The national number to have underground utilities marked before any digging in the United States.
Formula reviewed November 2026.
Divide the run length by the post spacing, round up for the number of sections, and add one. A 24 ft run with posts every 8 ft has 3 sections and needs 4 posts.
With 8 ft spacing you need 14 posts, with 6 ft spacing 18, and with 10 ft spacing 11. Add posts for corners, gates and ends.
A run has a post at both ends, so there is always one more post than there are sections. Without the extra one, the last section would have no post.
It depends on the project. Fences are commonly 6 to 8 ft, chain link up to about 10 ft, and deck railings often about 6 ft. Follow your design, the product's instructions and local code.
With 6 ft spacing you need 5 posts, since 20 ÷ 6 = 3.33 rounds up to 4 sections. Deck railing posts must meet the code's strength requirements, so check your local rules.
Count each straight run, then subtract one for the corner post the two runs share. A closed rectangle shares four corner posts.
No. It counts a single straight run. Add or adjust posts for corners, gates and ends as described on this page.
Divide the run by the number of sections to get the actual spacing, then mark each post from one end. A 30 ft run in 4 sections is 7.5 ft apart.
Count the posts along each side at your design spacing, then check the structural plan. Pergola spacing depends on the beam size and loads, and often ranges from about 6 to 12 ft.
They are the same measure: the on-center distance between posts. The section's clear opening is slightly shorter, since it excludes the post's width.
From the center of one post to the center of the next. Mark the post centers on the ground with stakes and string before you dig.
Posts = ceil(fence length ÷ spacing) + 1 for a straight fence. The fence calculator also counts sections and rails.
No. Gates need two posts of their own, often larger and set deeper, and they replace any line posts inside the opening.
A common fence rule is about one-half to one-third of the post's above-ground height, and deeper in frost or soft soil. Deck railing posts are usually bolted to the framing instead.
Yes, but a closed loop needs as many posts as sections, because the first and last posts are the same. Subtract one from the calculator's result.
Converters to use with the Post Counter
Switch units, compare bulk and bagged quantities, or check coverage, without leaving BuildCova.
Volume, Area & UnitsCubic Feet to Cubic Yards ConverterDivide by 27: any volume in seconds.
Volume, Area & UnitsSquare Feet to Square Yards ConverterDivide by 9: carpet, turf and paving.
Slope & MeasurementFeet & Inches to Decimal Feet Converter5 ft 6 in = 5.5 ft, both directions.More general calculators
GeneralMaterial List CalculatorA material list calculator that turns your area, the coverage per unit from your product label and a waste percentage into the number of boxes, rolls, bags or buckets to order. It works for almost any coverage-based material, so one tool covers the flooring, the paint and the tile. Order off the label rate and the count matches what the box actually covers.
GeneralPool Volume CalculatorThis pool volume calculator works out the water volume of your pool in gallons and litres, for rectangle, round, oval or kidney shapes, so you order the right chemicals and know how long the pool takes to fill. Enter the dimensions and the shallow and deep end depths. A rectangular pool 32 ft by 16 ft, 3 ft deep at the shallow end and 8 ft at the deep end, holds about 21,065 gallons, and the page turns that volume into the chemical dose per 10,000 gallons.
GeneralMuck Away & Waste CalculatorA muck away calculator that works out what comes out of the hole and what it costs to take away. Enter the dig dimensions and soil type, and get the volume in the ground, the bulked-up volume once dug, the weight in tons, the grab-lorry loads, the skip requirements and the disposal cost. Dug soil swells, clay by 30% and rock by 60%, and the lorry is limited by weight as well as volume, so the calculator checks both and tells you which one binds.
GeneralSize to Weight CalculatorTurn any box size into a weight in seconds with this size to weight calculator, so you can check whether a load is safe to lift, ship or stack before you move it. Enter the length, width and thickness, pick steel, aluminum, wood, stone, concrete or plastic, or type in any density, and get the volume, the weight per piece and the total for your quantity in pounds, kilograms and tons.
GeneralAluminum Weight CalculatorWork out the weight of any aluminum plate, sheet, bar or pipe from its size and alloy with this aluminum weight calculator, so you can size supports, plan lifts and price a job without guessing at the weight. Aluminum weighs about a third of steel, 169 lb per cubic foot for 6061 against 490 for carbon steel, so the same part is far lighter. Pick the alloy, pick the shape, enter the size, and get the weight in pounds and kilograms, per piece and per foot.
GeneralMetal Weight CalculatorThe weight of any metal, any shape, from one page: this metal weight calculator covers them all, so you can price, lift and transport metalwork with a number you can trust. Pick the metal, carbon steel, stainless, aluminum, copper, brass, bronze, cast iron, titanium, zinc or lead, pick the shape, plate, round bar, square bar, flat bar, pipe or angle, enter the size, and get the weight in pounds, kilograms and tons, per piece, per foot and for the whole order.Was this calculator helpful?
Material requirements can vary based on product specifications and job conditions. Verify quantities with your supplier before ordering.