Deck Railing Calculator
Turn your railing measurements into a shopping list. Enter each straight run, the post spacing and the baluster style to get the number of posts, balusters (or cables), rail boards, post caps and hardware, with the exact baluster gap for every run.
Last updated:
One number per straight run, measured from the outside of one end post to the other. Separate with commas or new lines.
Untick if the runs are separate (for example on each side of the stairs).
On center. 6 ft is typical for wood; check your rail kit.
3.5 in for a 4×4, 5.5 in for a 6×6.
Gaps stay strictly under this (4 in sphere rule).
How to use the Deck Railing Calculator
- Measure each straight run of railing in feet and type the lengths, separated by commas.
- Tick the corner option if the runs meet and share a corner post.
- Set the maximum post spacing, post width, railing height and rails per section.
- Choose the baluster style and the maximum gap (under 4 in for most codes).
- Read the shopping list and check the layout table for spacing on each run.
How the railing is calculated
- Sections per run = ⌈(run length − post width) ÷ maximum post spacing⌉, so posts stay at or under your spacing.
- Posts per run = sections + 1, minus one for every corner shared with the next run.
- Clear span between posts = (run length − post width) ÷ sections − post width.
- Balusters per section: n = ⌊(clear span − max gap) ÷ (baluster width + max gap)⌋ + 1, and the exact gap is (clear span − n × width) ÷ (n + 1).
- Rails: one top and one bottom rail (plus a middle rail if chosen) per section, cut from stock boards.
Example: a 12 ft run with 4×4 posts and 6 ft maximum spacing needs ⌈(144 − 3.5) ÷ 72⌉ = 2 sections and 3 posts. Each section has 70.25 − 3.5 = 66.75 in of clear span, which takes ⌊(66.75 − 4) ÷ 5.5⌋ + 1 = 12 wood balusters with 3.75 in gaps.
Typical materials per 6 ft section (36 in rail, 4×4 posts)
| Infill | Balusters or cables | Fasteners | Rails |
|---|---|---|---|
| 2×2 wood (1.5 in) | 12 balusters, gap ≈ 3.88 in | 48 screws | 2 rails + 4 brackets |
| Composite (1.5 in) | 12 balusters | 48 screws | 2 rails + 4 brackets |
| Metal (3/4 in) | 14 balusters, gap ≈ 3.87 in | 28 connectors | 2 rails + 4 brackets |
| Cable | 11 cables | tensioner + fixed end per cable per run | top rail only, or top + bottom |
Railing tips
- Through-bolt posts to the rim joist or beam with two 1/2 in bolts and add blocking; a railing is only as strong as its post connections.
- Cut a spacer block to the exact gap so every baluster lands evenly without measuring each one.
- Measure every section between posts after the posts are set; real spacing is rarely perfectly equal.
- Buy a few extra balusters: some boards will be twisted, split or have large knots.
Frequently asked questions
How far apart should deck railing posts be?
Most wood deck railings use posts no more than 6 ft on center, and many aluminum or composite rail kits allow 6 or 8 ft. Cable railing often needs closer posts or intermediate braces (about 4–5 ft) because the cables pull hard on the posts. Always follow your rail system's instructions.
How many balusters do I need per 6 ft section?
A 6 ft on-center section with 4×4 posts leaves about 68.5 in between posts. With 1.5 in wood balusters and gaps under 4 in, that takes 12 balusters with gaps of about 3 7/8 in (3.88 in). With 3/4 in metal balusters it takes 14, with gaps of about 3.87 in.
How many balusters per linear foot of deck railing?
Roughly 2 per foot for 2×2 wood balusters and about 2.3 per foot for 3/4 in metal balusters, once posts are accounted for. The calculator gives the exact count for each run.
How high does a deck railing need to be?
The International Residential Code requires guards at least 36 in high where the deck surface is more than 30 in above the ground, and openings small enough that a 4 in sphere cannot pass through. Some local codes and commercial projects require 42 in, so check with your building department.
Do corner posts count twice?
No. When two runs meet at a corner, one post serves both. Tick the corner option and the calculator subtracts one post for each corner between consecutive runs. Untick it for separate runs, such as two short runs on either side of the stairs.
How many cables does a cable railing need?
Cables are usually spaced no more than 3 in apart so that, even when pushed, the opening stays under 4 in. For a 36 in rail that works out to about 11 cables, and about 13 for a 42 in rail. Each cable in each run needs a tensioner at one end and a fixed fitting at the other.
Does this include stair railings?
No. Stair rails follow the slope of the stairs and use different post spacing and baluster lengths. Measure the deck runs here and plan stair sections separately.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.