How it works
The calculator divides each straight run into equal sections, counts posts at the section ends and fills each section with balusters.
Sections per run = ⌈ Run length ÷ Post spacing ⌉ · Posts = Runs × (Sections per run + 1)
Kit: Balusters = Sections × Balusters per section (from the maker)
Own layout: Clear span = Run length ÷ Sections per run − Post width
Balusters per section = ⌈ (Clear span − Gap) ÷ (Baluster width + Gap) ⌉ · Actual gap = (Clear span − n × Baluster width) ÷ (n + 1)
⌈ ⌉ means rounding up to the next whole section or baluster. In your own layout, n balusters leave n + 1 gaps, all the same size.
Quantities, not a guard design
A deck guard has to resist loads and meet height and opening rules. This calculator only counts parts. The IRC rules it mentions – guards at least 36 in high (R312.1.2) and no opening that lets a 4 in sphere through (R312.1.3) – are quoted as a reference, and local codes amend them. Post size, how posts attach to the framing and the railing system’s approvals come from the railing maker’s instructions, your plans or a qualified professional.
Sections and posts
Railing kits come in fixed section lengths. Trex makes its Select rails at on-center dimensions – the 6 ft rail spans 6 ft from post centre to post centre – and designs the kits for posts at a maximum of 6 ft or 8 ft on center; smaller spans are allowed. TimberTech’s 6 ft and 8 ft rails are designed not to exceed 6 ft and 8 ft post centre to post centre. The calculator splits each run into equal sections no longer than that, so a 12 ft run with 6 ft kits has 2 sections and 3 posts.
Balusters
With a kit, the maker tells you how many balusters a full section takes. With your own layout, the space between two posts is the section length less one post width. If n balusters of width w fill a clear span with n + 1 equal gaps, each gap is (span − n × w) ÷ (n + 1). The calculator picks the smallest n that keeps every gap at or below the largest gap you enter and shows the gap you get.
Rails
Trex Select kits include a top rail and a bottom rail. TimberTech’s Classic Composite kits include the bottom rail but not the top rail, which is ordered separately – the calculator counts one per section. In your own layout, each section gets one top and one bottom rail cut to the clear span from your stock length; offcuts too short for another section are not reused.
Worked example in words
A deck with three open sides of 12 ft each and Trex Select 6 ft sections has 12 ÷ 6 = 2 sections per side, so 6 sections and 3 × 3 = 9 posts. At 14 balusters per section that is 84 balusters and 6 railing kits. Where the sides meet at corners and share a post, you need fewer posts.
Worked example
Inputs
- Length of one run
- 12 ft
- Number of runs
- 3
- Railing
- Trex Select, 6 ft on-center sections – 14 round aluminum balusters each
- Extra balusters
- 0 %
Result
- Railing sections
- 6
- Posts
- 9
- Balusters per section
- 14
- Balusters
- 84
- Rail kits
- 6
- Top rails to buy separately
- 0
- Bottom rails to buy separately
- 0
Common mistakes
- Spacing posts wider than the railing allows. Trex designs its Select kits for posts at a maximum of 6 ft or 8 ft on center, depending on the length, and TimberTech’s 6 ft and 8 ft rails must not exceed that from post centre to post centre.
- Counting balusters from the post spacing instead of the clear span. The posts take up part of each section, so the space for balusters is the spacing less one post width.
- Using the nominal post size. A 4 × 4 post is 3½ in wide when dressed.
- Forgetting the top rail. TimberTech’s Classic Composite kits do not include it, so it is bought separately for each section.
- Treating the 4 in sphere as a spacing to aim for. It is the most the code lets through; the gap you build must be smaller.
Assumptions and limits
- Each run is split into equal sections no longer than the post spacing (sections per run = ⌈ run ÷ spacing ⌉); every run has its own end posts (posts = sections + 1 per run).
- Kits – balusters per section, section length and whether the top rail is included come from the maker’s instructions or order form; one kit per section.
- Your own layout – the clear span is the section length less one post width; n balusters leave n + 1 equal gaps, all no larger than the gap you enter. Top and bottom rails are one piece per section cut from your stock length.
- Quantities only. Post size, post-to-framing connections, guard height and load resistance are structural and code questions this calculator does not check.
Frequently asked questions
How many balusters do I need per section?
For a kit, use the maker’s count. Trex lists 14 round aluminum balusters per 6 ft on-center Select section and 20 per 8 ft section; TimberTech lists 13 composite balusters for a 6 ft section and 18 for 8 ft. For your own layout, the calculator spaces balusters so no gap is larger than the one you enter.
How far apart can deck railing posts be?
That is set by your railing maker and your design. Trex designs its Select kits for posts at a maximum of 6 ft or 8 ft on center, depending on the length used, and TimberTech’s 6 ft and 8 ft rails are designed not to exceed those distances post centre to post centre.
What is the 4 inch sphere rule?
IRC R312.1.3 says required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 in (102 mm) in diameter, with exceptions at stairs. It is quoted here as a reference – check your local code.
How many posts do I need for deck railing?
One more than the number of sections in each straight run. Three 12 ft runs with 6 ft sections have 2 sections each and 3 posts each, so 9 posts – or fewer where two runs share a corner post.
Do railing kits include the top rail?
Trex Select kits list a top rail and a bottom rail among their parts. TimberTech’s Classic Composite Series kits include the bottom rail, support rails, balusters and hardware, but the top rail, post sleeves, caps and skirts are sold separately.
Sources
- Trex Select Horizontal Railing – Installation Instructions (TSHR-0422) — Trex Company. Railings made at on-center dimensions, 6 ft and 8 ft OC; "Select Railing Kits are designed for posts to be installed at maximum of 6' or 8' … ON CENTER depending on the length being used"; balusters needed: round aluminum, 14 per 6' OC section, 20 per 8' OC section; kit parts include top rail and bottom rail; the 8' rail needs the aluminum rail stiffener.
- TimberTech Classic Composite Series and Reserve Rail – Installation Guide (January 2020) — TimberTech (copy hosted by a dealer on Shopify). "Rails are designed not to exceed 10', 8' and 6' from center of post to center of post, respectively"; composite balusters 13 in a 6' section, 18 in 8', 23 in 10'; top rail not included in Classic Composite Series kits.
- Order Form – Classic Composite Series (2023) — TimberTech (copy hosted by Doman Building Materials). 6' and 8' Universal Rail Kits include support rails, hardware, bottom rail, balusters (13 / 18) and foot blocks; "Top Rail, Post Sleeves, Post Caps, and Post Skirts sold separately"; composite balusters 1.25" × 1.25"; "Balusters needed per section: 6ft-13, 8ft-18, 10ft-23".
- Seattle Residential Code 2015, Chapter 3 – Building Planning (2015 IRC with amendments) — City of Seattle, Department of Construction and Inspections. R312.1.3: "Required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter" (exceptions for stairs); R312.1.2: guards not less than 36 in high.
- NDS Supplement (2018), Table 1A – Nominal and Minimum Dressed Sizes of Sawn Lumber — American Wood Council. Dry dressed sizes: nominal 1 in → 3/4 in, 2 in → 1-1/2 in; widths 4 → 3-1/2 in, 6 → 5-1/2 in.
- NIST Handbook 44, Appendix C – General Tables of Units of Measurement — National Institute of Standards and Technology. Exact unit definitions: 1 in = 2.54 cm, 1 yd³ = 27 ft³, 1 US gal = 231 in³, 1 lb = 0.45359237 kg.
Method reviewed November 6, 2026