Fence Calculator

Calculate posts, rails, pickets, and concrete for your fence project, plus a full materials list with cost estimates.

Disclaimer: For informational purposes only

This calculator provides general estimates based on the inputs you provide and standard formulas. Real-world conditions, individual circumstances, and other factors can change the result. You are responsible for verifying any value that affects a real decision by checking authoritative sources, comparing against multiple references, or consulting an appropriate professional. Use this tool for planning and reference only, not as the sole basis for decisions involving safety, health, property, or money.

Fence calculator

Enter your fence details to get a full materials list and cost estimate.

Standard 3.5 ft wide

Typical: 6-8 feet

How it works

Posts = (fence length ÷ post spacing) + 1 + (2 × gates). Rails = sections × rails per section (2 for 4 ft, 3 for 6 ft+). Pickets = fence length ÷ board spacing based on style. Concrete = posts × bags per post (1 for 4 ft, 2 for 6 ft+).

How to use this calculator

Start by entering the total linear footage of your fence line. Choose your fence height and style, then specify how many gates you need and your preferred post spacing. The calculator instantly shows the number of posts, rails, pickets, and bags of concrete required.

Use the "Customize prices" option to enter your local lumber prices for a more accurate cost estimate. The default prices reflect typical big-box store pricing for pressure-treated pine.

Fence styles explained

Privacy fences use boards placed edge-to-edge with no gaps. They block sightlines completely and are the most popular choice for backyard boundaries. They require the most lumber but offer maximum screening.

Semi-privacy fences leave small gaps (about 1-2 inches) between boards. They allow some airflow and light through while still providing good screening. This style uses roughly 25% fewer boards than a full privacy fence.

Picket fencesspace boards evenly apart, typically with gaps equal to the board width. They're ideal for front yards and decorative boundaries where full privacy isn't needed. They use about half the boards of a privacy fence.

Fence materials comparison

MaterialLifespanMaintenanceCost range
Pressure-treated pine15 to 20 yearsStain every 2 to 3 years$12 to $25/ft
Cedar20 to 30 yearsSeal every 3 to 5 years$18 to $35/ft
Vinyl25 to 30 yearsOccasional washing$20 to $40/ft
Aluminum/steel30+ yearsMinimal$25 to $50/ft

Permits and regulations

Most cities and counties require a building permit for fences, especially those over 6 feet tall. Contact your local building department before starting, permit fees typically range from $20 to $100 and the process can take a few days to a few weeks.

If you live in an HOA community, check your covenants for restrictions on fence height, style, material, and color. Many HOAs require architectural review approval before construction. Setback requirements usually keep fences 2 to 6 inches inside your property line, and front yard fences are often limited to 3 to 4 feet in height.

Frequently asked questions

How many fence posts do I need?

Divide your total fence length by your post spacing (typically 8 feet), then add 1 for the end post. Add 2 extra posts for each gate. For example, a 100-foot fence with 8-foot spacing and one gate needs 16 posts.

How deep should fence post holes be?

Post holes should be about one-third the total post length plus 4 inches for gravel drainage. For a 6-foot fence, use 8-foot posts buried about 2.5 feet deep. The hole should be 3 times the post width in diameter.

How much concrete do I need per fence post?

Plan on 1 bag of 60-lb concrete for 4-foot fence posts and 2 bags for 6-foot or 8-foot fence posts. Fast-setting concrete is ideal for fence posts since you don't need to mix it, just pour it dry into the hole and add water.

Do I need a permit to build a fence?

Most municipalities require permits for fences, especially those over 6 feet tall. Check with your local building department and HOA (if applicable) before starting. Fines for unpermitted fences can be significant, and you may be required to remove the fence.