# Fence calculator > How many posts and boards does my fence need? Posts, rails, pickets and bags of concrete for a straight fence, with gates taken off the run. How many posts, rails, pickets and bags of concrete a picket fence needs from its length, height and post spacing, with gates subtracted from the run. - Page: https://how.box/fence/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/fence/?l={l}&s={s}&h={h}&u={u}&pw={pw}&g={g}&su={su}&r={r}&n={n}&gw={gw}&d={d}&y={y}&yu={yu} - `l` (number 0 to 10000): Fence run in u. Example: `20`. - `s` (number 0 to 10): Post spacing in u. Example: `2.4`. - `h` (number 0 to 10): Fence height in u. Example: `1.8`. - `u` (m or ft): Length unit: m or ft. Example: `m`. - `pw` (number 0 to 100): Picket width in su. Example: `9`. - `g` (number 0 to 100): Gap between pickets in su. Example: `1`. - `su` (cm or in): Picket size unit: cm or in. Example: `cm`. - `r` (whole number 1 to 6): Rails per section. Example: `3`. - `n` (whole number 0 to 20): Number of gates. Example: `1`. - `gw` (number 0 to 10): Gate width in u. Example: `1`. - `d` (number 0 to 5): Post depth in the ground in u. Example: `0.6`. - `y` (number 0 to 1000): Concrete per bag in yu. Example: `12`. - `yu` (l or ft3): Bag yield unit: l or ft3. Example: `l`. Example answer: https://how.box/fence/?l=20&s=2.4&h=1.8&u=m&pw=9&g=1&su=cm&r=3&n=1&gw=1&d=0.6&y=12&yu=l A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `fence_calculate`: Posts, rails, pickets and concrete for a straight picket fence. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fence_calculate","arguments":{"length":20,"spacing":2.4,"height":1.8,"unit":"m","picket_width":9,"gap":1,"size_unit":"cm","rails":3,"gates":1,"gate_width":1,"post_depth":0.6,"bag_yield":12,"bag_unit":"l"}}}` - GET: https://how.box/mcp/run/fence_calculate?length=20&spacing=2.4&height=1.8&unit=m&picket_width=9&gap=1&size_unit=cm&rails=3&gates=1&gate_width=1&post_depth=0.6&bag_yield=12&bag_unit=l ## How it works A fence is a row of equal sections between posts. The gates are taken off the run, and the rest is divided by the post spacing and rounded up to whole sections. A fence of n sections needs n + 1 posts, plus one more for each gate. Every section has the chosen number of rails, and the pickets cover the net length: one picket for every picket width plus gap. Example: 20 m of fence with one 1 m gate leaves 19 m. With posts every 2.4 m that is 8 sections and 10 posts, counting the gate post, and 8 × 3 = 24 rails. Pickets 9 cm wide with 1 cm gaps need 19 ÷ 0.10 = 190. Each post is 1.8 m of fence plus 0.6 m in the ground. A 0.3 m hole around a 0.1 m post takes about 36 litres of concrete, so ten posts take about 364 litres, or 31 bags of 12 litres. The calculator assumes a straight fence and a square 100 mm (4 in) post in a 300 mm (12 in) hole. A third of the post length in the ground, and at least 0.6 m (2 ft), is a common rule. Local rules, frost depth and wind decide the real design; for tall fences or poor soil ask a builder or your building authority. ## FAQ **How far apart should fence posts be?** Typically 1.8 to 2.4 m (6 to 8 ft). Closer posts give a stronger fence; many wooden panels and rails are made for 2.4 m. **How deep should fence posts be set?** About a third of the post's length, and at least 0.6 m (2 ft). Tall fences and soft ground need more, and frost depth matters in cold climates. **How many pickets do I need?** Divide the fence length by the picket width plus the gap, and round up. With 9 cm pickets and 1 cm gaps that is 10 pickets per metre. **How much concrete does a fence post need?** A 100 mm post in a 300 mm hole 0.6 m deep takes about 36 litres, around three 25 kg bags. Fast-setting concrete is mixed in the hole and needs no separate mixing. **How do I count the posts at a gate?** A gate hangs between two posts. The calculator takes the gate width off the fence run and adds one post per gate, because the gate opening needs one more post beyond those of the sections. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)