Sloped Fence Calculator

</> Embed this calculator on your site

This fence on a slope calculator works out how many posts, sections, rails, and bags of concrete you need when your fence runs up or down a hill, and how long the posts must be. Compare a stepped fence (level panels) against a racked fence (panels that follow the ground) before you buy.

Height72 in Rise24 in Run 48 ft Slope 48.04 ft 2.4° Press Calculate to update the diagram

Schematic side view, not to scale. Labels update with your numbers.

Estimates only. By using this calculator you agree to our Terms.

</> Embed this calculator on your site

Free for any website, blog, classroom or intranet. No sign-up, no ads inside the embed. Copy the code and paste it into your page.

Preview the embed

How to Use This Sloped Fence Calculator

Enter the horizontal run of the fence line, the total elevation change from the high end to the low end, your fence height, and the widest panel or rail section you plan to use. Choose stepped or racked, your post size, and your local frost depth if you know it. Press Calculate to see posts, sections, rail length, post length, hole depth, concrete bags, a post-by-post table, and a side-by-side comparison of both methods.

Why This Matters

On flat ground a fence is easy to plan: divide the run by the panel width, round up, and add one post. On a hill the numbers change. A 40-foot run that falls 30 inches needs five panels if you step them, but if you rack them parallel to the ground the longer sloped distance can push you to six. Miss that and you are a panel short on Saturday afternoon with the auger rental due back.

Slope also changes post length. With stepped panels each post must reach the top of the higher panel, so on a 6-inch step a 6-foot fence needs posts about 6 inches taller than on level ground, and deeper holes to match. Homeowners use a fence on a slope calculator to order lumber and concrete once, contractors use it to quote jobs, and anyone fencing a pool, a dog run, or a paddock uses it to check the gap under each panel. Gaps over roughly 4 inches let small pets and children through, so the step drop is shown in plain numbers.

How It's Calculated

Everything starts from the run and rise you enter. The tool uses these formulas:

These follow common industry rules of thumb, not a specific code section. No national building code sets fence post depth. Frost depth, permits, height limits, and setbacks vary by city, county, and HOA, so confirm them locally. Every safety-related figure is rounded toward more posts, deeper holes, and longer posts. The results are planning estimates, not engineering, permit, or inspection approval.

Worked Example

Say a fence run is 40 ft long and drops 30 in. You want a 72 in fence with 8 ft sections, stepped, on 4×4 posts, and you left frost depth blank.

Switch to racked and the 40.08 ft slope length divided by 8 ft is just over 5, so you need 6 sections and 7 posts. Posts are shorter (10 ft stock) and there is no stepped gap, but you need 121 ft of rail and 42 bags of 60 lb concrete.

Tips & Common Mistakes

Frequently Asked Questions

How do you build a fence on a slope?

You either step the panels, keeping each one level and dropping at each post, or rack them so the rails follow the ground. Stepped suits steeper ground and rigid panels. Racked gives a continuous line on gentle slopes. Set posts plumb either way, and measure post spacing horizontally.

Is a stepped or racked fence better on a hill?

Racked looks smoother and leaves no big gaps, but it needs panels that can flex and it uses more material. Stepped works with any panel and is often easier to build, but leaves triangular gaps under each step. On slopes over about 12.5%, stepped is often the practical choice.

How much slope can racked fence panels handle?

It depends on the product. Many vinyl and aluminum panels rack roughly 1.5 inches per foot or less. Custom wood rails can follow steeper ground. Check the manufacturer's racking limit before you buy.

How deep should fence posts be on a slope?

A common rule is to bury at least one-third of the post length, never less than 24 inches, and below the local frost line. On a slope, size the embed from the tallest post, because stepped fences need taller posts. This calculator rounds that depth up to the next 6 inches.

Do I measure fence length along the ground or horizontally?

Measure the run horizontally for stepped fences, since each panel stays level. For racked fences, panel length is measured along the slope, which is slightly longer. This tool uses the run for stepped and the slope length for racked.

Do I need a permit for a fence on a slope?

Permit rules depend on your city, county, and HOA, and mostly cover height and setbacks. Slopes can also count toward the measured height of a fence, especially at the downhill side. Ask your local building department before you buy materials.

Related Tools