Fence Height Calculator

Find the right height for what the fence has to do, check it against typical code limits, and get the post length and slope layout.

Choosing a purpose fills in its recommended height. Use a frost depth of 0 if the ground does not freeze.

Slope

Use a drop of 0 for flat ground.

Common fence heights

Typical code limits

Most US towns limit backyard fences to 6 ft and front-yard fences to 3–4 ft. Near street corners and driveways, a "sight triangle" rule often keeps fences under 30–36 in so drivers can see. Rules vary a lot, so check with your local building department and HOA before you build.

Post length and depth

burial depth = max(2 ft, height ÷ 3, frost line depth) post length = height + burial depth

Building on a slope

A racked fence follows the ground so there are no gaps under it. Rails are parallel to the slope. This works best on gentle, even slopes. A stepped fence keeps each section level and steps down at every post. It suits steeper slopes but leaves triangular gaps under each section.