Skip to main content
Fence Calculator

Fence slope calculator

Adjust your fence run for a graded yard: slope-adjusted length from the horizontal run, plus a rack-versus-step sanity check.

Fence calculator

Enter your specs. Every result updates live and shows its formula.

ft
Advanced settings
Local prices (optional)

Enter your own local unit prices to see a cost estimate. Leave blank to skip cost.

Saved quotes

No saved quotes yet.

Enter your fence length to see the full material and cost breakdown.

Overview

A fence that follows the grade is slightly longer than the horizontal distance between its endpoints, exactly like a ramp is longer than the flat footprint it crosses. This calculator converts your horizontal run and slope percentage into the slope-adjusted length the material actually has to span.

It then leaves the design choice to you: raking panels to follow a gentle, even grade continuously, or stepping each panel level at the posts for a steeper, uneven grade or for vinyl, which cannot be racked at an angle.

Assumptions

  • Slope percentage equals vertical rise over horizontal run times 100.
  • Slope-adjusted length equals the horizontal run divided by the cosine of the arctangent of the slope percentage.
  • The result is the built run; post spacing along the horizontal remains the planned spacing.

Common mistakes

  • Ordering material for the horizontal distance on a graded run, which comes up short by the slope-adjusted amount.
  • Raking vinyl or other rigid panel systems that are built to be stepped, not angled across a grade.
  • Updating the length but not the post count, when posts still sit at their horizontal spacing along the run regardless of grade.

Fence calculation formulas

The same math the calculator runs, in plain terms. Nothing here is a black box.

  • Sections

    sections = max(ceil(effective run / post spacing), 1)

  • Post count

    posts = (sections + 1) along the run, minus named corner and end posts already placed, plus 2 gate posts per gate

  • Effective run

    effective run = total length - sum of gate widths

  • Rail count

    total rails = sections x rails per section

  • Picket count

    pickets = ceil(run in inches / (picket width + gap)); total = ceil(raw x (1 + waste %))

  • Board-on-board pitch

    pitch = picket width - 1 in overlap

  • Panel count

    full panels = floor(run / panel width); add 1 cut panel if the remainder is over 0.01 ft; total = ceil(raw x (1 + waste %))

  • Concrete volume

    per-hole = pi x (diameter / 2)^2 x depth; total = per-hole x posts; bags = ceil(total / bag yield)

  • Slope-adjusted run

    slope run = effective run / cos(atan(slope % / 100)); shown alongside, counts use the flat run

  • Cost

    materials = (posts x post price + rails x rail price + infill x unit price + 60 lb bags x bag price) x regional multiplier; labor = effective run x labor per ft x terrain multiplier x regional multiplier; installed total = materials + gate hardware + removal + permit + labor

Every number the calculator shows comes from these formulas applied to your inputs.

In-depth guides

Buying guide

A fence slope calculator answers a question that only comes up once a yard stops being flat: how much longer is the fence itself than the flat-map distance between its two endpoints. The relationship is the same as a ramp being longer than the flat footprint it spans, and it is handled the same way, with trigonometry rather than a flat percentage markup, which is why the adjustment is not simply the slope percentage added straight onto the horizontal length. The calculator converts a slope percentage, rise over run times 100, into an angle, then divides the horizontal run by the cosine of that angle to get the slope-adjusted, built length. A 100 foot horizontal run on a 25 percent grade comes out to about 103 feet of actual fence, a gap that is easy to miss when a tape measure only reads the horizontal distance on a sloped lot and a material order gets placed against that shorter number, leaving a crew short of board or rail partway through the run.

The size of the adjustment depends heavily on how steep the grade is, and it is smaller than intuition suggests until the grade gets genuinely steep. At a gentle 5 percent grade the built length runs only about 0.1 percent over the horizontal distance, essentially nothing on a typical residential run. By 25 percent the adjustment grows to roughly 3 percent, around 3 extra feet of material per 100 feet of horizontal run, which starts to matter on a longer property line or a bulk material order, and the adjustment keeps climbing nonlinearly as the grade gets steeper still, so a very steep slope needs checking individually rather than assumed from a lower-grade example. The practical implication is that slope correction is mostly a concern on genuinely sloped rural or hillside lots, not on yards with the kind of gentle grade most lots have for drainage, and it compounds with length: a long run on a steep grade needs noticeably more board and rail than the flat-map number would suggest, while a short run on a steep grade barely needs any adjustment at all, which is why entering the actual horizontal length and grade for each segment, rather than applying one rough adjustment to the whole property, gives a more reliable material count.

