Fence on a Slope Calculator

Ground that falls three feet across a fifty foot run does not look like a problem until the panels are ordered. Then the choice is a fence with a level top and a widening gap beneath it, or a fence that follows the ground and needs panels that can be pushed out of square.

Horizontal distance from the top post to the bottom post
Height difference between the two ends. A level and a long straightedge, or a string line and a tape.
Panel width, or your maximum post spacing for a built-in-place fence
Height of the panel or boarding itself
Deliberate gap at the high end of each bay so the boards are not sitting in soil
How far a preassembled panel can be pushed out of square across its width. Rigid welded or framed panels are close to zero.
Optional, only used to total the post length. Frost depth governs this in cold climates and is local — ask, do not copy a number.
Fence on a Slope Calculator — Stepped or Racked PanelsBuildFigure

Two ways down a hill, and they look nothing alike

A fence crossing sloping ground is built one of two ways. In a stepped fence every bay is level and each one starts lower than the last, so the top of the fence is a staircase. In a racked fence the rails run parallel to the ground while the pickets stay plumb, so the fence follows the slope in a straight line and the panel is a parallelogram rather than a rectangle.

The arithmetic that separates them is one number: the drop per bay, which is the total fall divided by the number of bays. Everything else follows from it. In a stepped fence, that drop is the height of the step at every post, and it is also the extra gap that opens under the downhill end of every panel. In a racked fence, that same drop is how far out of square the panel has to be pushed, which is what the manufacturer means by rackability.

The gap under a stepped fence

This is the part people do not picture. A level panel over ground that falls sits tight to the ground at its uphill end and floats above it at the downhill end. The space beneath is a triangle: half the bay width times the step. On eight foot bays with a five inch step that is about 1.7 square feet per bay, and on a fifty foot run of six bays it is ten square feet of continuous opening at ground level.

For a boundary fence that is aesthetic. For a fence that is meant to contain a dog or exclude a rabbit it is the whole fence failing, because an animal does not need the average gap, it needs the biggest one, and the biggest one repeats at every post. The usual remedies are a gravel board or kickboard fitted below the panel and scribed to the ground, a stone-filled trench along the line, or abandoning the stepped approach and racking instead.

Narrowing the bays helps in a way that is easy to miss: the step is the total fall divided by the bay count, so going from eight foot bays to six foot bays on the same run cuts the step by a quarter and cuts the triangular gap by roughly a third, because both the width and the height of the triangle come down.

Racking, and what will not rack

Racking works when the picket-to-rail connection can pivot: a single fastener per picket per rail, or a rail slot with room in it. A fence built board by board on site racks by definition, because you set the rails to the slope and hang the pickets plumb off them. Preassembled panels vary enormously. Some are supplied specifically as rackable with a stated allowance across the panel width. Others are welded, glued, framed or braced and are effectively rigid, and forcing them tears the fasteners out or splits the pickets at the fixing.

Fence typeRacks?What limits it
Built on site, rails then picketsFreelyNothing, you set the rail angle
Rackable panel, single fastener per picketTo a stated allowanceThe allowance, and picket edges closing up
Framed or welded panelNoThe frame is a rectangle and stays one
Chain link fabricFreelyNothing, the fabric is a diamond mesh already

Note the last row. Chain link is the one common fence that neither steps nor racks in any awkward sense, because the fabric conforms to whatever line the top rail and tension wire take. On a slope it is the easy material and the reason so many sloping boundaries are chain link.

Posts, and the length you forgot to add

A stepped fence needs longer posts than a level one. Each post carries the bottom of the bay above it and the top of the bay below it, so it stands one full step higher above its own ground level than a post on flat ground would. Order the posts for a stepped fence at the fence height, plus your clearance, plus one step, plus whatever goes below grade — and then round up to a stock length, because a post that is two inches short is firewood.

How far below grade is a local question this page deliberately leaves open. In cold climates frost depth governs it and frost depth is set where you live; asking locally is the only correct answer and copying a depth from a page written somewhere else is how posts heave. The fence post calculator takes the depth as your input and works out the concrete, and the concrete footing calculator handles a larger footing if the slope means one post is carrying more than the others.

Where the run reaches level ground, the privacy fence board calculator divides it into bays and spaces the boards, and any opening in a sloping run wants the gate sag and brace calculator, since a gate on a hill has to clear the highest ground it swings over rather than the ground where it hangs. For measuring the fall in the first place, the slope and grade calculator converts between rise, run, percentage and degrees.

Questions people ask

Stepped or racked — which should I use?

Racked, if your fence can rack and the slope is steady, because it leaves a constant gap at the bottom and no staircase at the top. Stepped, if you are using rigid panels, if the ground is irregular rather than evenly sloping, or if you want the top of the fence level for appearance. The one situation where stepped is clearly wrong is a containment fence on a slope, because the triangular gaps under the low corners are exactly where an animal goes. The one situation where racked is clearly wrong is a panel the manufacturer says is not rackable, where forcing it destroys the panel without telling you it has.

How do I measure the fall accurately?

A string line and a line level, pulled taut from the high post position to the low one, then measure from the string down to the ground at the low end. That is the total fall for the run and it is the only number the layout needs. A long spirit level on a straightedge, leapfrogged down the slope, works too and is more tedious. What does not work is estimating from the look of the ground, because a slope reads as much shallower than it measures. Also take intermediate readings if the ground is not a straight fall, since a run that dips in the middle needs the bays worked out in two segments rather than one.

Can I put a level fence over sloping ground and fill the gap?

Yes, and it is a common and reasonable approach on a modest fall. A gravel board, kickboard or retaining board follows the ground under the panels and is cut to the wedge shape the gap makes. It has to be a material that tolerates ground contact, since it sits in soil and moisture by definition. On steeper ground the wedge becomes deep enough that it is really a low retaining wall, at which point it is carrying soil rather than filling a gap and needs to be built as one.

Does racking change the fence height?

Measured vertically at any post, no, the pickets are still their own length and still plumb. What changes is the panel geometry: the rails are slightly longer than the horizontal bay spacing because they run along the slope rather than across it, and the panel as a whole is a parallelogram whose top and bottom edges are no longer square to the pickets. On a preassembled rackable panel this is handled by the manufacturer and the pickets are cut to suit. On a site-built fence, cut the pickets after the rails are up rather than before.

What happens where the slope changes direction?

Put a post there. A change of grade is treated exactly like a corner: the bay above it and the bay below it are separate runs with their own fall, their own bay count and their own drop per bay, and trying to average across the transition gives a fence that touches the ground in the middle and floats at both ends. Run this calculator once for each segment. The same applies where the run crosses a swale or a mound rather than a steady grade, which is more common on real ground than an even slope is.

Related