# Deck railing calculator

> 12′ wood railing: 3 posts (6′ on center), 26 balusters with 3-1/2″ gaps and a 36″ guard. Wood, aluminum, steel, glass or cable railings for decks, balconies, porches and stairs: posts, panels, hardware and the height rules.

## What to buy (12′ wood railing)

Every line shows the quantity to buy and how StudSheet got it: the spacing, the waste and the package size, so you can check it before the supply house or the quote.

| Buy | Material | How StudSheet counts it | What it is for |
|---|---|---|---|
| **1 length (3 posts)** | Pressure-treated 4×4 post (4×4 × 12′) | 3 posts at 46-3/4″ (2 ends, 1 between), 3 from each 12′ 4×4. Never notch a 4×4 guard post where it’s fastened (IRC R507.10.2). | Railing posts. |
| **2 boards** | Pressure-treated 2×4 (treated 2×4 × 12′) | Top and bottom rail between posts: 4 pieces at 68-1/2″, 2 from each 12′ board. | Treated against rot — for wood touching concrete or outdoors. |
| **1 board** | Pressure-treated 2×6 (treated 2×6 × 12′) | The flat cap on top of the posts, joints centered on a post: 12′ of rail. | Treated against rot — for wood touching concrete or outdoors. |
| **26 balusters** | Treated 2×2 balusters (36″) | 13 per opening × 2 openings: 68-1/2″ between posts, 1-1/2″ balusters, gaps of 3-1/2″ — under 4″. Cut to 31-1/2″. | Vertical guard pickets. |
| **1 board** | Pressure-treated 2×10 (2×10 × 8′ (or your joists’ size)) | Two blocks between the joists at each post, fastened with structural screws, so the rim can’t roll (IRC R507.10.1). | Joists, beams and ledger, actually 1½″ × 9¼″. |
| **6 sets** | Through-bolts ½″ for guard posts, with nuts and washers (½″ × 8″) | Two per post through the rim, 4–5″ apart, washers both sides. | Through the post and the rim joist or stringer: two per post, washers on both sides. Hot-dip galvanized or stainless with treated wood. |
| **3 ties** | Guard post hold-down (tension tie, about 1,800 lb) | One per post into the blocking — the deck guide’s detail with the two bolts. A tested structural-screw kit is the other way to pass the 200 lb push. | Ties the bottom of a guard post to blocking inside the frame. The deck guide’s detail uses one rated about 1,800 lb per post (such as a Simpson DTT2Z) with its own screws. |
| **≈135 screws (2 boxes of 100)** | Coated deck screws (2½″ coated) | Rails to posts, two screws at each end of every baluster, and the cap into the posts and rails. | Exterior-rated screws for treads and risers. |
| **2 quarts** | Exterior stain or sealer (deck and railing) | About 79 sq ft of wood surface, one coat at about 175 sq ft per gallon (rough wood drinks it). | Semi-transparent or solid exterior stain. Rough treated wood drinks more than the can’s coverage. |

### In Canada (3.66 m wood railing)

Set to Canada, the Sheet works the job out again for Ontario: metric sizes, bag sizes, the frost depth and the code notes. It doesn't just convert feet to meters. The first lines:

- **2 lengths (4 posts), Pressure-treated 4×4 post:** 4 posts at 1.19 m (2 ends, 2 between), 2 from each 2.44 m 4×4. Never notch a 4×4 guard post where it’s fastened.
- **2 boards, Pressure-treated 2×4:** Top and bottom rail between posts: 6 pieces at 1.13 m, 3 from each 3.66 m board.
- **1 board, Pressure-treated 2×6:** The flat cap on top of the posts, joints centered on a post: 3.66 m of rail.
- **24 balusters, Treated 2×2 balusters:** 8 per opening × 3 openings: 1.13 m between posts, 38 mm balusters, gaps of 92 mm — under 100 mm. Cut to 800 mm.
- **2 boards, Pressure-treated 2×10:** Two blocks between the joists at each post, fastened with structural screws, so the rim can’t roll.
- **8 sets, Through-bolts 13 mm for guard posts, with nuts and washers:** Two per post through the rim, 102–127 mm apart, washers both sides.

