Balusters and spindles are the vertical members that fill the space between your deck’s top and bottom rail. They’re structural safety components as much as they are decorative ones — and getting the spacing calculation wrong can mean failing a building inspection, creating a climbing hazard for children, or producing a railing that simply looks uneven and unprofessional.
Whether you’re building a new deck, replacing an old railing, or pricing up materials for a client, knowing how to calculate baluster and spindle spacing for decks accurately saves time, prevents costly rework, and ensures your project meets the code requirements that protect the people who use it. This guide gives you the complete formula, three worked examples across common real-world scenarios, a clear breakdown of the variables involved, and answers to the questions that come up most often on this topic.
How to Calculate Baluster and Spindle Spacing for Decks: Quick Formula
The goal of the spacing calculation is to find a gap between balusters that is equal across the entire rail section and no wider than the maximum allowed by your local building code — typically 100 mm (4 inches) in most countries.
The two-step process is:
Step 1 — Find the Number of Balusters Needed
n = ROUNDUP [ (L − S_max) ÷ (W + S_max) ]
Where:
- n = number of balusters required
- L = clear span of rail between inside faces of posts (mm or inches)
- W = width of one baluster/spindle (mm or inches)
- S_max = maximum allowable gap (typically 100 mm / 4 inches)
- ROUNDUP = always round the result up to the next whole number
Step 2 — Calculate the Actual Equal Spacing
S = (L − n × W) ÷ (n + 1)
Where:
- S = actual gap between each baluster (will be equal to or less than S_max)
- n = number of balusters from Step 1
- L = clear span between posts
- W = baluster width
Quick example: Rail span L = 1,800 mm, baluster width W = 45 mm, max gap S_max = 100 mm
Step 1: n = ROUNDUP[(1800 − 100) ÷ (45 + 100)] = ROUNDUP[1700 ÷ 145] = ROUNDUP[11.72] = 12 balusters
Step 2: S = (1800 − 12 × 45) ÷ (12 + 1) = (1800 − 540) ÷ 13 = 1260 ÷ 13 = 96.9 mm actual gap
Result: 12 balusters evenly spaced at 96.9 mm — comfortably under the 100 mm code limit.
Use the free Baluster Calculator at CalcFormula to run this calculation instantly for any rail section length, baluster width, or maximum gap requirement.
Building Code Requirements That Affect Baluster Spacing
Before doing any arithmetic, you need to know the maximum permitted gap for your location. These requirements exist to prevent children from getting their heads trapped between balusters — the standard is based on the diameter of a child’s head, not arbitrary preference.
United States — International Residential Code (IRC)
The IRC requires that balusters be spaced so that a 4-inch (102 mm) sphere cannot pass between them. In practice, this means a maximum clear gap of 100 mm (just under 4 inches) is the safe working limit. This applies to both flat deck rails and stair rails.
United Kingdom — Building Regulations Part K
UK regulations require that a 100 mm sphere cannot pass through any opening in a guarding (balustrade). For areas accessible to children under 5, this tightens to a 100 mm sphere test with additional consideration for horizontal climbability — widely spaced horizontal members are discouraged since they act as a ladder.
Australia and New Zealand — AS 1657 / NZS 3604
The Australian standard specifies a maximum gap of 125 mm in most residential applications. However, many councils and certifiers default to the 100 mm sphere rule for consistency and liability reasons. Always verify the requirement with your local certifier.
Stair Balusters
For stair sections, the same 100 mm maximum gap applies to gaps measured perpendicular to the baluster (not along the rake). On a raked stair, the diagonal opening between angled balusters can appear larger than the perpendicular gap — and it’s the perpendicular measurement that governs. This distinction is covered further in the step-by-step examples below.
Rail Height Requirements
While not part of the spacing calculation itself, rail height directly determines whether a railing is required at all. In most jurisdictions, a railing is required for any deck 600 mm (24 inches) or more above adjacent grade. Minimum rail height is typically 900 mm (36 inches) for residential decks and 1,070 mm (42 inches) for higher decks or commercial applications. Confirming your local height requirement before calculating baluster quantities prevents having to revise your design later.
What Affects the Baluster and Spindle Spacing Calculation
Each of these variables feeds directly into your formula. Measuring any of them incorrectly changes your baluster count, your spacing, or both.
1. Clear Span Between Posts (L)
This is the inside face to inside face distance of the posts that bookend each rail section. It is not the centre-to-centre post spacing, and it is not the full rail length. Measure from the face of one post to the face of the next. For multi-section rails with varying post spacing, calculate each section independently — a 12-baluster section and a 9-baluster section cannot simply be averaged.
2. Baluster (Spindle) Width (W)
Measure the actual face width of your chosen baluster. Nominal timber sizes are almost always smaller than their label — a “45 mm” DAR (dressed all round) baluster is often closer to 42–44 mm after milling. Use the actual measured width, not the nominal size, to avoid the accumulated error that grows as you multiply across 12, 15, or 20 balusters in a section.
3. Maximum Allowable Gap (S_max)
Use 100 mm for most residential work in Australia, the UK, and the US. This number feeds into both steps of the formula — it determines how many balusters you need and sets the ceiling for the actual gap you calculate.
4. End Spacing (First and Last Gap)
The formula places an equal gap at each end (between the post face and the nearest baluster) and between each baluster. This first-and-last gap equals the same spacing (S) as all internal gaps, which is what produces the even appearance. If you want a different end spacing — for example, a tighter gap at the post to visually anchor the balusters — you subtract your preferred end spacing from L on both sides before running the formula on the remaining span. This is an aesthetic choice, not a code requirement.
5. Post Width
The post width is already excluded from (L) if you measure clear span correctly. The most common mistake in this calculation is measuring from post centre to post centre rather than face to face — this overstates L and produces too few balusters with gaps that exceed the code limit.
6. Stair Rake Angle
For stair sections, balusters are installed on a rake. The horizontal gap between balusters is not the same as the perpendicular gap across the angled rail. The perpendicular gap governs for code compliance and is what building inspectors will measure. The worked example in the following section addresses this in detail.
7. Material and Profile
Round, square, flat bar, and twisted balusters all have different face widths at different orientations. A 25 mm round spindle has an effective width of 25 mm regardless of rotation. A 40 × 10 mm flat bar presents either 10 mm or 40 mm to the measurement depending on orientation. Use the face width that presents to the gap — the measurement as viewed from outside the railing looking in.
Step-by-Step: How to Calculate Baluster and Spindle Spacing for a Deck
Worked Example 1: Single Flat Rail Section
Scenario: One rail section, posts 2,100 mm apart (centre to centre), 140 × 45 mm timber posts, 45 mm square balusters, maximum gap 100 mm.
Step 1 — Find clear span (L) Post centre spacing − post width = 2,100 − 140 = 1,960 mm
Step 2 — Calculate number of balusters n = ROUNDUP[(1960 − 100) ÷ (45 + 100)] n = ROUNDUP[1860 ÷ 145] n = ROUNDUP[12.83] n = 13 balusters
Step 3 — Calculate actual equal spacing S = (1960 − 13 × 45) ÷ (13 + 1) S = (1960 − 585) ÷ 14 S = 1375 ÷ 14 S = 98.2 mm ✅ (under 100 mm — code compliant)
Result: 13 balusters evenly spaced at 98.2 mm gaps, including end gaps.
Material note: Order 13 balusters for this section. If your deck has three identical sections at this spacing, you need 39 balusters plus waste (order 41–42 to allow for any rejects or cuts).
Worked Example 2: Multi-Section Deck Rail with Varying Spans
Scenario: A deck with three rail sections: Section A = 2,400 mm post centres, Section B = 1,800 mm post centres, Section C = 3,000 mm post centres. All using 140 mm posts, 42 mm actual-width balusters, 100 mm maximum gap.
Calculate each section independently:
Section A — Clear span = 2,400 − 140 = 2,260 mm n = ROUNDUP[(2260 − 100) ÷ (42 + 100)] = ROUNDUP[2160 ÷ 142] = ROUNDUP[15.21] = 16 balusters S = (2260 − 16 × 42) ÷ 17 = (2260 − 672) ÷ 17 = 1588 ÷ 17 = 93.4 mm ✅
Section B — Clear span = 1,800 − 140 = 1,660 mm n = ROUNDUP[(1660 − 100) ÷ (42 + 100)] = ROUNDUP[1560 ÷ 142] = ROUNDUP[10.99] = 11 balusters S = (1660 − 11 × 42) ÷ 12 = (1660 − 462) ÷ 12 = 1198 ÷ 12 = 99.8 mm ✅
Section C — Clear span = 3,000 − 140 = 2,860 mm n = ROUNDUP[(2860 − 100) ÷ (42 + 100)] = ROUNDUP[2760 ÷ 142] = ROUNDUP[19.44] = 20 balusters S = (2860 − 20 × 42) ÷ 21 = (2860 − 840) ÷ 21 = 2020 ÷ 21 = 96.2 mm ✅
Total balusters needed: 16 + 11 + 20 = 47 balusters Order quantity (add 5% waste): 47 × 1.05 = 49.35 → order 50 balusters
Notice that each section has a slightly different actual spacing (93.4 mm, 99.8 mm, 96.2 mm). This is normal and expected — the gaps within each section are equal, but they won’t match across sections of different lengths. This is correct practice, not an error.
For projects with five or more sections of varying lengths, the Spindle Spacing Calculator at CalcFormula handles multiple sections simultaneously and produces a printable cut list.
Worked Example 3: Stair Baluster Spacing on a Raked Section
Scenario: Stair rail section with a horizontal run of 2,200 mm, stair rake angle of 38°, 42 mm square balusters, 100 mm maximum perpendicular gap between balusters.
On a stair, balusters are vertical but the rail is raked. The gap between balusters is measured perpendicular to the balusters (horizontally), not along the rake.
Step 1 — Identify the governing dimension For a raked stair rail, apply the formula using the horizontal projection of the rail span, which is the horizontal distance between posts at floor level.
Step 2 — Apply the formula using horizontal span n = ROUNDUP[(2200 − 100) ÷ (42 + 100)] = ROUNDUP[2100 ÷ 142] = ROUNDUP[14.79] = 15 balusters S = (2200 − 15 × 42) ÷ 16 = (2200 − 630) ÷ 16 = 1570 ÷ 16 = 98.1 mm ✅
Step 3 — Mark out positions on the string or bottom rail On the stair’s bottom rail (which follows the rake), mark horizontal spacing intervals using a level or square to ensure you’re measuring horizontally, not along the slope. Each baluster is positioned 98.1 mm horizontally from its neighbour.
This horizontal marking method ensures the perpendicular gap is controlled, which is what the code tests for.
Common Mistakes When Calculating Baluster and Spindle Spacing
❌ Mistake 1: Measuring Post Centre-to-Centre Instead of Face-to-Face
This overstates L by the full post width and results in gaps wider than the code allows after installation. Always measure the clear span between the inner faces of posts.
❌ Mistake 2: Using Nominal Baluster Width Instead of Actual Width
Timber sold as “45 mm square” is dressed to approximately 42–44 mm. Multiply that 2–3 mm error by 15 balusters and your total baluster width assumption is 30–45 mm too large — enough to shift your spacing calculation outside code limits. Measure the actual width of a sample baluster before calculating.
❌ Mistake 3: Treating the Target Gap as the Final Spacing
The formula produces an actual equal gap that will typically be slightly less than your maximum allowable gap — not exactly equal to it. Using exactly 100 mm as your planned gap without running Step 2 risks ending up with slightly uneven spacings at the end of each section when you mark out positions in real life.
❌ Mistake 4: Applying One Calculation to the Entire Deck Rail
Each post-to-post section must be calculated independently. A 2,100 mm section and a 2,400 mm section require different baluster counts to achieve approximately equal (and code-compliant) spacing within each run. Using the same count across all sections results in non-uniform gaps in shorter or longer bays.
❌ Mistake 5: Forgetting to Account for End Gaps in the Count
The formula places gaps on both sides of the baluster array — between the post face and the first baluster, and between the last baluster and the opposite post face. This means a section with n balusters has n + 1 gaps. Forgetting the end gaps and using n gaps in Step 2 produces a calculated spacing that’s wider than reality.
❌ Mistake 6: Not Verifying Stair Compliance Separately
Stair balusters are frequently under-specified. The perpendicular-to-baluster gap governs, not the gap measured along the raked rail. Always run a separate calculation for stair sections using horizontal span and verify the perpendicular measurement on site before finalising.
❌ Mistake 7: Ordering Exactly the Calculated Quantity
Balusters get cut short, split during fastening, or rejected for defects. Order a minimum of 5% more than your calculated quantity — rounding up to the nearest pack is usually the most practical approach. For a large deck requiring 60–80 balusters, that means ordering 63–85 units.
Frequently Asked Questions About Baluster and Spindle Spacing for Decks
Q1: What is the maximum gap allowed between deck balusters? In most residential applications in the US, UK, and Australia, the maximum allowable gap between balusters is 100 mm (approximately 4 inches). This is based on the requirement that a 100 mm sphere (representing a young child’s head) cannot pass through any opening in the balustrade. Some Australian councils allow 125 mm in limited circumstances, but 100 mm is the safest working standard. Always verify with your local building authority before committing to a design.
Q2: How many balusters do I need for my deck rail? Use the formula: n = ROUNDUP[(L − 100) ÷ (W + 100)], where L is the clear span between posts in mm and W is the actual baluster width in mm. Run this calculation for each individual post-to-post section and sum the results. The free Baluster Calculator at CalcFormula automates this for any number of sections with a single entry.
Q3: Should baluster spacing be the same as spindle spacing? Yes — balusters and spindles refer to the same vertical infill member, with the terms used interchangeably in different regions and trades. In the UK and Australia, “spindle” is more common. In North America, “baluster” is standard. The spacing formula is identical regardless of which term you use.
Q4: Can I space balusters wider on the lower part of the rail than the upper part? No. The maximum 100 mm gap applies at any point that could be tested with the sphere. If your balusters taper or are angled, test the widest point of the gap for compliance. Fixed vertical balusters with consistent width present a uniform gap throughout, making compliance testing straightforward.
Q5: How do I calculate baluster spacing for a curved or angled deck rail? For a curved rail, measure the chord length (straight-line distance between the two posts) and use that as L in the formula. For angled sections that change direction at an intermediate post, treat each straight segment as a separate section with its own calculation. The overall deck footprint and material quantities for the decking boards themselves can be estimated using the Decking Calculator at CalcFormula, which handles angled and irregular shapes.
Q6: What is the easiest way to mark out even baluster spacing on site? Once you have your calculated spacing (S), cut a spacer block to exactly S width. Work from one post to the other, butting the spacer against each baluster as you set the next. This eliminates cumulative measurement error from re-measuring each position individually with a tape. Label the spacer block with the section it belongs to — different rail sections will have slightly different spacings.
Q7: Do I need to calculate baluster spacing differently for glass or metal panel infills? For solid panel infills (glass, metal sheet, composite panels), the 100 mm sphere rule doesn’t apply to the panel face itself — but it does apply to any gaps between the panel edge and the post or framing, and to any openings in decorative metalwork (grilles, laser-cut screens). If your design includes horizontal or diagonal members as well as vertical balusters, all openings must be tested independently for code compliance.
Free Calculator Tools for Baluster and Spindle Spacing
Running the formula by hand for a single section takes a minute. Running it across six or eight sections with different post spacings, then re-checking stair sections separately, adds up quickly. These free tools handle the full calculation:
Baluster Calculator — CalcFormula Enter rail span, post width, baluster width, and maximum gap. Returns the number of balusters required, actual equal spacing, and total baluster count for multiple identical sections. Ideal for flat deck rails and quick pre-design estimates.
Spindle Spacing Calculator — CalcFormula Purpose-built for multi-section projects with varying spans. Input each section independently, and the tool returns per-section counts, actual spacings, and a total materials list. Includes a stair section mode for raked rail calculations.
Decking Calculator — CalcFormula Once your railing design is confirmed, use the Decking Calculator to estimate board quantities, joist spacing, and total material costs for the deck surface itself — a useful companion tool when preparing a full project materials schedule.
Summary: Getting Baluster and Spindle Spacing Right Every Time
Knowing how to calculate baluster and spindle spacing for decks is a two-step process: first find how many balusters you need to stay within code, then calculate the actual equal gap that distributes them evenly. The critical rules to remember are:
- Always measure clear span (face-to-face of posts), never centre-to-centre.
- Use actual baluster width, not nominal size.
- Calculate each rail section independently — different spans need different baluster counts.
- Run a separate calculation for stair sections using horizontal span and perpendicular gap measurement.
- Order 5% more balusters than your calculation requires to allow for waste and rejects.
- Verify your result against the 100 mm maximum gap rule before marking out — Step 2 confirms your actual spacing is compliant before a single baluster goes in.
Follow these steps, use the formula correctly, and your railing will pass inspection and look professionally finished on every section of the deck.
Content reviewed against IRC Section R507 (Exterior Decks), UK Building Regulations Approved Document K (2013), and AS 1657-2018 (Fixed Platforms, Walkways, Stairways and Ladders). Always verify requirements with your local building authority before commencing work.