Fence Rail Calculator

Enter your measurements

Results

Enter your project measurements and select Calculate.

How many fence rails do I need?

A wood fence is built in sections: each section is the run between two posts, and each section gets the same number of horizontal rails. This calculator divides your fence length by the post spacing to find the number of sections, multiplies by the rails in each section, and then adds your waste allowance so you have spares for split, warped, or miscut boards.

How to use the fence rail calculator

  1. Measure the total fence run in feet. Measure each straight side separately and add them together.
  2. Enter the post spacing you plan to use. Many wood fences use 8 ft or shorter spacing so a standard rail spans one section.
  3. Enter the number of rails per section. Shorter fences often use two rails; many 6 ft privacy fences use three so the pickets stay straight in the middle.
  4. Set a waste allowance and select Calculate.

Formula

Sections = round up (fence length ÷ post spacing)
Rails without waste = sections × rails per section
Rails to order = round up (rails without waste × (1 + waste % ÷ 100))

The section count is rounded up because a short final section still needs a full set of rails, even if those rails are cut down.

Example

The default values describe a 100 ft fence with posts 8 ft apart and 3 rails per section. 100 ÷ 8 = 12.5, which rounds up to 13 sections. 13 × 3 = 39 rails. With a 10% allowance, 39 × 1.10 = 42.9, so the calculator suggests ordering 43 rails.

For a 150 ft fence with 2 rails per section at the same spacing: 150 ÷ 8 = 18.75, so 19 sections and 38 rails, or 42 rails with 10% extra.

Things this calculator does not count

Choosing a waste allowance

Rails are long, so a single warped or split board can be hard to use. A 5–10% allowance is a common planning range for straight runs with good lumber. Use more if the lumber is rough, the fence has many short sections, or you are cutting around obstacles.

Frequently asked questions

Should I use 2 or 3 rails per section?

It depends on fence height, picket weight, and local practice. Taller fences usually need a middle rail to keep pickets flat. Check your fence plan, the picket manufacturer, or a local fence supplier if you are unsure.

Why does the calculator round sections up?

Any leftover length still needs a section with rails. A 100 ft fence at 8 ft spacing ends with a 4 ft section, and that short section still needs its own rails.

Does post spacing have to be exactly 8 ft?

No. Enter the spacing you plan to use. Closer spacing makes a stiffer fence but needs more posts and more sections. The Fence Post Spacing Calculator can help you find an even spacing for your length.

Can I enter metric measurements?

Yes. Switch the unit on the length and spacing inputs to meters, and the calculator converts them before calculating.

Does this work for horizontal slat fences?

Not directly. Horizontal slat fences usually have no rails, and the boards themselves run between posts. Count those boards from the fence height and board width instead.

Related fence calculators and guides

Fence Picket Calculator · Fence Post Spacing Calculator · Fence Material Calculator · How to Calculate Fence Materials · All Fence Calculators

Disclaimer: Estimates are for planning purposes only. Rail counts vary with fence design, gates, corners, slopes, lumber quality, and local requirements. Verify quantities with your supplier before purchasing.