Baluster spacing calculator: equal gaps for railings, gates and fences
Updated on 20 November 2026
Balusters in a railing, pickets in a fence, bars in a gate: they look right only when every gap is the same, including the two at the posts. The math is short, but marked one baluster at a time the errors add up and the last gap comes out wrong. This calculator gives the gap, the on-center spacing and the position of every baluster, all measured from the same post face.
For the gate frame, the 45° square tube miter is the square tube miter, and the picket meeting the rail is the square tube tee.
Baluster spacing calculator
Enter the opening, between the inside faces of the two posts, and the baluster width. Choose the number of balusters, or the largest gap allowed, and the calculator finds how many fit. With the length of each baluster, it adds up the total stock. Fractions work (3/4, 3-1/2").
Only paying users can use this calculator
The formula and the worked example are in the text on this page. The calculator, with your own measurements, is part of full access.
The formula
- Gap
g = (L − n × w) / (n + 1)L is the opening, n the number of balusters and w the width of each. There are n + 1 gaps, because there is one at each post.
- On-center spacing
s = g + wFrom one baluster to the next, center to center or edge to edge.
- Mark of baluster i
x = i × g + (i − 1) × wThe left edge of baluster i, measured from the left post face. Marking every baluster from the same face, not from the previous baluster, keeps the errors from adding up.
- By maximum gap
n = ⌈(L − gmax) / (w + gmax)⌉The fewest balusters that keep the gap at or below the maximum.
Worked example
A 48" opening filled with 3/4" square balusters:
- With 10 balusters: gap (48 − 10 × 0.75) / 11 = 3-11/16".
- On-center spacing: 3.68 + 0.75 = 4-7/16".
- Marks from the left post: 3-11/16", 8-1/8", 12-9/16", 17", 21-7/16", 25-13/16", 30-1/4", 34-11/16", 39-1/8" and 43-9/16".
- Check: the last baluster ends at 44-5/16", one gap short of the other post.
With 9 balusters the gap would be 4-1/8", too wide for a residential guard. Set the maximum gap to 3.9" and the calculator picks 10.
Railings: the 4-inch sphere rule
In US residential guards, the International Residential Code (IRC R312) does not let a 4-inch sphere pass between balusters. Use a maximum gap under 4" and check your local code and the project. In metric countries the rule is often 100 or 110 mm.
Frequently asked questions
- How do you calculate baluster spacing?
- Subtract the width of all balusters from the opening and divide what is left by the number of balusters plus one: g = (L − n × w) / (n + 1). A 48" opening with 10 balusters of 3/4" gives a 3-11/16" gap.
- What is the maximum gap between balusters?
- Under the IRC a 4-inch sphere must not pass, so keep the gap under 4". Check your local code.
- Why mark every baluster from the same post?
- Because marking from the previous baluster adds each small error to the next, and the last gap comes out wrong. From the same face, every mark carries the error of one measurement only.
Parts in this guide
Other guides
- How to develop a cone (frustum) in sheet metal: formula, sector radii and angle, step by step
- Lobster back bend calculator (segmented 90° elbow): gore angles, cut heights and how many plates
- Pipe saddle calculator and development: how to lay out a pipe-to-pipe branch (tee) at 90 and 45 degrees
- Square to round transition: development by triangulation, step by step
- Bend allowance and K-factor calculator, and the neutral axis: why every development uses D − t
- Sheet metal glossary: the terms of marking out and pattern development in plate fabrication
- How we check the Planichapa calculations, and who is behind them
- LITIO alternative: Planichapa develops sheet metal parts in the browser, nothing to install, now that LITIO2 is no longer sold
- How to lay out a miter-cut pipe: paper template, sine wave and ordinate table
- Plate 'n' Sheet alternative: Planichapa develops sheet metal parts in the browser, with the price on the page
- Pipe ovality: a calculator, the formula, a worked example, the limits the codes use and how to measure it in the shop
- Steel plate and sheet metal weight calculator: weight per m² and ft², gauges and stock plate sizes
- MS plate weight chart: kg per square meter, per sq ft and per plate, 1.6 to 50 mm
- MS angle weight chart: kg per meter of equal and unequal angles (IS 808)
- MS pipe size and weight chart: IS 1239 light, medium and heavy, 15 to 150 NB
- Sheet metal gauge chart: gauge to inches and mm for steel, galvanized, stainless and aluminum
- Pipe offset calculator: rolling offsets, travel, run, take-out and pipe cut length
- Cut list calculator for steel bars: tube, angle and flat bar from 20 ft or 6 m sticks
- Arc radius calculator: radius from chord and rise (sagitta), arc length and layout heights
- Right triangle calculator for fabrication: diagonal, squareness, angle and slope
- Taper calculator: taper angle, half angle, taper per foot and ratio
- Sheet metal pattern development software: how to choose, and what changes between a desktop program, a phone app and an online calculator
- Keyway size chart: ANSI B17.1 and DIN 6885 key, shaft and hub keyseat by shaft diameter
- Eccentric and concentric reducers: which one to use and how each one develops on plate
- Roller chain size chart: ANSI, ISO 606, motorcycle and bicycle chain pitch and roller diameter
- Sprocket dimensions: pitch diameter, outside and root diameter, tooth form and a pitch diameter chart
- Bolt circle layout: the position of each hole, the chord between holes and a chord chart
- Chain length and sprocket ratio: the formulas, a worked example and how many links to cut
- Screw flight calculator: the flat blank of a screw conveyor flight (auger), with the formula and a worked example
- Plate rolling calculator: the blank length of a rolled shell, with the formula, a chart and a worked example
- Tube notching template generator: a printable coping template for any tube, angle and offset
- Dished head calculator: depth, volume, blank diameter and weight of torispherical, 2:1 elliptical and hemispherical heads
- Cone template generator: a printable full-size cone template for hoppers, funnels and reducers
- Pie cut calculator for exhaust and tube bends: saw angle, pie lengths and a wrap-around template
- Duct transition layout: square to round duct, centered, offset or flat on one side
- Pipe template, printable at full size: tee saddle, 45° lateral and miter cut for every pipe size from NPS 1/2 to 12
- Register boot layout: from a floor, wall or ceiling register to a round duct, in inches
- Plenum box and plenum transition layout: the sides, the end cap, the collar and the transitions
- Smoker stack and firebox templates: the cuts where pipe meets the cook chamber, in inches
- Laser and plasma cutting cost calculator: the formula, a worked example and how to measure the cut length
- Cutting a flat pattern DXF on your plasma or laser table: layers, kerf and lead-ins in SheetCAM, ProNest and FastCAM
- Tank volume calculator and strapping chart: horizontal and vertical tanks with 2:1, torispherical, hemispherical or flat heads
- Merge collector template generator: a printable cutting template for 2, 3, 4, 6 or 8 into 1
- Dome template generator: printable gores for a dome or a hemisphere in paper, EVA foam or sheet metal
- DIY cyclone dust collector plans: every sheet of the cyclone from the Stairmand proportions, for any duct size
- Cable tray bend: how to make vertical and horizontal 90 and 45 degree bends with a V notch
- How to build a steel stair: working out the steps, the sawtooth stringers and an L or U stair
- Fixed ladder requirements: OSHA rung spacing, the cage and the hoop bar length
- Welding amperage chart: 6011, 6013 and 7018 stick electrodes by size
- Commercial kitchen hood: the gauge, the overhang, the exhaust CFM, the duct and the layout
- Tap drill chart: tap drill sizes for metric, UNC, UNF, BSP and NPT
- Wood stove from sheet metal: the box, the stovepipe, the elbow, the tee, the cap and the roof flashing, with the code rules
- DIY centrifugal blower: size the impeller and the scroll from airflow and pressure