Once a run has real grade, there is a second decision beyond length: whether to rake the fence, angling panels and rails to follow the grade continuously, or step it, keeping each panel level and dropping it down at the next post to follow the slope in stair-steps instead. Raking suits a gentle, even grade and a material that tolerates an angled rail, which describes most wood privacy and picket fencing, and the wood fence calculator and the fence picket calculator both assume a run length that can come directly from this slope adjustment. Stepping is the right call on a steeper or uneven grade, and it is mandatory rather than optional for a fixed-panel system like vinyl or many chain link installations, where panels are manufactured to sit level and cannot be racked at an angle without stressing the rail connections; the chain link fence calculator plans around that same stepped assumption on graded runs.

Slope changes the length of material spanning the ground, but it does not change where posts sit: posts are still set at the planned horizontal spacing measured along the run, not along the sloped surface, so a post-spacing plan does not need re-working just because the yard tilts. What does change on a stepped run is load distribution at the post holding the low end of each step, since that post carries the panel weight transferring down at the step point, which is one more reason post depth and backfill matter more on a sloped installation than a flat one, covered fully in the fence post depth and setting guide. The wood fence installation guide covers the rake-versus-step decision in the context of a full wood build, and the dedicated guide on how to calculate fence materials for a sloped yard walks through combining the slope adjustment with rail and picket counts end to end, alongside how many rails does a fence need for the height-driven side of that same material count. For the flat-ground version of this same run-length problem, see the linear feet calculator, and for rectangular-lot perimeter math that this slope adjustment can feed into, see the fence perimeter calculator, both listed with the rest of the measurement tools on the measurement calculators hub. It is also worth remeasuring slope at more than one point along a long run rather than trusting a single rise-and-run reading taken at one spot, since real yards often ease or steepen partway down a property line, and a single sample point can make an uneven grade look more uniform than it actually is once the fence is standing on it.

Frequently asked questions

What is the formula for slope-adjusted fence length?

Convert the slope percent to an angle with arctan(slope percent divided by 100), then divide the horizontal run by the cosine of that angle. A 100 foot run on a 25 percent grade comes out to about 103 feet of built fence.

How much longer is a fence on a slope?

Gently, more than you might expect less than you fear: at a 5 percent grade the built length is only about 0.1 percent over the horizontal, and at 25 percent it grows to roughly 3 percent, about 3 extra feet per 100. Steep and long is when it starts to matter.

Should I rack or step a fence on a slope?

Rake it when the grade is gentle and even and the material allows an angle, which most wood privacy does. Step it when the grade is steep or uneven, or when the product is a fixed panel like vinyl that can only sit level, dropping each panel at its post.

What slope percentage needs stepping?

There is no universal cutoff, but the practical band used in the field is that most panel systems start to look forced once a run exceeds roughly 10 to 15 percent grade, and racking matters less than the material: check vinyl and panel specs specifically, since they step by design.

Does slope change the post count?

No on its own. Posts are still set at your horizontal spacing measured along the run, so the slope riddle is the panels and boards spanning the grade, not the post spacing itself.

Does the slope-adjusted length change pickets or boards?

Yes: boards and pickets cover the built length along the grade, so the adjusted run feeds the board math. That is why the wood, picket and rail calculators all take a run length you can insert from this result.

What is the fastest way to measure slope percent?

Measure the rise (vertical change) and the horizontal run between the two endpoints, then compute rise over run times 100. A 2 foot rise over a 40 foot run is a 5 percent grade, the same number this calculator takes as its input.

Do corner and gate posts change on a slope?

Same posts, same rules. Gates still want their two posts and a level sill, corners still take tension in both directions, and stepping compounds the corner post load at the low end of each step where the panel weight lands on it.