How to Build a Fence on a Slope

Last updated March 25, 2025
Knowing how to build a fence on a slope or uneven ground starts with a good plan. There are two types of fencing that are best for a sloped yard. You can follow the natural contour of the land, or you can create a stepped fence. The method you use to build your fence will depend on how you want the fence to look. Read on to learn how to use either method. Plus, get tips on planning and which tools to use.
Difficulty:
Intermediate
Duration:
Over 1 day
Table of Contents
Planning a Contour Fence
Drop a Plumb Line
Dig Holes for a Contour Fence
Pour Concrete If Needed
Attach Rails to Contour Fence
Planning a Stepped Fence
Planning a Contour Fence

The rails on a contour fence follow the slope of the ground. This fence type works best when the ground has only a slight incline. To figure out how to build a fence on a slope, use stakes and string.
Plan where the fence is laid out as you go:
- Drive a 2-foot stake into the ground at the top of the slope. Put a second stake at the bottom of the slope.
- Run a level mason’s line between the two stakes.
- Measure equally spaced locations for the fence posts along the line.
- Mark those locations with tape.
Drop a Plumb Line

- Using a plumb bob, drop a line from the tape marks on the mason's line to transfer the marks to the ground.
- Mark the spot with powdered chalk.
- Repeat until you've laid out post holes for the entire fence.
Dig Holes for a Contour Fence

Using a post hole digger, dig holes at the marked spots and install the posts. If the posts aren’t the exact height that you want your fence to be, you can trim them.
Pour Concrete If Needed

For wooden panel fences or other types that need more stability, pour concrete into the post hole and allow it to harden around the post.
To save time, get a post-setting concrete mix. It doesn't have to be mixed before use. You can pour it into the hole when it's dry and then add water.
Attach Rails to Contour Fence

Once posts are in place, measure from the ground up to lay out the bottom rails. When building a contour fence on a hill, the bottom rails should be 3 or 4 inches off the ground.
- Mark the posts so you know where to place the bottom rails. Measure up from the bottom rails to figure out where lay out the top rails.
- Cut the rails so the ends fall at the middle of the posts.
- Fasten them with #8 2-1/2-inch deck screws.
Planning a Stepped Fence

Seen from the side, the top of a finished stepped fence resembles a staircase. A stepped fence goes down the hill in a series of steps. It is often used on steeper areas when building a fence on a slope.
To plan the layout of a stepped fence:
- Drive a stake at the top and bottom of the slope where you’d like the fence to end.
- String a mason’s line from the base of the top stake to the bottom stake. Level it with a line level.
- Measure the distance between the line and the ground at the bottom stake to find out how much the fence drops along the run.
Mark Post Locations

- Measure along the line with a tape measure.
- Mark the location of the posts on the line with masking tape.
- Count the sections of fence you will need.
- Divide the overall drop of the fence by the number of sections to find the drop per section.
Measure & Install Posts

For a stepped fence on a hill, premade fence panels and coordinating posts will work best. Panels come in pre-measured heights and widths in a wide range of materials. Choose the posts and panels that will best suit your project. You can also use rails for a stepped fence.
- Dig holes and install the posts in the places you marked earlier. Each post should be slightly taller than the finished height of the fence.
- Measure to find where the top of the upper post will be.
- Draw a line to mark where you will cut it.
Level Posts & Cut Tops

- Measure down by the drop per section, which you figured out in the previous step. Tie a line at that point.
- Tie the other end to the next post and level the line. The point at which it crosses the second post will be the top of that post.
- Mark the top, move the line down by the drop per section, then stretch it to the third post and level it. Mark as before.
- Continue down the hill, marking the top, measuring down and stretching a level line until you reach the bottom of the hill.
- Cut off the tops of the posts at the layout lines.
Attach Fence Panels or Rails

You can choose to have a wooden panel fence on a hill or use rails. Properly attach the fence panels or rails with screws. Refer to the panel or manufacturer’s instructions for which type of screws to use.
Building fencing on a slope or starts with a good plan. You’ll need to decide if a contour fence or a stepped fence works best for your property. Now that you know how to build a contour or stepped fence, get the materials you need. Use the Home Depot Mobile App to locate products and check inventory. We’ll take you to the exact aisle and bay. Consider tool rental to get your project done. Use a rented tool and then bring it back. There's no maintenance required and no storage needed.