---
title: "Deck Railing Calculator: Posts, Balusters, Rails | DeckTally"
description: "Free deck railing calculator: posts at 6 ft, balusters that keep every gap under 4 inches, rails, cap and fasteners from the AWC deck guide, with working."
author: "Hassan Razeen"
datePublished: "2026-10-22"
dateModified: "2026-11-16"
image: "https://decktally.com/og.png"
url: "https://decktally.com/deck-railing-calculator/"
---

# Deck Railing Calculator

To plan a deck railing, divide each section by the 6 ft maximum post spacing and round up for the bays, add one for the posts, then fill each bay with balusters spaced so no opening passes a 4-inch sphere, with a top and bottom rail per bay and a cap along the run. 40 ft of guard in 2 sections needs 10 posts, 88 balusters at 3.26-inch gaps, 16 rails, 40 ft of cap, 270 screws and 20 post bolts.

## Your materials

Results update as you type.

Posts

10 posts

4 × 4

Balusters

88 balusters

2 × 2, 3.26 in gaps

Rail cap

40 linear ft

2 × 6 or 5/4

### How it adds up

1.  Posts 10 posts
    
    Each section is 240 in: ÷ 72 in maximum spacing = 3.33, rounded up to 4 bays, so 5 posts 5 × 2 sections = 10
    
2.  Balusters 88 balusters
    
    Bay between posts: (240 in − 5 × 3.5 in) ÷ 4 = 55.63 in (55.63 in − 3.5 in) ÷ (1.5 in + 3.5 in) = 10.43, rounded up to 11 per bay, leaving 3.26 in gaps 11 × 8 bays = 88
    
3.  Rails 16 rails
    
    A top and a bottom rail in each of 8 bays = 16, 74.17 ft in all
    
4.  Rail cap 40 linear ft
    
    One cap along the whole 40 ft run
    
5.  Screws 270 screws
    
    Rails: 16 × 2 ends × 2 #8 screws = 64 Cap: 10 posts × 3 #12 screws = 30 Balusters: 88 × 2 #8 screws (one top, one bottom) = 176 Posts: 10 × 2 half-inch through-bolts with washers = 20
    
6.  Code checks Pass
    
    The deck is 36 in above grade, over 30 in, so a guard is required. Openings of 3.26 in will not pass a 4 in sphere. Guard height: 36 in minimum, measured from the deck surface.
    

**Estimates only.** Results come from the formulas listed below and use no outside data. Check local building codes and your supplier before buying.

These results are for the default sizes. Turn on JavaScript to update them as you type.

  

## One bay of your railing

-   11 balusters in each bay, 3.26 in apart
-   5 posts in each section, 8 bays in all
-   Drawn 36 in high, the guide's minimum

