Skip to main content
FigureCalc

Baluster Spacing Calculator

By Uzair Arshad , Senior Civil and Structural Engineer

Last updated: April 26, 2026

This baluster spacing calculator finds the exact count, even gap, and center markout measurements for any deck, porch, or stair railing section. Enter your section length and baluster size to get a layout that keeps clear gaps at or below 4 inches.

Most U.S. codes require 4 in or less.

How to use this calculator

  1. Choose level or stair. Select "Level section" for flat deck, porch, or balcony railings. Select "Stair section" if the rail follows a slope or an angled railing run. For stairs, enter the horizontal distance between posts and the total rise (vertical height difference) so the baluster spacing calculator can find the sloped rail length.
  2. Measure between inside post faces. Hold the tape between the inner edges of the two posts. Do not measure from outside to outside, because post width will throw off the baluster count. For level sections, enter this distance in inches.
  3. Select the baluster width. Use the finished dimension, not the nominal size. A "2×2" wood baluster is actually 1.5 inches wide. Round iron or metal balusters are typically 3/4 inch. Square aluminum balusters are often 1-1/4 inch. If your baluster does not match a preset, choose "Custom width" and enter the measurement from a caliper or the manufacturer spec sheet.
  4. Set the maximum clear gap. The default is 4 inches, which matches most U.S. residential deck codes. If your local inspector requires a smaller opening, reduce this value. Do not increase it above 4 inches without confirming local requirements.
  5. Review the layout results. The baluster spacing calculator shows the baluster count, actual clear spacing, on center distance, and the first center position from the left post face. Use the on center spacing to mark every hole after the first one. Buy 2 extra balusters minimum for a short deck rail run, or 5% extra for longer railings.

Pro tip: Mark centers from one fixed end and dry-fit the first 3 to 4 balusters before drilling every hole. I once marked from both ends toward the middle on a 10 foot section and ended up with a tight gap at the center that looked off. Starting from one side and trusting the math produces cleaner results.

How the calculation works

Baluster count:
Count = ceil((Section length - Max gap) / (Baluster width + Max gap))

Spacing:
Actual gap = (Section length - Count × Baluster width) / (Count + 1)
On center = Baluster width + Actual gap

Markout:
First center = Actual gap + Baluster width / 2
Each next center = Previous center + On center spacing

Stair section:
Sloped length = √(Horizontal run² + Total rise²)
Angle = atan(Total rise / Horizontal run) × 180 / π
Section length
Clear distance between inside post faces (inches)
Baluster width
Finished width of one baluster (inches), not the nominal lumber size
Max gap
Maximum allowed clear opening between balusters (inches)
Count
Minimum whole number of balusters that keeps every gap at or below the max
On center
Distance from one baluster center to the next (inches)

This baluster spacing calculator uses three steps: count the balusters, calculate the even gap, and locate each center for markout.

Baluster count:

Count = ceil((Section length - Max gap) / (Baluster width + Max gap))

Rounding up guarantees the actual clear gap stays at or below the maximum you set. If you rounded down, the gaps would exceed the limit.

Even spacing:

Actual gap = (Section length - Count × Baluster width) / (Count + 1)

The "count plus one" divisor creates equal gaps at both ends and between every pair of balusters. This balanced layout looks clean and keeps the first and last balusters the same distance from each post.

Center markout:

On center spacing = Baluster width + Actual gap

First center = Actual gap + Baluster width / 2

Each next center = Previous center + On center spacing

Mark the first center from the left post face, then repeat the on center distance for every baluster after it. The last center should land at the mirror position from the right post.

Variables:

  • Section length = clear distance between inside post faces, measured in inches
  • Baluster width = finished width of one baluster in inches (not the nominal lumber size)
  • Max gap = largest allowed clear opening between balusters in inches
  • Count = minimum whole number of balusters that keeps every gap at or below the max
  • On center = distance from one baluster center to the next

Example:

A 72 inch level section with 1.5 inch balusters and a 4 inch maximum gap.

  • Count = ceil((72 - 4) / (1.5 + 4)) = ceil(68 / 5.5) = ceil(12.36) = 13 balusters
  • Spaces = 13 + 1 = 14 gaps
  • Actual gap = (72 - 13 × 1.5) / 14 = (72 - 19.5) / 14 = 52.5 / 14 = 3.750 in
  • On center = 1.5 + 3.75 = 5.250 in
  • First center = 3.75 + 0.75 = 4.500 in from left post
  • Second center = 4.5 + 5.25 = 9.750 in
  • Third center = 9.75 + 5.25 = 15.000 in

Continue adding 5.250 inches until all 13 centers are placed. The last center lands at 67.500 inches, leaving a 3.750 inch gap to the right post. This baluster spacing calculator handles the rounding so you only need to mark and drill.

Quick rule: Estimate roughly 3 balusters per linear foot of railing when using standard 1.5 inch wood balusters. For 3/4 inch iron or metal balusters, plan for about 4 per foot. This gives a fast count for budgeting before you run exact numbers through the calculator.

Stair section example:

A stair section with 60 inch horizontal run and 42 inch total rise, using 3/4 inch metal balusters and a 4 inch max gap.

  • Sloped rail = √(60² + 42²) = √(3600 + 1764) = √5364 = 73.24 in
  • Stair angle = atan(42 / 60) × 180 / π = 35.0°
  • Count = ceil((73.24 - 4) / (0.75 + 4)) = ceil(69.24 / 4.75) = ceil(14.58) = 15 balusters
  • Actual gap = (73.24 - 15 × 0.75) / 16 = (73.24 - 11.25) / 16 = 3.874 in
  • On center = 0.75 + 3.874 = 4.624 in along the sloped rail

Assumptions:

  • Section length is measured between inside post faces, not outside. Post width is not included in the calculation
  • Baluster width is the finished dimension. A nominal 2×2 wood baluster is 1.5 inches. A nominal 2×4 is 1.5 × 3.5 inches
  • End gaps equal interior gaps (balanced layout). Some builders prefer tighter end gaps, which requires a different formula
  • The 4 inch maximum gap follows IRC R312.1.3 for residential guard openings. Check your local jurisdiction for the actual requirement
  • For stairs, the calculator assumes balusters are plumb (vertical) and spaced along the sloped top rail. The clear gap is measured perpendicular to the baluster faces
  • Rounding to the nearest 1/16 inch is shown for practical tape measure use. Actual calculated values have more precision

Frequently Asked Questions

How do you calculate baluster spacing?

Count the balusters first. Divide the section length minus one max gap by the baluster width plus the max gap, then round up. A 72 inch opening with 1.5 inch balusters and a 4 inch max gap needs 13 balusters. Actual spacing equals the leftover open space divided by 14 gaps, giving 3.75 inches each.

How do you calculate baluster spacing on stairs?

Calculate the sloped rail length from horizontal run and total rise: sloped length equals the square root of run squared plus rise squared. Use this sloped length as your section length. The gap formula works the same as a level section. A 60 inch run with 42 inch rise produces about 73 inches of sloped rail.

What is the maximum gap between deck balusters?

Most U.S. residential building codes set the maximum clear opening at 4 inches, following IRC Section R312.1.3. This prevents small children from passing through the railing. Some jurisdictions require 3.5 inches or less. Confirm with your local building inspector before drilling, because requirements vary by region.

How many balusters do I need per foot of railing?

About 3 balusters per linear foot when using standard 1.5 inch wide balusters with a 4 inch maximum gap. Thinner 3/4 inch iron or metal balusters need roughly 4 per foot. Use this estimate for budgeting, then run the baluster spacing calculator before purchasing to avoid waste or a return trip.

How do you find even spacing between balusters?

Subtract total baluster width from the section length to get the open space. Divide by the number of gaps, which is the baluster count plus one. This produces identical end gaps and interior gaps. Mark all centers from one post face using the on center distance to keep the layout accurate and consistent.

How do you calculate baluster spacing on a porch railing?

Porch railing spacing uses the same formula as deck railing. Measure between inside post faces, pick your baluster width, and set the maximum gap to 4 inches or less. A typical 8 foot porch section (96 inches) with 1.5 inch wood balusters needs 17 balusters spaced about 3.92 inches apart.