Fence Rail Calculator

Enter fence length and post spacing to count the rails and posts.

How it is calculated

The tool counts the parts for a straight fence run. sections = ⌈L ÷ S⌉, posts = sections + 1 and rails = sections × R, where L is the total fence length, S the spacing between posts, R the number of rails per section, and ⌈ ⌉ means rounding up to the next whole number. Use the same length unit for L and S. If the spacing is left empty or zero the tool assumes 8 (feet), and if rails per section is empty or below 1 it assumes 2. Length must be above zero. The count is for one straight line: corners, gates and end or corner posts needing extra bracing are not added, and rail lengths and waste are not considered.

Worked example

You want to fence 100 ft with posts every 8 ft and three rails per section. Step 1: 100 ÷ 8 = 12.5, rounded up to 13 sections. Step 2: posts = 13 + 1 = 14. Step 3: rails = 13 × 3 = 39. The tool shows 14 posts, 13 sections and 39 rails. The 13 sections cover 104 ft, so the last section is shorter or you can stretch the spacing slightly. If the length were 96 ft instead, 12 exact sections would need 13 posts.

Try this example →

Common mistakes

  • Counting one post per section: a straight run always needs one more post than sections, since both ends need a post.
  • Dividing the length by the spacing and not rounding up; 12.5 sections still needs a 13th section and its post.
  • Leaving the spacing blank and not noticing that the tool assumed 8 ft, which is wrong if you use a different spacing or work in metres.
  • Mixing units, such as a length in metres and spacing in feet, which gives a meaningless section count.
  • Forgetting extra posts for gates, corners or a closed loop; for a closed loop, posts equal sections, not sections plus one.

About this calculator

The math behind a fence run is simple counting geometry: posts = (fence length ÷ post spacing) rounded up, plus one extra post to close the last section; sections = posts − 1; and total rails = sections × the number of rails per section (2 for a basic two-rail fence, 3 for a heavier ranch-style rail fence). Rounding up on posts matters because a fractional spacing at the end still needs a full post.

Fence contractors and DIY homeowners use this before a materials run to a lumber yard, so they buy the right count of posts, rails and hardware for a picket, ranch-rail, or privacy fence without over- or under-ordering — and to get an accurate labor and cost estimate before a job starts.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators