Fence on a slope calculator

Plan a fence on ground that slopes: how far each panel steps down, or how much it racks, how tall each post stands above the ground, and how big the gaps under stepped panels get. Choose a panel type to check it against the maker’s rack limit.

Figures checked October 3, 2026

Measured level along a string line, not along the slope.

Tie a level string from the top stake; at the bottom stake, measure from the string down to the ground.

Where each panel is closest to the ground. 2 in keeps pickets off the soil.

Level panels, each one lower than the last.

Side view from your sizes · heights drawn ×1.6
6 in step per 8 ft panel

4 panels · 6.3% slope (3.6°)

Sections
4 × 8 ft
Top post, above ground
74 in (6′ 2″)
Other posts, above ground
80 in (6′ 8″)
Gap under each panel
2 in, rising to 8 in
Posts to buy
5 × 10 ft

Around a pool, the gap under a barrier can’t be more than 2 in where the ground isn’t solid (2021 ISPSC 305.2.1). Fill under the steps, or rack the fence.

Assumes the ground falls evenly. Where it doesn’t, measure the drop across each section and step or rack each one by its own drop.

How the steps and posts are worked out

The calculator treats the ground as a straight slope from the first post to the last, divides the fence into sections no wider than your post spacing, and works out how far the ground drops across each one.

slope = drop ÷ level length section drop = slope × width Stepped (level panels): high-end gap = clearance low-end gap = clearance + drop top post = height + clearance lower posts = height + clearance + drop above them Racked (panels follow the ground): rack = drop across panel every post = height + clearance

Worked example: 32 ft of fence dropping 24 in, 8 ft sections

  • Slope: 24 in over 384 in = 6.25% (3.6°). Four sections of 8 ft, each dropping 6 in.
  • Stepped: each panel sits 6 in lower than the one above it.
  • With 6 ft (72 in) panels and a 2 in gap, the top post stands 74 in above the ground and the other four 80 in.
  • The gap under each panel runs from 2 in at its high end to 8 in at its low end.
  • Racked instead: every post stands 74 in, the gap stays 2 in, and each panel racks 6 in.

Home Depot’s slope guide works the same way: divide the overall drop by the number of sections to get the step.

Measuring the slope

Drive a stake at the top of the fence line and another at the bottom. Tie a string to the top stake at ground level, stretch it to the bottom stake and level it with a line level. The distance from the string down to the ground at the bottom stake is the drop; the length of the level string is the fence’s level length. Measure along the string, not along the ground, or a steep slope will read long.

For a percentage, divide the drop by the level length: WamBam’s example of 11 in over 10 ft (120 in) is a 9.2% slope, about 5¼°. On long runs, add stakes in between, both to keep the string from sagging and to catch dips and humps where the ground isn’t one even slope.

How far fence panels rack

Panels built on site from posts, rails and pickets can follow any slope: you set the rails parallel to the ground and hang the pickets plumb. Prefabricated panels rack only as far as their brackets and pickets let them:

PanelRacks up toAbout
Freedom aluminum, 6 ft38 in per panel53% slope
Freedom aluminum, 8 ft48 in per panel50% slope
Barrette Brilliance aluminum, 6 ft38 in per panel53% slope
FORGERIGHT Vinings aluminum, 6 ft26 in (22°)36% slope
Jerith Liberty aluminum, standard / Hill Country11 in (9°) / 26 in (22°)15% / 36% slope
Freedom ready-to-assemble vinyl (Everton, Bolton)1 in per foot of panel8% slope
Preassembled wood panelsStep only—

The last column divides the rack by the panel’s width, which is the cautious way to read a limit. Rack limits are the makers’ own figures, linked below; brand names identify products only.

Racking also pulls a panel’s ends closer together, because the rails tilt. Ameristar’s chart shows it: a 94 in rail racked 48 in covers only 80.8 in of level ground. Freedom’s aluminum guide and Lowe’s metal-fence tips give the same warning, so on a slope set each post to the racked panel rather than to a mark measured on flat ground.

The gaps under a stepped fence

A stepped panel is level, so the ground falls away under it. The gap at its low end is your clearance plus the full step: 2 in plus 6 in is 8 in in the example above. Smaller sections mean smaller steps — with 6 ft sections the same slope steps 4½ in — at the cost of more posts.

Fill the gaps by raising the soil, setting a kickboard (a treated board along the bottom that follows the ground), or racking the fence instead. Home Depot’s guide keeps the bottom of a contoured (racked) fence 3 or 4 in off the ground.

Pool fences

The 2021 International Swimming Pool and Spa Code (section 305.2.1) allows at most 2 in between a pool barrier and the ground where the ground isn’t solid, such as grass or soil. A stepped pool fence has to close every gap under that.

