
Fence Calculator
Posts, rails and pickets needed for a fence of a given length.
Posts needed
20
19 sections
Rails
38
Pickets (~6in)
300
Sections
19
AI Breakdown & Smart Takeaway
Plain-English insight on your numbers
Get a personalized explanation of what these results mean — and how to improve them.
How the Fence Calculator works
The Fence Calculator helps homeowners, contractors, and landscapers quickly determine how many posts, rails, and pickets are needed to enclose or border a yard of any given length, eliminating the guesswork and costly over- or under-ordering of materials.
At its core, this calculator divides your total fence length by the chosen post spacing to determine the number of posts required, then uses the number of bays (the spans between posts) and the number of rails per bay to calculate total rail count. Pickets are calculated by dividing the total fence length by the width of a single picket plus its desired gap. Each of these three material types follows its own simple formula, but they are interdependent: changing post spacing directly affects the number of bays and therefore how many rails and pickets fall within each section.
Post spacing is the single most influential variable in the calculation. Standard residential fencing in the US typically spaces posts 6 to 8 feet apart on-center, with 8 feet being common for wooden privacy fences because it aligns with standard lumber lengths and minimizes waste. Closer spacing (4–6 feet) is used for heavier fencing styles, sloped terrain, or high-wind areas where additional structural support is critical. The calculator adds one extra post to account for the terminal (end) post at the far end of the fence line, ensuring you don't come up short.
Rail count depends on fence height and style. A standard 6-foot privacy fence uses three horizontal rails (top, middle, and bottom), while a shorter decorative or picket fence often uses two. The calculator multiplies the number of bays by the number of rails per bay to give a total rail count. A common mistake is forgetting that corner posts and gate posts each create new bays on both sides, which can significantly increase rail and picket quantities on a property with multiple corners or several gate openings.
For pickets, the calculator accounts for both the picket width and the spacing gap between adjacent pickets. A classic dog-ear picket is typically 3.5 inches wide (a 1×4 nominal board), and a standard gap is 0 to 0.5 inches for a privacy fence or 1 to 3.5 inches for a more open look. A frequent error is measuring in inconsistent units—mixing feet and inches—which causes significant calculation errors. Always convert everything to the same unit before calculating, and add 10–15% to your final material totals as a waste and breakage buffer before placing your lumber order.
Formula
Posts = ⌈length / spacing⌉ + 1
Pro tips
- Always add at least 10% to your calculated picket and rail quantities to account for boards with defects, cutting waste, and future repairs—lumber yards won't let you return cut pieces.
- For corner sections, treat each corner as the end of one fence run and the start of another; this ensures you count corner posts correctly and don't underestimate rails.
- Check local building codes before finalizing post spacing—many municipalities require specific post depths (typically one-third of post length buried) and may restrict fence heights near property lines or roads.
- When fencing a sloped yard, use the actual slope-adjusted run length rather than the horizontal distance; on a steep grade, the difference can account for several extra feet of material.
- Plan gate openings before calculating: each gate requires two dedicated gate posts set closer together (to match the gate width), and the opening itself removes pickets but not rails or posts from your total.
Key terms
- Post Spacing (on-center)
- — The distance measured from the center of one fence post to the center of the next, typically 6–8 feet for wood fencing.
- Bay
- — The open span of fencing between two adjacent posts, which determines how many rails and pickets are needed in each section.
- Picket
- — An individual vertical board or slat that forms the visible face of a fence panel, attached horizontally to the rails.
- Rail
- — A horizontal structural member that runs between posts and serves as the attachment point for pickets.
- Terminal Post
- — The end post at the start or finish of a fence run, which is always added as an extra post beyond the bay-based count.
- Picket Gap
- — The deliberate space left between adjacent pickets, which controls fence privacy, airflow, and overall material quantity.



