How Post Height and Rail Placement Work on a Sloped Fence Installation
- 2 days ago
- 6 min read
A flat-ground fence installation has one post height calculation: fence height plus burial depth. A sloped installation has a different calculation at every post, because the fence top needs to stay consistent while the ground keeps dropping. Get the post heights wrong and the fence line looks uneven. Get the rail placement wrong and the infill doesn't sit correctly in the frame. These aren't judgment calls that experienced installers figure out on-site. They're geometric calculations that can be worked out before a single post goes in the ground. This guide covers how post height and rail placement change on a slope, and how to calculate both before installation begins.
At a glance
On a stepped slope installation, each post has a different above-grade height because the ground level at each post location is different. The total post length at each location equals the burial depth plus the above-grade height needed to keep the fence top consistent. Rail placement follows the post top down by a fixed offset, so rails stay parallel to the fence top rather than parallel to the ground. Modern Yard publishes dimensioned technical drawings for each fence system at the technical drawings page, covering component dimensions needed for sloped installation planning.
How post height changes on a slope

On a flat installation, every post is the same length because the ground is the same height at every post location. The total post length is:
Total post length \= burial depth + above-grade fence height
On a stepped slope installation, the ground at each post location is at a different elevation. The fence top, however, needs to stay at a consistent height above the highest point of each fence section for the fence line to look level and uniform. This means the post at the low end of each stepped section needs to be taller than the post at the high end.
The total length for each post on a slope is:
Total post length \= burial depth + desired above-grade fence height + grade drop at that post location relative to the section's high point
The burial depth stays consistent for all posts, assuming consistent soil conditions. The desired above-grade fence height stays consistent, because that's the finished fence height. What changes is the grade drop variable, which is different at each post location.
A concrete example:
A stepped section runs 8ft between posts with a grade drop of 6 inches across the section. The desired fence height is 6ft. The standard burial depth is 2ft.
Post at the high end: 2ft burial + 6ft above grade \= 8ft total
Post at the low end: 2ft burial + 6ft above grade + 0.5ft grade drop \= 8.5ft total
If the grade drops another 6 inches to the next post, that post is:
2ft burial + 6ft above grade + 1ft cumulative grade drop \= 9ft total
The post gets longer at each downhill location by the amount of grade drop between posts.
On a steep slope with multiple steps, this can mean significant variation in post lengths across the perimeter. Pre-calculating every post length from grade measurements taken before ordering eliminates the most common material shortage problem in sloped installations.
How rail placement changes on a slope
In a fence system with horizontal rails, rail placement on a slope follows a different logic than on flat ground.
On flat ground, rails are typically positioned at fixed heights from the ground: a bottom rail at a standard height above grade, a top rail at a standard height below the fence top.
On a stepped slope installation, rail placement follows the fence top rather than the ground. Rails are positioned at a fixed offset below the fence top, not at a fixed height above grade. This is because the fence top is the consistent reference point, and the infill needs to sit at a consistent position relative to the top rail regardless of what the ground is doing.
Why this matters for infill fit:
If rails are positioned at a fixed height above grade on a sloped installation, the distance between the top rail and the top of the post varies as the grade changes. The infill, which is cut to a standard height, may not reach the top rail at the high end of a stepped section, or may extend too far above it at the low end.
If rails are positioned at a fixed offset below the fence top, the infill fits consistently within the rail frame regardless of where the ground is. The gap between the bottom rail and the ground changes with the slope, but the infill geometry stays correct.
Practical rule for stepped installations:
Set the top rail at a consistent distance below the post top. Set the bottom rail at a consistent distance above the top rail, matching the infill height requirements. The gap between the bottom rail and the grade will vary across the slope, but the infill will sit correctly in the frame at every section.
How to calculate post heights before installation
This calculation can be done before any materials are ordered. The inputs needed are the post spacing, the desired fence height, the standard burial depth, and the grade measurement at each post location.
Step 1: Walk the fence line and mark post locations.
Mark each post location at the planned spacing. On a slope, use consistent spacing rather than adjusting spacing to match grade breaks, unless a grade break happens to fall at a convenient post location.
Step 2: Measure the grade at each post location.
Use a level and measuring tape, or a line level and string line, to measure the elevation difference between each post location and the first post (or the highest point of the run). Record the grade drop in inches at each post location.
Step 3: Calculate the total post length at each location.
For each post: burial depth + desired above-grade fence height + grade drop at that location \= total post length.
Round up to the nearest available post size. If the calculated length falls between available sizes, use the longer size and trim or adjust the above-grade height at installation.
Step 4: Verify the post lengths add up correctly.
Check that the calculated total lengths produce the consistent fence top height you're targeting. The above-grade height at each post should equal the desired fence height when the grade drop is accounted for.
Step 5: Calculate rail positions from the post top.
Set the top rail offset from the post top. Set the bottom rail offset from the top rail based on the infill height. Record these measurements as constants that apply to every post location regardless of grade.
Step 6: Calculate infill requirements.
On a stepped installation, infill sections between posts run level. The infill height is consistent across all sections. The gap at the bottom of each section varies with the grade, but the infill dimensions don't change.
How Modern Yard's system supports sloped installations

Three post sizes covering standard height ranges.
Modern Yard slotted steel posts are available in three sizes. Having multiple standard sizes available means post length requirements across a sloped perimeter can typically be met with standard stock rather than custom cuts, which simplifies ordering and reduces waste.
Technical drawings for dimensional planning.
Dimensioned technical drawings for each fence system are available at the Modern Yard technical drawings page. For sloped installation planning, the drawings provide exact post slot dimensions, rail attachment geometry, and infill height specifications. These are the dimensions needed to calculate rail positions and verify infill fit before installation begins.
Infill panel trimming for stepped sections.
FireGuard steel panels can be cut to custom widths for site-specific configurations, which applies to bottom-edge trimming in stepped installations where the gap between the bottom rail and the grade is larger than desired. Composite boards can similarly be trimmed at the bottom edge of a stepped section.
Independent slat installation for grade-sensitive layouts.
The myAir aluminum slat system installs each slat independently into the post slot. For installations where grade tracking at the bottom edge is a priority, the bottom slat position can be adjusted independently at each post location rather than being fixed by a panel height.
Installation guides for all fence systems and gate configurations are at the Modern Yard installation guides page.
Calculate before you cut
The post height and rail placement calculations for a sloped installation are straightforward once the grade measurements are in hand. Every number needed for the full material order, post lengths, rail positions, and infill dimensions, can be determined from a site measurement before anything is purchased. Running those calculations in advance converts the most common sources of field uncertainty in sloped installations into a pre-planned installation sequence.
.png)