[**10** posts **88** balusters **40** linear ft Results ↓](https://decktally.com/deck-railing-calculator/#results-heading) Embed this calculator on your site

Paste this where you want the calculator. It is free, shows no ads, works in any site, and links back to this page. Change the height to suit your layout.

Embed code <iframe src="https://decktally.com/embed/deck-railing-calculator/" height="1100" style="width:100%;border:0" loading="lazy" title="Deck Railing Calculator by DeckTally"></iframe> 

## What do I need to enter?

1.  The total length of railing, every edge that gets a guard added together.
2.  How many separate straight sections that is; each gets a post at both ends.
3.  How high the deck surface is above the ground, which decides whether a guard is required at all.
4.  The widest gap you want between balusters, under 4 inches.

## How are railing posts, balusters and rails counted?

-   **Posts**: each section's length ÷ 6 ft, rounded up, is the bays; add one for the posts.
-   **Bay width**: the section length minus the posts' own width, divided by the bays.
-   **Balusters per bay**: (bay − gap) ÷ (baluster width + gap), rounded up, then spaced evenly; the result shows the gap that leaves.
-   **Rails**: a 2 × 4 top and bottom rail per bay, cut to the bay width. **Cap**: one 2 × 6 or 5/4 run along the whole length.
-   **Fasteners**: two screws at each rail end, three per post for the cap, one top and bottom per baluster, two through-bolts per post.

### Assumptions

-   The guard is the example in the American Wood Council's deck guide: 3.5-inch (nominal 4 × 4) posts at most 6 ft apart, 2 × 2 balusters, 2 × 4 top and bottom rails and a 2 × 6 or 5/4 cap, 36 inches high at least. Cable, glass, metal and composite systems follow their maker's instructions and local approval instead.
-   Each section gets a post at both ends, and the posts within it are spaced evenly. Corners where two sections meet are counted as two posts; merge them in your order if one post serves both.
-   Balusters are 1.5 inches wide and spaced evenly across each bay, with as few as keep the gap at or under what you enter, which the form caps at the 4-inch sphere limit. The bottom rail's gap to the deck is not checked; keep it under 4 inches too.
-   Fasteners follow the figure's schedule: two #8 screws at each rail end, three #12 screws per post for the cap, one #8 screw top and bottom per baluster, and two half-inch through-bolts per post into a joist or rim joist of at least 2 × 8. Hold-down anchors, stairs and gates are not counted.

## Worked example

40 ft of guard in 2 sections on a deck 36 inches above grade, 3.5-inch gaps wanted:

-   **Posts: 10 posts, 4 × 4** Each section is 240 in: ÷ 72 in maximum spacing = 3.33, rounded up to 4 bays, so 5 posts 5 × 2 sections = 10
-   **Balusters: 88 balusters, 2 × 2, 3.26 in gaps** Bay between posts: (240 in − 5 × 3.5 in) ÷ 4 = 55.63 in (55.63 in − 3.5 in) ÷ (1.5 in + 3.5 in) = 10.43, rounded up to 11 per bay, leaving 3.26 in gaps 11 × 8 bays = 88
-   **Rails: 16 rails, 2 × 4, 55.63 in each** A top and a bottom rail in each of 8 bays = 16, 74.17 ft in all
-   **Rail cap: 40 linear ft, 2 × 6 or 5/4** One cap along the whole 40 ft run
-   **Screws: 270 screws, plus 20 post bolts** Rails: 16 × 2 ends × 2 #8 screws = 64 Cap: 10 posts × 3 #12 screws = 30 Balusters: 88 × 2 #8 screws (one top, one bottom) = 176 Posts: 10 × 2 half-inch through-bolts with washers = 20
-   **Code checks: Pass, Guard required above 30 in** The deck is 36 in above grade, over 30 in, so a guard is required. Openings of 3.26 in will not pass a 4 in sphere. Guard height: 36 in minimum, measured from the deck surface.

## What are the code requirements for deck railing?

From the American Wood Council's deck guide, which cites IRC R312.1. Your local code may amend them.

-   A guard on any deck more than 30 inches above grade, at least 36 inches high from the deck surface.
-   No opening that lets a 4-inch sphere through; at stairs, no triangular opening that lets a 6-inch sphere through.
-   In the guide's example: 4 × 4 posts, not notched, at most 6 ft apart, through-bolted with two half-inch bolts to a joist or rim joist of at least 2 × 8; on a required guard up to 36 inches high, hold-down anchors with at least 1,800 lb of allowable tension.
-   2 × 4 top and bottom rails, 2 × 2 balusters and a 2 × 6 or 5/4 cap, with the fastener schedule the calculator counts.

## What does this calculator leave out?

-   Cable, glass, metal, composite and other railing systems: follow the maker's spacing and your building department.
-   Hold-down anchors, blocking at the posts, gates and stair railings; the [deck stair calculator](https://decktally.com/deck-stair-calculator/) says when a stair guard and handrail are required.
-   Corners shared by two sections, which the count treats as two posts.
-   Post height and the bottom rail's gap to the deck, which must also stay under 4 inches.

## FAQ

### How far apart should deck railing posts be?

At most 6 ft on center for the 4 × 4 posts in the American Wood Council's example guard. A 20 ft section therefore needs 5 posts (240 ÷ 72 = 3.33, rounded up to 4 bays, plus one), and 60 ft in 3 sections needs 15. Posts for a required guard must be through-bolted to a joist or rim joist of at least 2 × 8.

### How many balusters do I need?

Enough that no opening passes a 4-inch sphere: with 1.5-inch balusters and a 3.5-inch gap, each 55.63-inch bay takes 11, so the 40 ft example takes 88. A smaller gap means more balusters; the calculator spaces them evenly and tells you the gap you actually get.

### How high does a deck railing have to be?

36 inches at least, measured from the deck surface, in the guide's example guard. A guard is required at all once the deck is more than 30 inches above grade; a 24-inch deck needs none, though many owners add one anyway. The guide gives that threshold twice: its stair figure (Figure 30) says a total rise of 30 inches or more, while its Guard Requirements and IRC R312.1.1 say more than 30 inches above grade, so at exactly 30 inches ask your building department.

### What is the maximum gap between deck balusters?

Openings in the guard may not allow a 4-inch sphere to pass, so the clear gap must be under 4 inches. The 40 ft example asks for 3.5 inches and ends up at 3.26 once the balusters are spaced evenly. Triangular openings at stairs have their own 6-inch sphere limit.

### What size posts and rails does a deck railing use?

The guide's example uses 4 × 4 posts, 2 × 4 top and bottom rails, 2 × 2 balusters and a 2 × 6 or 5/4 cap. Posts are not notched, and they bolt through to a joist or rim joist of at least 2 × 8 with two half-inch bolts and washers. For a required guard up to 36 inches high the posts also need hold-down anchors with at least 1,800 pounds of allowable tension, which this calculator does not count.

### How many screws does a deck railing need?

270 for the 40 ft example: 64 at the rail ends (two #8 screws at each end of each rail), 30 for the cap (three #12 screws per post) and 176 for the balusters (one #8 screw top and bottom), plus 20 through-bolts for the posts. The figure allows threaded nails instead of the screws at each of those places.

### How many balusters for an 8 ft rail section?

16 with 1.5-inch balusters and 3.5-inch gaps: an 8 ft section takes 3 posts (96 ÷ 72 = 1.33, rounded up to 2 bays), each bay is 42.75 inches between posts and takes 8 balusters, leaving 3.42-inch gaps. Enter 8 ft and 1 section above to change the gap.

The [deck joist calculator](https://decktally.com/deck-joist-calculator/) sizes the rim joist these posts bolt to, and the [deck stain calculator](https://decktally.com/deck-stain-calculator/) takes the railing's area as extra area to coat.

## Sources

The counts are arithmetic. Every guard rule on this page comes from these publications. Follow them and your local building code over this page where they differ.

-   [DCA 6: Prescriptive Residential Wood Deck Construction Guide (2015), Guard Requirements, Guard Post Attachments and Figure 24](https://awc.org/wp-content/uploads/2021/12/AWC-DCA62015-DeckGuide-1804.pdf), American Wood Council. A guard on any deck more than 30 inches above grade; the example guard with 4 × 4 posts at 6 ft maximum spacing, a 36 inch minimum height, 2 × 2 balusters, openings that will not pass a 4 inch sphere, 2 × 4 top and bottom rails, a 2 × 6 or 5/4 cap, and the fastener schedule for each; posts through-bolted with two 1/2 inch bolts to a joist or rim joist of at least 2 × 8, with hold-down anchors of 1,800 lb allowable tension for a guard up to 36 inches high.
-   [2021 International Residential Code, Section R312.1 (guards)](https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning), International Code Council. The code section the guide cites for when a guard is required, its height and its openings. Local amendments can differ, so check your building department.

Every publication the site cites is listed on the [methodology page](https://decktally.com/methodology/), with how the numbers are computed and checked. Found a mistake? [Send a correction](https://decktally.com/contact/). The [About page](https://decktally.com/about/) explains who runs DeckTally.

## More deck calculators

-   [Deck materials list](https://decktally.com/deck-materials-list/)
    
    One list for the whole deck: decking, joists, beam, posts, footings and screws.
    
-   [Deck lumber calculator](https://decktally.com/deck-material-calculator/)
    
    Deck lumber and wood: boards, joists and screws for a rectangular deck, with optional cost.
    
-   [Deck joist calculator](https://decktally.com/deck-joist-calculator/)
    
    Joist count, span check against the AWC table, hangers and rim joists.
    
-   [Deck beam calculator](https://decktally.com/deck-beam-calculator/)
    
    Allowable beam span from the AWC table and the posts a beam needs.
    
-   [Deck footing calculator](https://decktally.com/deck-footing-calculator/)
    
    Footing size, thickness and concrete from the AWC table, with the tallest post.
    
-   [Deck screw calculator](https://decktally.com/deck-screw-calculator/)
    
    Deck screws or hidden clips, with an allowance and the boxes to buy.
    
-   [Deck stair calculator](https://decktally.com/deck-stair-calculator/)
    
    Risers, treads, stringer length and count, with the code limits checked.
    
-   [Deck cost calculator](https://decktally.com/deck-cost-calculator/)
    
    Boards, joists and screws priced with your own numbers.
    
-   [Deck stain calculator](https://decktally.com/deck-stain-calculator/)
    
    Gallons and cans from the coverage on your can.
    

Last reviewed November 16, 2026. Built and checked by [Hassan Razeen](https://decktally.com/about/#maintainer).

```json
{"@context":"https://schema.org","@type":"WebPage","@id":"https://decktally.com/deck-railing-calculator/#webpage","name":"Deck Railing Calculator: Posts, Balusters, Rails | DeckTally","url":"https://decktally.com/deck-railing-calculator/","description":"Free deck railing calculator: posts at 6 ft, balusters that keep every gap under 4 inches, rails, cap and fasteners from the AWC deck guide, with working.","inLanguage":"en","datePublished":"2026-10-22","dateModified":"2026-11-16","isPartOf":{"@id":"https://decktally.com/#website"},"author":{"@id":"https://decktally.com/#maintainer"},"breadcrumb":{"@id":"https://decktally.com/deck-railing-calculator/#breadcrumb"},"mainEntity":{"@id":"https://decktally.com/deck-railing-calculator/#app"}}
{"@context":"https://schema.org","@type":"WebApplication","@id":"https://decktally.com/deck-railing-calculator/#app","name":"Deck Railing Calculator","url":"https://decktally.com/deck-railing-calculator/","description":"Free deck railing calculator: posts at 6 ft, balusters that keep every gap under 4 inches, rails, cap and fasteners from the AWC deck guide, with working.","inLanguage":"en","datePublished":"2026-10-22","dateModified":"2026-11-16","isPartOf":{"@id":"https://decktally.com/#website"},"image":"https://decktally.com/og.png","applicationCategory":"UtilitiesApplication","operatingSystem":"Any","browserRequirements":"Requires a modern web browser.","isAccessibleForFree":true,"featureList":["Posts at the 6 ft maximum spacing, section by section","Balusters per bay with the gap checked against the 4-inch sphere rule","Top and bottom rails and the rail cap","The fastener and bolt schedule from the AWC example guard","Whether a guard is required for your deck height","Working shown for every result","Imperial and metric units"],"offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"publisher":{"@type":"Organization","@id":"https://decktally.com/#organization","name":"DeckTally","url":"https://decktally.com/","description":"Free deck building calculators that show the working behind every number and cite the code, guide or standard each figure comes from.","logo":{"@type":"ImageObject","url":"https://decktally.com/icons/512.png","width":512,"height":512}}}
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How far apart should deck railing posts be?","acceptedAnswer":{"@type":"Answer","text":"At most 6 ft on center for the 4 × 4 posts in the American Wood Council's example guard. A 20 ft section therefore needs 5 posts (240 ÷ 72 = 3.33, rounded up to 4 bays, plus one), and 60 ft in 3 sections needs 15. Posts for a required guard must be through-bolted to a joist or rim joist of at least 2 × 8."}},{"@type":"Question","name":"How many balusters do I need?","acceptedAnswer":{"@type":"Answer","text":"Enough that no opening passes a 4-inch sphere: with 1.5-inch balusters and a 3.5-inch gap, each 55.63-inch bay takes 11, so the 40 ft example takes 88. A smaller gap means more balusters; the calculator spaces them evenly and tells you the gap you actually get."}},{"@type":"Question","name":"How high does a deck railing have to be?","acceptedAnswer":{"@type":"Answer","text":"36 inches at least, measured from the deck surface, in the guide's example guard. A guard is required at all once the deck is more than 30 inches above grade; a 24-inch deck needs none, though many owners add one anyway. The guide gives that threshold twice: its stair figure (Figure 30) says a total rise of 30 inches or more, while its Guard Requirements and IRC R312.1.1 say more than 30 inches above grade, so at exactly 30 inches ask your building department."}},{"@type":"Question","name":"What is the maximum gap between deck balusters?","acceptedAnswer":{"@type":"Answer","text":"Openings in the guard may not allow a 4-inch sphere to pass, so the clear gap must be under 4 inches. The 40 ft example asks for 3.5 inches and ends up at 3.26 once the balusters are spaced evenly. Triangular openings at stairs have their own 6-inch sphere limit."}},{"@type":"Question","name":"What size posts and rails does a deck railing use?","acceptedAnswer":{"@type":"Answer","text":"The guide's example uses 4 × 4 posts, 2 × 4 top and bottom rails, 2 × 2 balusters and a 2 × 6 or 5/4 cap. Posts are not notched, and they bolt through to a joist or rim joist of at least 2 × 8 with two half-inch bolts and washers. For a required guard up to 36 inches high the posts also need hold-down anchors with at least 1,800 pounds of allowable tension, which this calculator does not count."}},{"@type":"Question","name":"How many screws does a deck railing need?","acceptedAnswer":{"@type":"Answer","text":"270 for the 40 ft example: 64 at the rail ends (two #8 screws at each end of each rail), 30 for the cap (three #12 screws per post) and 176 for the balusters (one #8 screw top and bottom), plus 20 through-bolts for the posts. The figure allows threaded nails instead of the screws at each of those places."}},{"@type":"Question","name":"How many balusters for an 8 ft rail section?","acceptedAnswer":{"@type":"Answer","text":"16 with 1.5-inch balusters and 3.5-inch gaps: an 8 ft section takes 3 posts (96 ÷ 72 = 1.33, rounded up to 2 bays), each bay is 42.75 inches between posts and takes 8 balusters, leaving 3.42-inch gaps. Enter 8 ft and 1 section above to change the gap."}}]}
{"@context":"https://schema.org","@type":"BreadcrumbList","@id":"https://decktally.com/deck-railing-calculator/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://decktally.com/"},{"@type":"ListItem","position":2,"name":"Deck Railing Calculator","item":"https://decktally.com/deck-railing-calculator/"}]}
```