## The steps, in order

> **DIY OK: you can do this yourself with standard tools.** About 8–12 hours of work for this example.

1. Check what the railing fastens to: the rim joist and the joists behind it must be solid, with no rot.
2. Mark the posts: each end and corner, then evenly between, 6′ on center (no more than 6′).
3. Add blocking behind each post, then bolt the posts: two ½″ through-bolts each plus a hold-down into the blocking. Plumb them both ways before the final tightening.
4. Install the top and bottom rails between the posts, the bottom edge no more than 3-1/2″ above the deck.
5. Fasten the balusters with a spacer block cut to 3-1/2″: 13 per opening, so a 4″ ball can’t pass anywhere.
6. Screw the 2×6 cap on top of the posts and rails, joints centered on a post.
7. Stain or seal the wood once it’s dry (treated wood can take weeks — water should soak in, not bead).
8. Test it: lean hard on every post and the top between posts — nothing should move — and try a 4″ ball in every opening.

## Tools (17)

Must-have tools first, then the ones that help and the ones to rent for the day.

| Tool | Need | Why |
|---|---|---|
| **Tape measure (25 ft)** | **Must have** | The red boxes every 16″ on the blade are stud spacing. |
| **Carpenter's pencil** | **Must have** | Flat, doesn't roll away, marks rough lumber. |
| **4-ft level** | **Must have** | Plumb every post both ways |
| **Post level** | Good to have | Shows plumb both ways at once while you fasten |
| **Mason's line + stakes** | Good to have | Lines the posts up along the edge |
| **Cordless drill/driver** | **Must have** | Drills holes, drives screws, mixes small batches. |
| **Impact driver** | **Must have** | Drives long framing and deck screws without stripping. |
| **Miter saw** | **Must have** | Square and angled cuts on rails, balusters and the cap |
| **Circular saw** | Good to have | Cuts posts to length |
| **Speed square** | **Must have** | Triangle square for marking square and angled cuts on lumber. |
| **Clamps (2)** | Good to have | Hold rails level while you fasten them |
| **Sawhorses** | **Must have** | Cutting support. |
| **Auger bit set** | **Must have** | ½″ bit long enough to go through the post and the rim |
| **Socket and ratchet set** | **Must have** | Tightens the bolts, lags and anchors |
| **Safety glasses** | **Must have** | Every cut, every nail, every time. |
| **Work gloves** | **Must have** | Tack strip, block and lumber shred hands. |
| **Hearing protection** | **Must have** | Saws and nailers are loud enough to damage hearing. |

## Mistakes and how the math works

### Mistakes that cost a callback or a second trip

- **Notching the posts:** A notched 4×4 keeps half its wood right where the push is highest, and the IRC (R507.10.2) forbids notching a 4×4 guard post at the connection: bolt it whole to the rim.
- **Posts bolted to the rim alone:** Without blocking or a hold-down, the rim twists and the post leans out under a push. Tie each post into the framing (R507.10.1).
- **Eyeballing the gaps:** Gaps creep. Cut a spacer block to the gap and use it for every baluster: one opening a 4″ ball gets through fails the inspection.
- **A high bottom rail:** More than 3-1/2″ under the bottom rail and a small child fits under it. Measure from the floor.

### What the calculator assumes

- IRC R312.1 (R321.1 in the 2024 IRC): guards where the drop is more than 30″ within 36″ of the edge; 36″ tall (34″ along stairs, 34–38″ where the top is the handrail); openings under 4″ (4⅜″ on stairs, 6″ in the stair triangle).
- Loads (IRC Table R301.5): 200 lb at any point on the top of a guard (outward and downward), 50 lb on any square foot of infill. Handrails (R311.7.8; R320 in the 2024 IRC): 4+ risers, 34–38″, graspable (1¼–2″ round), continuous, ends returned, 1½″ from a wall.
- Posts: no more than 6′ apart for treated 4×4 posts, 2×4 rails, 2×2 balusters and a 2×6 cap. Wood posts: the deck guide’s detail (two ½″ bolts and a hold-down with blocking) or a tested screw-and-blocking kit.
- Runs: 12′ split evenly into 1 side.
- Prices are typical US store prices for a rough total.

