Last updated October 8, 2026 · Report an error
Buying the wrong number of fence posts or rails means an extra trip to the supplier or materials sitting unused in the garage.
This calculator finds how many posts and rails a fence run needs based on its total length and your chosen post spacing.
How it works
Enter the total length of fence you're building, how far apart you want the posts spaced, and how many horizontal rails each section needs. The calculator divides the fence line into equal sections, adds one closing post, and multiplies the section count by the rails per section.
- Enter total fence length (ft).
- Enter post spacing (ft).
- Enter rails per section.
- Enter number of gates (optional).
- Click Calculate to see your results.
Examples
A 150 ft fence line
A 150 ft fence with posts spaced 8 ft apart needs 20 posts and, at 3 rails per section, 57 rails.
Who should use it
- Planning materials for a backyard privacy fence.
- Estimating a farm or ranch perimeter fence.
Industry applications
- Residential fencing and landscaping
- Agricultural and property-line fencing
Advantages
- Quickly estimates both posts and rails from just three inputs.
- Shows the full section-by-section math, not just the final counts.
Limitations
- Doesn't size pickets, concrete for post footings, or gate hardware.
Common mistakes to avoid
- Forgetting the extra closing post at the end of a fence run — the post count is always one more than the number of sections.
- Using a post spacing that doesn't match the width of pre-made fence panels, which forces cutting panels to fit.
Best practices
- Measure the actual fence line on-site rather than relying on a property survey, since obstacles and terrain can change the real path.
Tips
- Order 5-10% extra rails and pickets to account for cutting waste and any damaged pieces.