GARDEN & LANDSCAPING 11 min read Updated November 22, 2026
How to Build a Post and Rail Fence

Use the tool as you read
The Gravel Calculator is free and needs no account.
Pro ($4.99/mo) saves the result into a project with folders, PDF packs and builder sharing.
Quick answer
To build a post and rail fence, set posts 1.8 to 2.4 metres apart in concrete, then fix two or three horizontal rails between them, with the rails on the side the animals or the view are on. A fence 30 metres long with posts every 2 metres needs 16 posts and 3 rails per bay, which is 45 rails of 3.6 metres if the rails span two bays. A post and rail fence suits a large garden, a field boundary or a paddock, because it is cheap, quick to build, and lets the wind through, so it rarely blows down.
Introduction
A post and rail fence is the simplest fence there is, and it is also one of the most useful. It marks a boundary, keeps animals in or out, and looks right in a large garden or a rural setting, without blocking the view or the wind. It uses far less timber than a panel fence, it is quick to build, and it is easy to repair, because a broken rail can be replaced without taking the fence down. It does not give privacy, and it will not keep a small dog in, but for a boundary where openness is a virtue, it is hard to beat.
The spacing of the posts decides the strength and the cost. Posts 1.8 metres apart make a strong fence that suits horses and cattle, because the rails are short and well supported. Posts 2.4 metres apart suit a garden boundary, because the rails are longer and fewer posts are needed, which saves time and money. Posts further apart than 2.4 metres let the rails sag and the fence looks slack, so 2.4 metres is the practical maximum for most rails.
This guide covers measuring the run, setting the posts, and fixing the rails so the fence is straight and level. It also covers the number of rails, because two rails suit a garden boundary, three rails suit a paddock, and four rails suit a fence that must contain sheep or small animals, and the choice changes the timber and the cost.
How to measure for a post and rail fence
Measure the fence length along the boundary, following any curves or corners, and mark the post positions with pegs. For a straight run, divide the length by the post spacing to find the number of bays: a run 30 metres long with posts every 2 metres has 15 bays and 16 posts, including one at each end. If the run does not divide evenly, adjust the spacing slightly so the bays are even, because a run with one short bay at the end looks like a mistake. A run 31 metres long with posts every 2 metres has 15 bays of 2 metres and one bay of 1 metre, so adjust the spacing to 1.94 metres for 16 even bays instead.
Measure the ground level at each post, because a post and rail fence follows the ground and the rails step down a slope. On a gentle slope, the rails can follow the ground in a smooth line, but on a steep slope the rails must step, with each bay level and a drop at each post. Mark the rail heights on the first post and use a string line to carry them along the run, so the fence looks deliberate rather than accidental.
Count the rails before you order. Each bay needs two, three or four rails, depending on the purpose, and each rail is usually 3.6 metres long, which spans two bays of 1.8 metres or one and a half bays of 2.4 metres. Rails that span two bays are fixed to the face of the posts, with the joints staggered so no two joints fall on the same post, which makes the fence stronger. Work out the total rail length by multiplying the fence length by the number of rails, then divide by the rail length to find how many rails to order.
You will need:
- Tape measure, string line and pegs, for marking the fence line and the post positions.
- A post hole digger and a spade, for digging the post holes.
- A spirit level, for checking the posts are plumb and the rails are level.
- Posts, rails, screws or nails, and a drill or hammer, for building the fence.
- Post mix or concrete, for setting the posts, plus braces to hold them plumb.
- A saw, for cutting rails to length, and gloves and eye protection.

How this estimate is calculated
The number of posts equals the fence length divided by the post spacing, plus one. The number of bays equals the number of posts minus one. The total rail length in metres equals the fence length multiplied by the number of rails per bay, and the number of rails to order equals the total rail length divided by the length of one rail, rounded up. Posts are set one third of their length in the ground, so a post 1.2 metres high above ground needs 600 millimetres below, giving a 1.8 metre post.
Worked example:
- Fence length: 30 metres, measured along the boundary.
- Post spacing: 2 metres.
- Posts needed: 30 / 2 = 15, plus 1 = 16 posts.
- Bays: 16 – 1 = 15 bays.
- Rails per bay: 3, for a paddock fence.
- Total rail length: 30 x 3 = 90 metres.
- Rail length: 3.6 metres, so rails to order: 90 / 3.6 = 25 rails.
- Add 10 percent for cuts and breakages: 25 x 1.10 = 27.5, so order 28 rails.
- Post length: a rail fence 1.2 metres high needs posts 1.8 metres long, with 600 millimetres in the ground.
If the rails are fixed to the face of the posts rather than between them, the rail length calculation stays the same, but the joints should be staggered so they do not all fall on the same post. If the rails are cut to fit between the posts, each rail is the bay length, 2 metres, and the number of rails is the number of bays multiplied by the rails per bay, which is 15 times 3, or 45 rails of 2 metres, which wastes more timber than the face fixed method.
Step-by-step
- Measure the fence length and mark the post positions with pegs, spacing them evenly.
- Dig a hole for each post, one third of the post length deep, and set the end posts first.
- Run a string line between the end posts and set the intermediate posts to the line, checking each is plumb.
- Brace the posts and pour in the concrete, leaving 24 hours for it to set.
- Mark the rail heights on the posts, starting with the top rail 100 millimetres below the top of the post.
- Fix the rails to the face of the posts, staggering the joints so no two fall on the same post.
- Check the rails are level and the fence is straight, then trim any rails that stick past the end posts.
- Stain or paint the fence to protect the timber, and check the fixings after the first month of use.