## Code, permits and safety

The Sheet sets its code notes for the job's state or province. These are New Jersey's and Ontario's; the [code reference](https://studsheet.com/codes) has more. Always confirm with your building department.

- **Guard: 36″ tall, openings under 4″:** It’s 4′ down to the ground or floor, so this deck or porch needs a guard at least 36″ tall. No opening may let a 4″ ball through. The top must hold a 200 lb push at any point, the infill 50 lb on any square foot. Confirm with your building department.
- **Ask your town about a permit:** A new or replacement railing usually goes on the deck or porch permit in New Jersey. Ask your town’s construction office before you build.
- **Guard: 900 mm tall, openings under 100 mm:** It’s 1.22 m down to the ground or floor, so this deck or porch needs a guard at least 900 mm tall. No opening may let a 100 mm ball through. Each guard takes a 0.5 kN/m push (or 1 kN at one point) at the top. Confirm with your building department.
- **Nothing to climb on:** Ontario: a required guard can’t have anything to climb on between 140 and 900 mm above the floor, at any height. Vertical balusters, pickets and glass are fine; keep rails out of that zone except at the bottom and the top. Confirm with your building department.
- **Permit: ask your municipality:** Guards go on the deck or balcony permit. On their own: Peachland, BC, for example, needs a permit to remove and replace guards or to switch to glass, but not to repair a short section. Ask your municipality’s building department. Confirm with your building department.

## Questions

### What materials do I need to build a deck railing?

For the worked example, a 12′ wood railing, the Sheet counts 9 lines with waste included, starting with pressure-treated 4×4 post (1 length (3 posts)), pressure-treated 2×4 (2 boards), pressure-treated 2×6 (1 board), treated 2×2 balusters (26 balusters). Each line's math is in the table above. Put in your own sizes in the [railings calculator](https://app.studsheet.com/p/railing) and every line is counted again.

### How long does it take to build a deck railing, and can I do it myself?

About 8 to 12 hours for the worked example, in 8 steps. StudSheet stamps it **DIY OK**: you can do this.

### What tools do I need to build a deck railing?

17 in all. The must-haves start with tape measure (25 ft), carpenter's pencil, 4-ft level, cordless drill/driver, impact driver, miter saw. On the Sheet you mark each one as owned, to buy or to rent.

## Ask about it

Stuck while you build a deck railing? Ask in the [Railings and guards group](https://studsheet.com/forum/railings) of the StudSheet community with this Sheet attached. Homeowners who've done it and verified pros answer, and anyone can read it.

## More decks, fences & railings Sheets

- **[Decks and fences for contractors](https://studsheet.com/trades/decks-fences)**: run this takeoff at your own prices, send the estimate, and get it signed and the deposit paid.
- **[Build deck or porch stairs](https://studsheet.com/sheets/stairs)** (Stairs for a 3′ rise): Lay out and cut stringers, treads, risers and the landing — to code.
- **[Deck or balcony](https://studsheet.com/sheets/deck)** (16′ × 12′ deck): Footings, posts, beams, joists and decking for a deck, or a balcony on posts, with the railing it needs.
- **[Fence](https://studsheet.com/sheets/fence)** (100′ wood fence, 6′ tall): Posts, rails, pickets or panels, concrete and gate hardware for a wood, vinyl or aluminum fence.
- **[Build a raised garden bed](https://studsheet.com/sheets/garden)** (8′ × 4′ raised bed): Boards cut from the fewest pieces, corner posts, screws, a liner against weeds or gophers, and the soil by the bag or by the yard.
- **[All 45 Sheets](https://studsheet.com/sheets)**, across 16 trades.
- **[Code reference](https://studsheet.com/codes):** frost depths, guard heights, stairs, retaining walls.
