Fence estimate calculator
A 100 foot run, 6 feet high with posts every 8 feet, takes 14 posts, 39 rails and 301 pickets. Add the prices the lumber yard gave you and get the material list with a total per line. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Length
- 100
- Height
- 6
- Post spacing
- 8
- Post price
- 12
- Rail price
- 8
- Picket price
- 2.5
- Picket width
- 3.5
- Picket gap
- 0.5
- Rails per section
- 3
- Sections
- 13
A fence estimate is a bill of materials, not a single panel count: you need whole posts, rails, and pickets plus a currency total at the prices the lumber yard already quoted. This fence estimate calculator takes the perimeter length in feet, the finished fence height in feet, the centre-to-centre post spacing in feet, and unit prices for posts, rails, and pickets, then returns piece counts and a line-item total. Posts follow the open-run rule of one extra end post; rails per bay default from height; pickets pack along the run with a typical one-by-four face and half-inch gap unless you override those inches.
How posts, rails, pickets, and total cost are computed
Treat the fence as an open run whose length is the perimeter you must cover. Divide that length in feet by the centre-to-centre post spacing in feet; the bay count sections is the ceiling of that ratio, and posts is sections plus one so both ends of the run have a post. Pickets pack along the same run in inches: convert length to inches, add the trailing-gap correction, and divide by the pitch of one picket face plus one gap.
The purchase quantity pickets is the ceiling of that exact ratio, so a fractional leftover still costs a whole extra board, and the last picket has no trailing gap. A one-hundred-foot, six-foot-high run at eight-foot spacing with default three-and-a-half-inch pickets and a half-inch gap yields thirteen bays, fourteen posts, thirty-nine rails, and three hundred one pickets. The path is deterministic floating-point arithmetic with no random seeds, no wall-clock timestamps, and no network.
Zero picket gap is a legal privacy layout; a zero or negative perimeter length is not, because a fence with no run cannot have a material list.
Where a fence estimate calculator earns its keep
Homeowners planning a weekend picket run reach for a fence estimate when the lumber yard asks how many posts, how many rails, and how many pickets, and what those pieces cost at today's stickers, not how many abstract panels sit in a spreadsheet. Typing one hundred feet of perimeter, six feet of height, eight-foot spacing, and three unit prices yields a takeoff you can compare against a delivery quote without opening a mixed-unit workbook.
Remodelers choosing between a three-and-a-half-inch one-by-four face and a five-and-a-half-inch one-by-six face re-run the same length and height to see how the picket count and picket line move when the pitch changes; that is a materials decision, not a waste-percent decision. Contractors bidding a simple rectangular yard can enter the summed side lengths as one perimeter and pin the goldens in tests so a takeoff script and a phone check never disagree on whether fourteen posts cover one hundred feet at eight-foot centres.
Trade-school modules on exterior carpentry can freeze the one-hundred by six by eight case because the arithmetic is deterministic. This landing is the search for a fence estimate as a combined bill of materials and cost from dimensions and unit prices. A post-only count, a picket-only count, or a cost that starts from quantities you already know answers a different query and should not share this page.
What you can do with it
One-by-four versus one-by-six pickets
Re-run the same perimeter and height with a 3.5-inch face and a 5.5-inch face to see how pitch changes the picket count and the picket line of the estimate.
Contractor bid from summed side lengths
Pin a 100-foot, 6-foot, 8-foot goldens case in a takeoff script so the phone check and the bid line agree on whole pieces and total cost.
FAQ
What happens if the perimeter length is zero or negative?
A non-positive length cannot describe a fence run, so the calculator refuses to invent piece counts and is not billed.
Does a closed yard use one fewer post than an open run?
This estimate uses the open-run rule posts = sections + 1, which is conservative by one post if you unroll a closed perimeter. Enter the summed side lengths; the extra post is a small overage, not a closed-loop subtraction.
How many posts and pickets do I need for a 100 foot fence?
At 6 feet high with posts every 8 feet, you need 13 bays, 14 posts, 39 rails and 301 pickets, using 3.5 inch pickets with a 0.5 inch gap. Change the spacing or picket size and the counts follow.
How many rails go in each section?
If you leave it blank, about one rail for every two feet of height, never fewer than two. A 4 foot picket fence gets 2 rails per bay and a 6 foot privacy fence gets 3.
Can I use wider pickets or no gap at all?
Yes. Enter 5.5 inches for a 1×6 face instead of the default 3.5, and a gap of zero for a privacy fence with boards touching. The picket count and total length update with the new spacing.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/build/fence-estimate \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"length":100,"height":6,"post_spacing":8,"post_price":12,"rail_price":8,"picket_price":2.5}'const res = await fetch("https://api.kit.forhosting.com/build/fence-estimate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"length": 100,
"height": 6,
"post_spacing": 8,
"post_price": 12,
"rail_price": 8,
"picket_price": 2.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/build/fence-estimate",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"length": 100,
"height": 6,
"post_spacing": 8,
"post_price": 12,
"rail_price": 8,
"picket_price": 2.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/build/fence-estimate", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"length":100,"height":6,"post_spacing":8,"post_price":12,"rail_price":8,"picket_price":2.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"length":100,"height":6,"post_spacing":8,"post_price":12,"rail_price":8,"picket_price":2.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/build/fence-estimate", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"length": 100,
"height": 6,
"post_spacing": 8,
"post_price": 12,
"rail_price": 8,
"picket_price": 2.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "build.fence_estimate",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
A non-positive length is rejected with invalid_input so a typo never invents a free fence. The same pure arithmetic powers the free browser tool and the API path, so a Saturday sketch matches the line a purchasing script posts later.
How posts, rails, pickets, and total cost are computed
Rails are sections times rails_per_section. When you omit rails_per_section the calculator chooses it from height: about one horizontal rail every two feet of finished height, never fewer than two, so a four-foot picket fence uses two rails per bay and a six-foot privacy fence uses three. Each picket is assumed to be cut to the fence height, which is why picket_length_ft equals height and picket_linear_feet equals pickets times height. Line costs are posts times post_price, rails times rail_price, and pickets times picket_price; total_cost is the sum of those three lines, rounded to two decimal places.
What you send, which units apply, and how errors behave
Send six required finite numbers. length is the perimeter in feet along the run; it must be strictly positive, and a zero or negative value fails with invalid_input naming length. height is the finished fence height in feet, used as picket length and as the default for rails per bay. post_spacing is the centre-to-centre distance in feet between posts; typical residential bays are six or eight feet. post_price, rail_price, and picket_price are unit prices in the same currency, one number per piece, and may be zero when you only want counts. Optional picket_width and picket_gap are inches: three-and-a-half inches is the default face of nominal one-by-four stock, and half an inch is the default gap; zero gap is allowed for a butt-tight privacy fence. Optional rails_per_section is a positive integer that overrides the height-based default. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not charged. On success the JSON echoes the cleaned inputs, the whole counts sections, posts, rails, and pickets, picket_length_ft, picket_linear_feet, pickets_exact, coverage_length_ft, the three line costs, total_cost, plus a unit_note, a formula string, method open_run_posts_rails_pickets, and a short message so logs can document the algorithm. API pricing is the published base of $0.002 per successful item; validation failures do not consume prepaid balance.
Where a fence estimate calculator earns its keep
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance. Keep requests small, pin posts, rails, pickets, and total_cost in tests, and you get a reproducible estimate for quotes, purchase orders, and edge workers without standing up a CAD kernel of your own.
Integration use cases
Weekend picket-fence takeoff
Enter perimeter and height in feet, eight-foot post spacing, and three unit prices to get posts, rails, pickets, and total_cost before you visit the lumber yard.
Technical questions
How does the fence estimate count posts, rails, and pickets?
sections is ceil(length / post_spacing). posts is sections plus one (open run). rails is sections times rails_per_section, which defaults from height. pickets is ceil((length in inches plus picket_gap) / (picket_width plus picket_gap)). total_cost is the three quantity times unit-price lines.
What units do length, height, post_spacing, picket_width, and picket_gap use?
length, height, and post_spacing are feet. picket_width and picket_gap are inches (defaults 3.5 and 0.5). Unit prices are currency per piece in one currency. The response reports picket_linear_feet in feet.
What does the fence estimate calculator cost?
The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.