Plan the grade before placing posts

How to Build a Fence on a Slope

A stepped fence keeps each panel level and changes height at the posts. A racked fence follows the slope with angled rails and plumb pickets. Measure horizontal run and vertical rise first: use horizontal width for bay counts and picket gaps, and slope length for racked rails and fabric. Check your panel system’s rack limit before choosing the layout.

Measure the run and the rise

The horizontal run, H, is the distance along the fence line as seen on a level plan. The rise, R, is the vertical elevation difference between its ends. Measuring with a tape resting on the hill gives a sloping distance, which is longer than the horizontal run. Record the two measurements separately so that you can calculate both the plan layout and the material length.

For a short section, set a string line level from the uphill point toward a stake at the downhill end. Check it with a line level, measure the level string’s horizontal length, and measure vertically from that string down to the ground at the low end. The string must reference the ground elevation at the high end; subtract any offset above that point. Keep the vertical measurement plumb and avoid letting a sagging string define your level.

For a longer hill, use manageable level segments or a survey level and record where each segment begins. Add horizontal distances to get the total run. Note elevation changes at planned posts as well as at the ends. A single run-and-rise pair describes a straight, constant grade: a dip, hump or change in direction needs its own segment. An average slope can hide a much larger clearance under one panel.

Use the same units for H and R. Grade is R / H; multiply by 100 to express it as a percentage. The angle in degrees is atan(R / H) × 180 / π. In this guide’s example, H = 48 ft and R = 4 ft, giving a grade of 8.33% and an angle of 4.76°. A percentage grade and an angle in degrees are different quantities.

Stepped vs racked: choose the shape of the fence

With stepping, the top and bottom of each rectangular panel stay level. The next panel starts higher or lower at the shared post, making a staircase along the hill. On a straight grade, a level bottom leaves a wedge-shaped opening: smallest at the uphill end of each bay and largest at its downhill end. The opening starts over at the next panel; it does not keep growing across the entire fence.

With racking, the rails tilt to follow the ground while the posts and pickets remain vertical, or plumb. The bay becomes a parallelogram. On a uniform grade, this can keep the bottom clearance more consistent along the run. Individual boards on a site-built frame allow this geometry when the framing and connections are designed for it. A factory panel must be built to rack; its joints cannot be assumed to rotate.

Stepped: level panels Gap grows toward the low end of each bay Racked: sloping rails, plumb pickets
Stepped panels stay level and leave triangular gaps above sloping ground. Racked rails follow the slope while posts and pickets stay plumb. Diagram is not to scale; bottom clearance is illustrative.

Choose stepping when the selected panel system calls for level sections and its resulting ground gaps suit the site. Consider racking when following the terrain and controlling those gaps matter, provided the product supports the measured slope. Check the view from both ends of the yard before ordering: level panels create separate horizontal top lines, while racked bays create a continuous inclined line.

Calculate step height per bay

Start with the maximum horizontal post spacing allowed for the chosen layout. The bay count is bays = ceil(H / spacing), where ceil means round up to the next whole bay. If you distribute those bays equally, each horizontal bay width is H / bays, and each step is R / bays. These equal steps assume the ground rises uniformly.

For the 48 ft horizontal run, 4 ft rise and 8 ft maximum spacing, the calculation gives 6 bays. Each bay is 8 ft horizontally, and the rise per bay is 0.667 ft, or 8 in. The level panels therefore step by 8 in at each change in bay elevation. A shorter final bay or irregular ground requires a separate rise measurement for that bay.

If you set the uphill bottom of a level panel at your chosen ground clearance, the clearance at its low end increases by one step. Here, that adds 8 in to the selected uphill clearance within each bay. This is an increase, not the total opening under the fence. The actual opening also includes the clearance you left at the uphill end and any local hollow in the ground.

The low-side post must reach the connections of the higher, level panel from lower ground. Allow for that extra above-ground length before cutting posts or choosing stock sizes. A shared post may carry two panels at different elevations, so mark both connection heights. Keep the required embedment as a separate dimension; shortening the buried portion to gain height changes the post support. Use the post depth calculator to plan the hole dimensions separately.

Calculate racked rail length and slope length

The run and rise form the short sides of a right triangle. Its long side is the slope length: S = √(H² + R²). For H = 48 ft and R = 4 ft, S = 48.166 ft. This is the straight sloping distance between the measured endpoints. On uneven terrain, calculate each straight segment and add those slope lengths.

