This guide is for homeowners pricing a rectangular deck and contractors checking a supplier's takeoff. It turns two tape measurements into an order for decking, joists, hangers, the rim board and screws or clips, picks the stock length that wastes least, and explains the code table that limits joist span. It sizes the order, not the structure: footings, posts, beams and the ledger connection belong to your local code and inspector.
How the estimate is calculated
The math assumes an attached deck: joists run from a ledger on the house wall to a beam at the far edge, and the boards run along the house, across every joist. The width is measured along the house, the depth out from it. Boards running out from the house instead? Swapping the two numbers still gives the right decking and fastener counts, but not the frame, whose joists would then run parallel to the house on beams; lay that out and span-check it separately.
Rows of decking
rows = ⌈depth in inches ÷ (board face width + gap)⌉
- Depth in inches. House to outside edge, times 12.
- Board face width. The real dimension: 5/4×6 and 2×6 boards both measure 5.5 inches, and Trex's 2024 installation guide lists its boards at 0.94 by 5.5 inches.
- Gap. Trex's 2024 guide calls for at least 3/16 inch (0.1875 in) between boards side to side.
- ⌈ ⌉ means round up. A partial row still has to be filled, usually with a ripped board, so it counts as a full row.
Linear feet and board count
linear feet = rows × deck width in feet
Linear feet are what ends up on the frame, not what you buy. A leftover piece only helps if it can finish another row, so a cut-aware count works row by row:
boards = rows × full boards per row + ⌈rows ÷ end pieces per board⌉
- Full boards per row: whole stock boards that fit inside the deck width.
- End pieces per board: how many of the short fill-in pieces one stock board yields. The term drops out when the stock length divides the width exactly.
boards to buy = ⌈boards × (1 + extra % ÷ 100)⌉
The extra % covers twisted or cracked boards and miscuts. Routine offcuts are already counted, so 5% is the straight default. Diagonal layouts default to 15% for the angled end cuts, and take their linear feet from area because no two rows match.
Joists, hangers and the rim board
joists = ⌈deck width in inches ÷ joist spacing⌉ + 1
- Joist spacing is measured on center (o.c.), middle to middle. Trex's 2024 guide uses 16 inches for straight boards and 4 inches less, 12 inches, at 45°.
- + 1: the division counts spaces, and a frame has one more joist than spaces.
- Joist length: the depth rounded up to the next even foot, 8 ft minimum.
- Joist hangers: one per joist at the ledger.
- Rim board: one board across the joist ends at the width rounded up to the next even foot, 8 ft minimum, for decks up to 20 ft wide; decks wider than 20 ft get ⌈width in feet ÷ 16⌉ pieces of 16 ft.
Fasteners
face screws = ⌈crossings × 2 × 1.05⌉
hidden clips = ⌈crossings × 1 × 1.05⌉
A crossing is any spot where a board passes over a joist: two face screws or one clip. The 1.05 adds 5% for the ones that end up in the grass. On a straight deck every row crosses every joist once:
straight: crossings = rows × joists
At 45° the count changes. Rows are still one board plus one gap apart measured square to the boards, but a joist cuts across them at an angle, so along the joist they sit √2 times (about 1.41 times) farther apart and meet it less often:
diagonal: crossings = ⌈depth in inches ÷ (coverage × √2)⌉ × joists
Coverage is board face width plus gap. The tighter spacing a diagonal deck needs adds joists, so the total stays close to a straight layout. Trex quotes 90 hidden clips per 50 sq ft and TimberTech 175 per 100 sq ft, roughly 1.75 to 1.8 per sq ft.
Joist span check
depth in inches ≤ maximum joist span from IRC Table R507.6
Span is the distance between supports, here ledger to beam. IRC 2021 Table R507.6 sets the maximum by size, species and spacing; the values below are for Southern pine No. 2 at 40 psf live plus 10 psf dead load, wet service. Other species span less.
| Joist spacing | 2×6 | 2×8 | 2×10 | 2×12 |
|---|---|---|---|---|
| 12″ o.c. | 9′-11″ | 13′-1″ | 16′-2″ | 18′-0″ |
| 16″ o.c. | 9′-0″ | 11′-10″ | 14′-0″ | 16′-6″ |
| 24″ o.c. | 7′-7″ | 9′-8″ | 11′-5″ | 13′-6″ |
Example 1: a 12 × 12 ft deck with 12 ft boards
Inputs: 12 × 12 ft, 5.5-inch boards, 3/16-inch gaps, 12 ft stock, joists 16 inches on center, face screws, 5% extra.
- Each row covers 5.6875 inches, and 144 ÷ 5.6875 rounds up to 26 rows. The last row is only 1.81 inches wide: rip a board for it or adjust the gap or the outer overhang.
- 26 rows × 12 ft = 312 linear feet, exactly one 12 ft board per row: 26 boards, 0% offcut.
- Add 5%: ⌈26 × 1.05⌉ = 28 boards.
- Joists: ⌈144 ÷ 16⌉ + 1 = 10 joists in 12 ft stock, 10 hangers and one 12 ft rim board.
- Screws: 26 × 10 × 2 × 1.05 = 546. Switch to hidden clips and the count is 273.
The same deck in every stock length, before the 5% extra:
| Board length | Boards | Linear feet bought | Offcut |
|---|---|---|---|
| 8 ft | 39 | 312 | 0% |
| 10 ft | 32 | 320 | 2.5% |
| 12 ft | 26 | 312 | 0% |
| 16 ft | 26 | 416 | 25% |
| 20 ft | 26 | 520 | 40% |
8 ft stock ties on footage but puts a butt joint in every row, so the longer board wins. The area shortcut (144 sq ft × 12 ÷ 5.6875 inches = 303.8 linear feet) suggests 19 sixteen-foot boards; row by row it takes 26, since a 16 ft board's offcut cannot finish another 12 ft row. The deck material calculator prints this table for any size.
Example 2: a 20 × 14 ft deck, 2×8 or 2×10 joists
Inputs: 20 ft wide, 14 ft deep, 5.5-inch boards, 3/16-inch gaps, board length on automatic, 16 inches on center, face screws, 5% extra.
- 168 inches ÷ 5.6875 rounds up to 30 rows, with a 3.06-inch last row. 30 × 20 ft = 600 linear feet.
- 20 ft stock covers each row in one piece: 30 boards, no offcut. The worst choice, 12 ft, needs 60 boards with a 16.7% offcut. With 5% extra: 32 twenty-foot boards.
- Joists: ⌈240 ÷ 16⌉ + 1 = 16 joists in 14 ft stock, 16 hangers and one 20 ft rim board. Screws: 1,008.
- Span check, 2×8 at 16 inches: the table allows 11′-10″ (142 inches); the deck needs 168. Fails.
- Tightening the 2×8s to 12 inches raises the limit to 13′-1″ (157 inches), still short, and grows the frame to 21 joists and 1,323 screws. Still fails.
- 2×10 at 16 inches: allowed 14′-0″ (168 inches), needed 168. Passes, with no margin.
Or keep the 2×8s and add a beam halfway out: each joist then spans 84 inches, well inside the 142-inch limit, at the cost of a second beam line with posts and footings. Joist size changes the frame, not the decking: board, hanger and screw counts match for 2×8 and 2×10 at 16 inches.
Example 3: a 16 × 12 ft diagonal deck with hidden clips
Inputs: 16 ft along the house, 12 ft out, 5.5-inch boards at 45° with 3/16-inch gaps, joists 12 inches on center, hidden clips, 15% extra (the diagonal default).
- Rows differ in length, so linear feet come from area: 192 sq ft × 12 ÷ 5.6875 inches = 405.1 linear feet.
- 12 ft and 8 ft stock both buy 408 linear feet (0.7% offcut); the longer board wins at 34 boards. With 15% extra: ⌈34 × 1.15⌉ = 40 boards.
- Joists: ⌈192 ÷ 12⌉ + 1 = 17 joists in 12 ft stock, 17 hangers and one 16 ft rim board.
- Clips: ⌈144 ÷ (5.6875 × √2)⌉ = 18 crossings per joist, and 18 × 17 × 1.05 rounds up to 322 clips.
Run straight at 16 inches with clips, the same deck needs 28 sixteen-foot boards, 13 joists and 355 clips. Going diagonal costs more decking and framing, not more clips: each joist meets 18 boards instead of 26, which outweighs the extra joists. There is no reason to pad the clip order for a 45° layout.
Common mistakes that throw off the order
- Using the nominal board width. Enter 6 inches for a 5.5-inch board and the 12 × 12 deck comes out at 24 rows and 26 boards.
- Dividing area by coverage with long boards. It ignores offcuts too short to reuse, so it only comes close when the board length divides the row evenly.
- Stacking a generic waste allowance on a cut-aware count. The offcuts are already in it.
- Counting spaces instead of joists. Width ÷ spacing gives the spaces; the frame needs one more joist and one more hanger.
- Keeping 16-inch spacing under diagonal boards. The 16 × 12 diagonal deck then orders 13 joists and 246 clips; framed at the 12 inches Trex calls for, it takes 17 and 322.
- Ignoring butt joints. When rows outrun the boards, each seam needs a doubled joist or blocking underneath, staggered row to row.
When to use the calculator, a pencil, or a professional
For a small landing, or a deck that one board length spans, the formulas fit on the back of a receipt. The calculator earns its keep when you compare stock lengths, switch between screws and clips, plan a diagonal layout or check a contractor's list line by line, since it shows every step, not just totals.
Neither covers decks that are not one rectangle (split an L-shape into rectangles and add them), picture-frame borders, breaker boards, stairs, or frame design: beams, posts, footings, ledger fastening, cantilevers, other joist species and loads above 40 psf. Treat the span check as a first screen; the code tables for your species and load, or a designer, have the final word.
Sources
Every rate and rule in this guide comes from these official pages; the dates are when we last checked them.
Run your own numbers
More guides
Note. Guides explain how the numbers work using published rules and our own worked examples. They are not tax, legal, financial or engineering advice; fees and codes change, so check the current source before you rely on a figure.