Materials and costs
Posts for a post and rail fence are usually 100 by 100 millimetres or 125 by 100 millimetres, and 1.8 metres long for a fence 1.2 metres high. Rails are usually 100 by 38 millimetres or 150 by 38 millimetres, and 3.6 metres long, so they span two bays. Timber should be pressure treated, because untreated timber in contact with the ground rots within a few years, and a post and rail fence has more timber in contact with the ground than a panel fence. Hardwood posts last longer but cost more, and concrete posts are an alternative that never rots, though they suit a field more than a garden.
As an illustrative example, a treated softwood post 1.8 metres long might cost around $10 to $18, or about £8 to £14, or €9 to €16. A treated rail 3.6 metres long might cost around $8 to $14, or about £6 to £11, or €7 to €13. Post mix might cost around $6 to $10 per 20 kilogram bag, or about £5 to £8, or €5.50 to €9, and each post needs 2 to 3 bags. On those figures the 30 metre fence in the worked example costs roughly $400 to $650 for posts, rails and concrete, which is far cheaper per metre than a panel fence.
Fixings should be galvanised screws or nails, because ordinary steel fixings rust and stain the timber. Screws are better than nails for rails, because they can be removed if a rail needs replacing, and they hold better in timber that moves with the weather. Use two screws at each rail to post joint, so the rail cannot twist, and pre drill the rails to stop them splitting at the ends.

Two rails, three rails or four
Two rails suit a garden boundary where the fence marks the line and keeps people out, but does not need to contain animals. The rails are usually set with one near the top and one near the bottom, leaving a gap in the middle that looks open and lets the wind through. A two rail fence is the cheapest and the quickest to build, and it suits a large garden where the boundary is long and the cost per metre matters.
Three rails suit a paddock or a field where horses or cattle are kept, because the extra rail closes the gap and stops animals pushing through. The rails are spaced evenly, with the top rail near the top of the post, the bottom rail near the ground, and the middle rail halfway between. A three rail fence is the standard for a paddock, and it is strong enough for most livestock if the posts are set well and the rails are fixed firmly.
Four rails suit a fence that must contain sheep, goats or small animals, because the gaps are small enough that they cannot push through. The rails are spaced about 250 millimetres apart, and the bottom rail sits close to the ground. A four rail fence uses a third more timber than a three rail fence, and it looks more solid, which suits a small paddock or a garden where a dog must be kept in. For a garden dog, a post and rail fence with wire mesh fixed to the rails is often a better answer than a fourth rail, because the mesh closes the gaps completely.

Common mistakes
Spacing posts too far apart
Posts more than 2.4 metres apart let the rails sag and the fence looks slack. Keep the spacing to 1.8 or 2 metres for a strong fence, and adjust the spacing so the bays are even.
Setting posts too shallow
A post with only 300 millimetres in the ground will lean in wind, because a post and rail fence has no panels to brace it. Dig one third of the post length deep, every time.
Fixing all rail joints on one post
Rails whose joints all fall on the same post make a weak point in the fence. Stagger the joints so they fall on different posts along the run.
Nailing rails without pre drilling
Rails split at the ends when nails are driven close to the end grain without a pilot hole. Pre drill the rails and use two screws at each joint to stop twisting.
Forgetting the wind
A post and rail fence lets the wind through, which is its strength, but a solid board fixed to the rails turns it into a sail. Do not fix boards or mesh that blocks the wind without strengthening the posts.
Frequently asked questions
How far apart should post and rail fence posts be?
Space posts 1.8 to 2.4 metres apart. A spacing of 1.8 metres suits a paddock with animals, and 2.4 metres suits a garden boundary. Further apart than 2.4 metres lets the rails sag.
How many rails do I need for a post and rail fence?
Allow two rails per bay for a garden boundary, three for a paddock, and four for sheep or small animals. A 30 metre fence with 15 bays and three rails needs 90 metres of rail, which is 25 rails of 3.6 metres before waste.
How deep should post and rail fence posts be?
Dig one third of the post length deep. A post 1.8 metres long needs 600 millimetres in the ground, and a post 1.5 metres long needs 500 millimetres.
Can I build a post and rail fence on a slope?
Yes, the fence follows the ground, with the rails stepping down at each post on a steep slope, or following the ground in a smooth line on a gentle slope. Mark the rail heights with a string line so the steps look even.
How long does a post and rail fence last?
A treated softwood post and rail fence lasts 10 to 15 years, and longer if the timber is stained and the posts are set in concrete with drainage. Hardwood posts last longer, and concrete posts last far longer still.
What is the cheapest fence to build?
A post and rail fence is one of the cheapest fences per metre, because it uses far less timber than a panel fence and the rails are cheap. A two rail fence on a long boundary costs a fraction of a panel fence of the same length.
Related tools
Gravel Calculator
Garden & Landscaping · Estimate gravel volume and optional weight for an area.
Mulch Calculator
Garden & Landscaping · Estimate mulch volume and bags for garden beds.
Topsoil Calculator
Garden & Landscaping · Work out how many cubic metres of topsoil you need from the area to cover and the depth of topsoil.
Turf Calculator
Garden & Landscaping · Work out how many rolls of turf you need for a lawn from its area, the coverage of one roll and a waste allowance.
Related guides

How to Water a New Lawn
Quick answer Water a new lawn little and often, keeping the top few centimetres of soil damp until the grass is established, then water…

How to Topdress a Lawn
Quick answer Topdress a lawn in early autumn by spreading a thin layer of topsoil and compost, about 5 millimetres deep, over the grass…

How to Test Your Garden Soil
Quick answer Test your garden soil by squeezing a handful to find whether it is clay, sand or loam, checking the drainage with a…

How to Store Topsoil Before You Use It
Quick answer Store topsoil in a heap no more than 1 metre high, on a dry level spot, covered with a tarp to keep…