Fence Calculator (Posts, Rails & Pickets)
Work out how many posts, rails, and pickets a straight fence run needs from its total length, maximum post spacing, picket size, and rails per section.
- Posts needed
- 10
- Actual spacing between posts
- 2.22 m
- Rails needed
- 18
- Pickets needed
- 200
How it works
A fence run is divided into equal-width sections, each no wider than the maximum post spacing you'd want between posts — rather than using a fixed spacing and leaving a short, mismatched final gap, this calculator spreads the posts evenly: the number of sections is the smallest whole number that keeps every section at or under your maximum spacing, sections = ceil(fenceLength ÷ maxPostSpacing), which needs sections + 1 posts and gives an actual spacing of fenceLength ÷ sections — always at or under what you asked for. Rails scale directly with the number of sections (your chosen rails-per-section count × the number of sections).
Picket count is a standard start-aligned packing calculation: the first picket takes up its own width, and every picket after that adds one gap plus one more picket width, so the number that fit end-to-end along the run is floor((fenceLength − picketWidth) ÷ (picketWidth + picketGap)) + 1.
FAQ
Why does the actual post spacing come out slightly under my maximum?
Because posts are spread evenly across the whole run rather than placed at a fixed distance with a leftover gap at the end. If your fence length isn't an exact multiple of your maximum spacing, evening out the sections gives every gap the same, slightly-tighter-than-maximum width instead of one oddly short final section.
Does this account for corner posts on an L-shaped or rectangular fence?
No — this models a single straight run. A fence with corners needs a dedicated post at each corner regardless of spacing, then this calculator's math applied separately to each straight segment between corners; add the straight segments' totals together for the full job.
Related calculators
- Tip Calculator & Bill Splitter
- Password Entropy Calculator
- Paint Coverage Calculator
- Unit Price Comparison Calculator (Better Buy)
- Roman Numeral Converter
- Sleep Cycle Calculator
- Dilution Calculator (C₁V₁ = C₂V₂)
- 4-Band Resistor Color Code Calculator
- Chmod / Unix File Permissions Calculator
- Grade Needed Calculator
- Stair Calculator
- Great-Circle Distance Calculator
- Wind Chill Calculator
- Tire Size & Speedometer Error Calculator
- Depth of Field Calculator
- Delay Time Calculator (BPM to Milliseconds)
- Baseball Batting Stats Calculator (AVG, OBP, SLG, OPS)
- Concrete Calculator (Volume & Bags Needed)
- Golf Course Handicap Calculator
- Crosswind & Headwind Component Calculator
- Bicycle Gain Ratio Calculator
- Homebrew ABV Calculator
- Rowing Split & Power Calculator
- Guitar Fret Position Calculator
- Heat Index Calculator
- True Wind Calculator (Sailing)
- Knitting Gauge Calculator
- Baker's Percentage Calculator (Bread Dough Formula)
- Board Foot Calculator (Lumber Volume)
- Naismith's Rule Hiking Time Calculator
- Arrow Kinetic Energy & Momentum Calculator
- Wheelchair Ramp Slope Calculator (ADA Compliance)
- 3D Print Filament Weight & Cost Calculator
- Coffee Extraction Yield Calculator (SCA Brewing Chart)
- Candle Fragrance Load Calculator
- Climbing Fall Factor Calculator
- Cricket Net Run Rate (NRR) Calculator
- Density Altitude Calculator (Pilot Preflight)
- SMPTE Timecode Calculator
- Angle of View / Crop Factor Calculator
- Roof Pitch & Rafter Length Calculator
- Displacement Hull Speed Calculator
- Firewood Cord Calculator
- Scuba SAC Rate Calculator
- Guitar String Tension Calculator
- Wallpaper Calculator (Rolls Needed)
- Vehicle Braking Distance Calculator