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.
Common fence heights
- Privacy: 6 ft. It blocks the view of most adults standing in the next yard. 8 ft is allowed in some places.
- Pool barrier: at least 4 ft (48 in) under the International Residential Code, with self-closing, self-latching gates.
- Dogs: 4 ft for small dogs, 5–6 ft for large or athletic breeds that jump.
- Deer: 7.5–8 ft. Deer can clear lower fences easily.
- Front yard: usually limited to 3–4 ft so the street stays visible.
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.