Apply the same calculation to one bay. With horizontal bay width b and rise per bay s, rail length = √(b² + s²). The worked bay uses b = 8 ft and s = 0.667 ft, producing a racked rail line of 96.33 in. A rail that is exactly 96 in long cannot span those same horizontal endpoints at this angle.

These dimensions describe the layout line. A finished rail cut also depends on whether you measure between post faces, to post centers or into a routed pocket. Add or subtract the connection allowances required by the system after establishing the slope geometry. Do not treat a nominal panel width as both a horizontal post spacing and an available sloping rail length.

Order sloping rail runs and chain link fabric against the applicable slope lengths, then account for terminations and the supplier’s roll or stock sizes. Multiple rail courses each need their own length allowance. Do not multiply the picket count by the slope-length ratio: picket widths fill the horizontal opening. The main fence calculator supplies the broader material estimate; reconcile its level-run assumptions with the slope layout before ordering.

Picket spacing on a slope uses horizontal width

Plumb pickets have vertical edges. Their face widths and clear edge-to-edge gaps fill a horizontal distance, even when they attach to a sloping rail. Measure the clear opening horizontally between the actual infill boundaries. That opening can be smaller than the horizontal post-center spacing because the posts, trim or brackets occupy part of the bay.

Use that horizontal clear opening and the actual picket face width in the picket spacing calculator. Choose equal end gaps or flush end pickets to match the detail you are building. The picket spacing formula guide explains why the number of spaces changes with the end treatment. Neither tool needs the sloping rail length for a row of plumb boards.

Mark horizontal positions on a level reference and transfer them to the angled rails with a plumb line or level. A tape laid along the rail measures a longer interval between those vertical marks. Repeating the desired horizontal gap directly along that tape compresses the horizontal layout and changes the gaps. Check several installed pickets for plumb before continuing across the bay.

Factory panels can behave differently when racked because their connections control how the pickets move. Use the manufacturer’s layout and gap information for that assembly. The horizontal spacing rule here describes plumb, equally wide pickets; it does not certify every prefabricated panel’s finished openings or barrier compliance.

Panel systems: check the manufacturer’s rack limit

Look up the installation instructions for the exact panel style, width and post connection. Confirm whether the panel can rack, must be stepped, or needs different brackets on a slope. Freedom’s fencing FAQ distinguishes rackable products and different panel assemblies; its installation guide library is a starting point for finding the matching instructions. A material name alone does not identify a rack limit.

Compare your measurements in the units the instructions use. An angle limit can be checked against atan(R/H); a permitted rise over a stated horizontal span can be compared with your bay rise and width. Confirm what the manufacturer means by span before converting. Do this for the steepest local bay, because the average slope across the yard can be gentler than one short section.

Ask the supplier how racking changes the horizontal coverage of a fixed-length panel and which post lengths and connections are required. If the selected system cannot follow the grade, revise the layout using an approved stepped detail or another suitable system. Do not force joints or enlarge routed openings to make a panel fit without the manufacturer’s instructions.

Gaps under the fence: pets and pools

Walk the proposed bottom line at every bay. For a stepped layout, inspect the downhill end where the wedge is deepest. For a racked layout, inspect hollows between posts where straight rails bridge uneven ground. A close fit at the posts does not establish the clearance in the middle, and a small gap between pickets says nothing about the opening underneath them.

For pets, consider the actual animal and the full route, including gate bottoms and transitions from stepped to racked sections. If a gap needs closing, plan a compatible detail that accommodates drainage and the fence material’s required ground clearance. Soil or loose fill placed beneath a panel can wash away and change the opening after installation.

Pool and other safety barriers are local code questions. Confirm the applicable opening, ground-clearance and gate requirements with the local authority before selecting panels or laying out the slope. This geometric example does not establish a permitted gap or an approved barrier. Check the completed fence against the applicable requirements, including the largest ground openings and the gate’s operating position.

Before buying, keep a layout sheet with each segment’s horizontal run, rise, bay widths and bottom clearances. Add the chosen panel detail, sloping rail lengths and post connection heights. That gives the supplier or installer the measurements needed to check the order, and keeps a level material estimate from becoming an unchecked cutting list for a hill.