Post heights and lengths

On a stepped fence the posts aren’t all the same height. Each one below the top carries the high end of the panel above it, so it stands taller than the panels by that panel’s step. On a racked fence every post stands the fence height plus the clearance.

The post lengths assume about a third of each post goes in the ground — the rule Home Depot and Quikrete give — which is half the height above ground: a post standing 80 in needs 40 in in the ground and 120 in overall, a 10 ft post. Frost depth or your plans may call for deeper holes; the fence materials calculator takes a frost depth and works out holes, gravel and concrete.

Questions people ask

How much should each fence panel step down on a slope?

By the drop across one section. Measure the total drop along the fence line, then divide it by the number of sections, as Home Depot’s guide does: 24 in of drop over four 8 ft sections is a 6 in step per panel. Where the ground isn’t an even slope, step each panel by the drop across its own section.

Can vinyl fence panels be racked?

Some can, but not far. Freedom’s ready-to-assemble vinyl panels rack 1 in per foot: 6 in across a 6 ft Everton panel and 8 in across an 8 ft Bolton panel. Steeper ground than that, about an 8% slope, means stepping the panels. WamBam, another vinyl maker, says slopes over 10° need the rails cut at an angle, and asks you to call before ordering for slopes over 15°.

How steep a slope can an aluminum fence follow?

Much steeper than vinyl or wood panels. Freedom and Barrette rate their 6 ft aluminum panels to rack 38 in, and Freedom’s 8 ft panels 48 in. FORGERIGHT’s Vinings panels rack 26 in (22°). Jerith’s standard Liberty panels take 11 in (9°), and its Hill Country version 26 in (22°). Check the limit for your exact panel: it’s on the product page or in the installation guide.

How do I fill the gap under a stepped fence?

Each stepped panel is level, so the gap under it grows from your chosen clearance at the high end to the clearance plus the step at the low end. Common fixes are to bring the soil up under the panel, add a treated kickboard that follows the ground, or use shorter sections so each step is smaller. Around a pool, the 2021 ISPSC allows no more than 2 in between the barrier and ground that isn’t solid.

Do the posts need to be longer on a slope?

On a stepped fence, yes: every post below the top one stands taller than the panels by the step it carries, so a 6 ft fence with 6 in steps and a 2 in gap needs posts 80 in above the ground. On a racked fence every post is the same height. The calculator lists the post lengths to buy with a third of each post in the ground.

Is a stepped or racked fence better?

Neither is better everywhere. Racking keeps the bottom of the fence close to the ground all the way along, which matters for pets and pools; stepping keeps every panel level and works with any panel, including preassembled wood panels, which can only be stepped. The stepped vs racked guide goes through the choice.

Sources for the numbers on this page

  1. The Home Depot — How to build a fence on a hill (stepped and contoured fences) · checked October 3, 2026
  2. The Home Depot — How to build a fence (post spacing, hole depth, rails and pickets) · checked October 3, 2026
  3. WamBam Fence — Determining the slope of your fence line · checked October 3, 2026
  4. WamBam Fence — How to deal with sloping ground · checked October 3, 2026
  5. Freedom Outdoor Living — Frequently asked questions (how far panels rack) · checked October 3, 2026
  6. Freedom Outdoor Living — Everton vinyl fencing (racking) · checked October 3, 2026
  7. Freedom Outdoor Living — Bolton vinyl fencing (racking) · checked October 3, 2026
  8. Freedom Outdoor Living — Aluminum fence installation guide, sold at Lowe’s (PDF) · checked October 3, 2026
  9. Barrette Outdoor Living, via The Home Depot — Brilliance standard-duty aluminum fence panel, 6 ft wide (racking) · checked October 3, 2026
  10. FORGERIGHT, via The Home Depot — Vinings aluminum fence panel, 6 ft wide (racking) · checked October 3, 2026
  11. Jerith — Liberty aluminum fence (rackability) · checked October 3, 2026
  12. Ameristar — Montage comparison chart (rake and grade by style, PDF) · checked October 3, 2026
  13. Lowe’s — Decorative metal fence installation tips: installing posts and panels (PDF) · checked October 3, 2026
  14. The Home Depot — Wood fence panel installation instructions (PDF): preassembled panels are stepped, not racked · checked October 3, 2026
  15. International Code Council, via Town of Thompson’s Station, Tennessee — 2021 ISPSC chapter 3, section 305.2.1: clearance under a pool barrier (PDF) · checked October 3, 2026
  16. Quikrete — Setting posts — project instructions · checked October 1, 2026

Corrections and updates are logged on the sources page.