Fence Calculator
Find out how many posts, rails, and pickets you need to build a wood fence.
Fence details
Results
For a 100 ft fence at 8 ft post spacing, you'll need 14 posts, 39 rails, and about 209 pickets.
Posts needed
14 posts
That's a typical amount for a full residential backyard fence.
Order all posts and pickets from the same batch/run where possible — lumber tone and pressure-treatment color can vary noticeably batch to batch, and it's more visible across a full yard than on a short run.
Rails needed: 39 rails
Pickets needed: 209 pickets
Fence sections: 13 sections
How this works
Posts are calculated by dividing total fence length by post spacing to get the number of sections, rounding that up to a whole section, then adding one extra post — a fence with N sections always needs N+1 posts, a common source of under-ordering when people divide length by spacing and stop there. Rails are the section count multiplied by a rails-per-section figure that depends on your selected fence height category, since taller fences need more horizontal support to resist wind load and sagging. Pickets are calculated by dividing total fence length by the sum of picket width and the gap you leave between pickets, then rounding up, since a fence can't be built with a fractional picket. As with the other BuildyWork calculators, this models a single straight fence run — for a fence with corners, calculate each straight run separately and combine the results, subtracting one post per corner since corner posts are shared between the two adjoining runs. The unit toggle switches every input and result between imperial (feet, inches) and metric (metres, centimetres) — internally, every calculation always runs in the same canonical units (metres) regardless of which one you're viewing, so switching back and forth never introduces rounding drift into your entered values. All three counts (posts, rails, pickets) round independently and up, rather than being derived from one another — this matters because a fence length that divides evenly for posts won't necessarily divide evenly for pickets (post spacing and picket-plus-gap width are unrelated numbers), so each material's leftover fraction is handled on its own rather than assuming a clean fit across the whole structure. This also means the calculator's post spacing and picket width/gap fields are independent inputs: changing one doesn't automatically adjust the other, since in a real build the horizontal rails simply span between whatever posts you've set, and pickets are then nailed to those rails at whatever width and gap you choose, with no structural requirement that picket spacing line up with post spacing at all. Fence height itself only enters the math through the rails-per-section lookup — it doesn't change the post or picket count directly, which is why a short fence and a tall fence of the same length and picket spacing need the same number of posts and pickets, differing only in rails and, in practice, in post depth and footing size (neither of which this calculator estimates). Post spacing default (8 ft on-center): This Old House, "How to Build a Fence".
Worked example: a 100 ft privacy fence
A 100 ft wood privacy fence at the default 8 ft post spacing: 100 ÷ 8 = 12.5 sections, rounded up to 13 whole sections, needing 14 posts (13 + 1 end post). At the "tall" (6 ft+) rail default of 3 rails per section, that's 13 × 3 = 39 rails. For pickets at the default 5.5 in width plus a 0.25 in gap (5.75 in per picket unit), 100 ft = 1,200 in ÷ 5.75 in ≈ 208.7, rounded up to 209 pickets.
A second example: a shorter 40 ft yard-divider fence
A 40 ft fence at a tighter 6 ft post spacing (common for a shorter, lighter-duty divider fence): 40 ÷ 6 ≈ 6.7 sections, rounded up to 7 sections, needing 8 posts. At a "short" fence height default of 2 rails per section, that's 7 × 2 = 14 rails. Using the same 5.75 in picket-plus-gap unit as the first example, 40 ft = 480 in ÷ 5.75 in ≈ 83.5, rounded up to 84 pickets. Notice how much the rail count depends on height category alone — this fence has roughly half the length of the first example but far less than half the rails, purely because it's a shorter, lighter style needing fewer horizontal supports.
Common mistakes
Forgetting the extra end post
Dividing fence length by post spacing gives you the number of sections, not the number of posts — a fence always needs one more post than it has sections. This calculator adds that post automatically, but if you're cross-checking a supplier's quote by hand, this off-by-one is the single most common fence-material miscalculation.
Buying rails for a shorter fence than you're actually building
It's easy to default to 2 rails per section out of habit, even when building a 6 ft+ privacy fence that structurally needs a third mid-height rail to resist wind load and sagging over time. Match your rail count to your actual fence height category, not just the section count.
Not accounting for lumber shrinkage in wet-to-dry picket width
Pressure-treated lumber is often sold and installed while still damp, and shrinks slightly as it dries — a picket installed tight against its neighbor when wet can leave a visible gap once fully dry. If you're using a zero-gap "board-on-board" style, budget a small amount of shrinkage tolerance rather than calculating for a perfectly flush fit.
Measuring fence length in a straight line across uneven terrain
On sloped ground, the true fence length along the slope is longer than the flat horizontal distance between endpoints. For any meaningful grade, measure along the actual ground contour (or account for the slope with basic trigonometry) rather than a flat tape-measure line between the two endpoints, or you'll under-order material.
Ignoring local code and HOA height/setback rules before ordering material
Many municipalities cap residential fence height (commonly 4 ft in front yards, 6 ft in back yards) and require a minimum setback from the property line — ordering a full material list before confirming these local rules risks having to return or resize an entire order.
Skipping a call to 811 (or your local utility locate service) before digging post holes
Underground utility lines (gas, electric, water, cable) are often shallower than people expect, and hitting one while digging post holes is dangerous and can be expensive to repair. Most US areas require a free utility locate call before digging, regardless of how far the run is from a visible utility box.
Treating the picket count as the whole materials list
Pickets, rails, and posts are the core structural count this calculator produces, but a real order also needs fasteners (screws or nails, typically 2-3 per rail-to-post connection), post caps, concrete, and gate hardware if applicable. Use this tool's output as the lumber core of your list, not the entire shopping list.
Assuming the property line is exactly where you think it is
Building a fence a few inches over a property line is a common and avoidable dispute — a survey or at minimum a check of the property's plat map before digging post holes is worth the time, since moving an already-built fence is far more expensive than confirming the line up front.
When this calculator's model stops applying
- Fences with multiple straight runs and corners: this tool models a single straight run. Calculate each run separately and combine results, subtracting one shared post per corner from your combined post total (see the FAQ above).
- Sloped or stepped terrain: on a meaningful grade, either "racked" (rails follow the slope at an angle) or "stepped" (each section is level, with a small drop between sections) fence styles change how rails and pickets are cut and fitted — this calculator's flat-run math is a starting estimate, not a substitute for a site-specific plan on steep grades.
- Gates: gate openings need dedicated hardware and typically heavier posts than a standard section — subtract gate width from your total length and price gate hardware as a separate line item, not from this calculator's picket/rail output.
- Very tall fences (over 6 ft) or high-wind regions: these often need closer post spacing, deeper post footings, and additional rails beyond this calculator's "tall" default — check local code and manufacturer span tables rather than relying on the general default alone.
- Chain-link, vinyl, or metal fencing: this calculator's picket-width model is built for wood board fencing. Chain-link is sold by roll length and vinyl by pre-fabricated panel width, both of which follow different purchasing math than a per-picket count.
- Very short runs (under about 10 ft, such as a single gate-adjacent section): whole-post and whole-picket rounding has an outsized effect at this scale — double-check the rounded result against a simple hand sketch before ordering, since rounding up even one extra post is a larger fraction of a very short run's total cost.
- Fences that end against an existing structure (a house wall, an existing retaining wall, a neighbor's fence): the last "post" in the run may actually be a ledger board or bracket attached to that structure rather than a freestanding post, which changes both the post count and the hardware needed at that end — subtract one post from this calculator's output if one end terminates against a wall instead of a standalone post.
- Curved or serpentine fence layouts: this tool's post-spacing math assumes straight-line sections between posts. A curved run needs shorter, tighter post spacing than a straight run of the same length to keep the rails and pickets from binding, so treat this calculator's output as a floor, not an accurate estimate, for anything but gentle curves.
- Fences built on a shared property line with a neighbor: some jurisdictions and HOAs have specific rules about which side faces out, cost-sharing, and whether a survey is required before construction — none of which this calculator accounts for, since it only models material quantities, not legal or neighbor-relations requirements.
FAQ
Why does a 100 ft fence need more than 100/8 posts?
Because posts mark the boundaries between sections, not the sections themselves — a fence with 13 sections has 14 posts, one more than the section count, the same way a fence with a single section (one post-to-post span) still needs 2 posts, not 1. This calculator adds that extra end post automatically so you don't come up one post short at the last section.
Why does fence height change the number of rails?
Taller fences catch more wind load and need more horizontal support to resist sagging and racking over time. Fences up to roughly 4 ft typically use 2 rails (top and bottom); 6 ft privacy fences commonly add a third mid-height rail. Select your height category and the calculator adjusts the rails-per-section figure automatically.
What's a good gap to leave between pickets?
It depends on the style: a closed/shadowbox privacy fence typically uses a small 1/4-3/8 inch gap for airflow while still blocking sightlines, which is what this calculator defaults to. A "good neighbor" or open picket-and-gap style deliberately uses a much wider gap (an inch or more) for a less solid look and lower material cost — enter your intended gap manually if you're not building a closed privacy fence.
Does this calculator account for gates?
No — gate openings need their own hardware (posts sized for the gate's weight, hinges, a latch) and aren't simply a gap in the picket count. Subtract the gate's width from your total fence length before entering it here, and budget for gate hardware separately.
Should post spacing be measured post-center to post-center, or gap between posts?
On-center — measured from the center of one post to the center of the next, which is the standard convention in fence-building guides and lumber span tables. This calculator's post spacing input uses that same on-center convention, not the clear gap between post faces.
Why would I need a tighter post spacing than the 8 ft default?
Taller privacy fences (6 ft+) and fences in high-wind areas are commonly built with tighter post spacing (as low as 4-6 ft) to keep the panel from racking or the rails from sagging under wind load. Check your local code and lumber span tables if you're building taller than a standard 4 ft fence — 8 ft spacing is a reasonable default for shorter, lighter fences, not a universal figure.
Do I need extra posts for corners?
This calculator assumes a single straight run. A corner is effectively the end of one run and the start of another, so measure and calculate each straight run separately, then add the results together — a corner post is shared between the two runs (don't count it twice), so subtract one post from your combined total for each corner in the layout.
How deep should fence posts be set?
This calculator doesn't estimate concrete or post-hole depth, but common guidance is to set posts about 1/3 of their above-ground height into the ground (e.g. roughly 2 ft deep for a 6 ft fence), below the local frost line where frost heave is a concern. Check local building code, since minimum depth requirements vary by region and soil type.
Does picket width include the gap, or is the gap separate?
Separate — enter your picket's actual board width and the gap you intend to leave between boards as two different numbers. The calculator adds them together internally to figure out how many picket-plus-gap units fit into your total fence length.
Can I switch between imperial and metric partway through?
Yes — the unit toggle at the top of the calculator converts every field you've already entered, so you won't lose your measurements. Internally the tool always computes from the same canonical values (metres) regardless of which unit is currently displayed, so switching back and forth doesn't introduce rounding error into your result.
Why does the calculator round sections up instead of down?
Because a fence can't be built with a fractional section — if 100 ft of fence at 8 ft spacing works out to 12.5 sections, you need 13 full sections to actually cover the full 100 ft, even though the last section will be slightly under 8 ft wide. Rounding down would leave a gap in the fence line, so every section-count calculation in this tool rounds up, the same direction as the picket and post-count rounding.
Does post material (wood, metal, vinyl) change the post count?
No — the post count is driven entirely by fence length and spacing, not material. What material does change is the footing: a lightweight vinyl or aluminum post generally needs less concrete and a shallower footing than a heavy wood post supporting a tall privacy fence, and some manufactured vinyl systems specify their own required spacing that can be tighter or wider than this calculator's wood-fence default. Check your specific product's installation guide if you're not building with standard dimensional lumber.
How much should I add for waste when ordering pickets and rails?
This calculator gives you the exact count needed to cover the measured length — it doesn't build in a waste allowance. A common contractor rule of thumb is to add 5-10% extra material to cover cut mistakes, warped or damaged boards discovered at install time, and the ability to swap out a split picket without a return trip to the lumberyard. Add that percentage to the calculator's picket and rail totals yourself before ordering.
Does this calculator estimate concrete for post footings?
No — it estimates post, rail, and picket counts only, not concrete volume. A rough rule of thumb some installers use is one 50 lb bag of fast-setting concrete per post for a typical residential wood fence post hole, but the actual amount depends on hole diameter, depth, and post size, all of which vary by region and fence height. Confirm quantities against your specific post size and local frost-depth requirement rather than a flat per-post estimate.
What's the difference between this calculator's "short," "medium," and "tall" height categories?
They map to the standard rails-per-section convention used in wood fence framing: "short" and "medium" (roughly up to 4-5 ft) both use 2 rails per section (top and bottom), while "tall" (6 ft and up, the common privacy-fence range) uses 3 rails, adding a mid-height rail to resist wind load and panel sag. If your fence sits right at a boundary between categories, it's safer to select the taller category — an extra rail is a minor cost, while an under-built rail count risks sagging over time.
Why do the picket-width bounds only go up to 12 inches?
12 inches (a nominal 1x12 board) is the widest common flat picket or board size used in standard board-on-board or shadowbox wood fencing. Anything wider isn't standard dimensional lumber and would need custom milling, which this calculator's picket-based model isn't built around — treat a request for wider boards as a sign you're outside typical residential fence construction and should get a contractor quote instead.
Does this calculator work for a fence built entirely from pre-made panels instead of individual pickets?
Not directly. Pre-fabricated fence panels (common with vinyl and some wood systems) are purchased by the panel, sized to a fixed width set by the manufacturer, rather than by individual picket and rail counts. If you're using pre-made panels, divide your total fence length by the panel's stated width (rounding up) to get the panel count, and check the manufacturer's spec sheet for that panel's required post spacing rather than using this calculator's picket/rail math.
Related tools
Deck Board Calculatorif the same project includes a deck alongside the fence, work out deck boards from the deck's dimensions the same way this page counts fence materials.Siding Calculatorplanning a fuller exterior refresh — estimate siding squares for the house alongside your fence line.Driveway Sealer Calculatorrounding out an exterior maintenance weekend — estimate sealer for the driveway too.More exterior calculators (gate hardware estimator) are planned but not yet published.