Fence Post & Rail Calculator

Calculate the number of fence posts, rails, and gate materials needed for your fencing project.

Enter your values

feet
feet
feet

Results

Enter your values and press Calculate.

Why use this calculator

Planning a fence project requires knowing exactly how many posts, rails, and other materials you need before purchasing. Under-ordering means extra trips to the store and project delays, while over-ordering wastes money. This calculator accounts for post spacing, gate openings, and the number of rails per section to provide a complete materials list for your fencing project.

How to use it

Select your preferred unit system, then enter the total length of your fence line, the desired spacing between posts, the number of horizontal rails per section, and any gate openings including their width and quantity. In imperial mode, enter dimensions in feet. In metric mode, enter dimensions in metres. The calculator subtracts gate openings from the fence line and calculates all posts, rails, and ancillary materials needed.

The formula

Fence Length (excl. gates) = Total Length - (Gate Width x Number of Gates). Sections = Fence Length / Post Spacing (rounded up). Fence Posts = Sections + 1. Gate Posts = Gates x 2. Total Posts = Fence Posts + Gate Posts. Total Rails = Sections x Rails per Section. Concrete Bags = Total Posts x 2.

Worked examples

  • 100 ft fence with 8 ft post spacing, 2 rails, one 4 ft gate

    15 fence posts, 2 gate posts (17 total), 24 rails, 34 concrete bags

  • 200 ft perimeter fence with 6 ft spacing, 3 rails, two 4 ft gates

    34 fence posts, 4 gate posts, 99 rails

When people use it

  • Planning a residential privacy fence installation
  • Estimating materials for a livestock or farm perimeter fence
  • Budgeting for a commercial property boundary fence
  • Calculating supplies for a garden or decorative fence

Tips

  • Standard post spacing is 8 feet for most residential fences, but reduce to 6 feet in high-wind areas or for heavy fence panels
  • Set posts in concrete at least 24 inches deep (one-third of the post length) for stability
  • Use pressure-treated or cedar posts for ground contact to prevent rot
  • Mark your fence line with string and stakes before digging to ensure straight lines and proper spacing

Questions people ask

How deep should fence posts be set?
A general rule is to bury one-third of the total post length. For a standard 8-foot post, set it 2.5 to 3 feet deep. In frost-prone areas, set posts below the frost line (typically 36-48 inches) to prevent heaving.
How much concrete do I need per post?
For a standard 4x4 post in a 10-inch diameter hole set 24 inches deep, plan on approximately 2 bags (50 lb each) of quick-set concrete per post. Larger posts or deeper holes will require more.
Do I need a permit for a fence?
Most municipalities require permits for fences above a certain height (typically 6 feet). Check your local building codes and HOA requirements before starting. You may also need to verify property lines with a survey.