The formula
Deck:
Rows of boards = ceil(deck width ÷ (board width + gap))
Total length = rows × deck length
Boards = ceil(total length × (1 + waste) ÷ board length)
Joists = ceil(deck length ÷ joist spacing) + 1
Screws = rows × joists × 2
Fence:
Sections = ceil(fence length ÷ post spacing); posts = sections + 1 + corner/gate posts
Pickets = ceil(fence length ÷ (picket width + gap) × (1 + waste))
Rails = sections × (2, or 3 for fences over 1.5 m / 5 ft)
Post depth ≈ fence height ÷ 3
Worked example
- A 16 × 12 ft deck uses 5.5 in wide boards with 3/16 in gaps, in 16 ft lengths, over joists at 16 in centres.
- Rows = 144 in ÷ (5.5 + 0.1875) in = 25.3, so 26 rows.
- Total length = 26 × 16 ft = 416 ft. With 10% waste: 457.6 ft ÷ 16 ft = 28.6, so buy 29 boards ($522 at $18 each).
- Joists = 192 in ÷ 16 in + 1 = 13 joists, each 12 ft long.
- Screws = 26 rows × 13 joists × 2 = 676.
- For a 100 ft, 6 ft high fence with posts every 8 ft: 13 sections, 16 posts (including 2 corner/gate posts), 39 rails and about 233 pickets.
Planning a deck
Decks have three layers: posts and beams on footings, joists spanning between the beams, and deck boards across the joists. This calculator handles the visible lumber: deck boards, the number of joists and screws. Enter the deck length along the direction the boards run and the width across them. Boards are usually laid perpendicular to the house, or diagonally for a decorative look, which needs about 15% waste and closer joist spacing. Leave a small gap between boards, typically 1/8 to 3/16 in (3–5 mm) for wood and as specified by the manufacturer for composite, so water drains and the boards can move.
Joist spacing and board choice
Joist spacing depends on the decking. Most 5/4 wood boards and composite decking need joists at 16 in (400 mm) centres, and 12 in for diagonal layouts or some thin composites. Thicker 2 × 6 boards can often span 24 in. Joist size depends on the span between beams: in the US, the American Wood Council's DCA 6 guide gives span tables for each species and size. Pressure-treated pine is the most common choice for framing and budget decking, cedar and redwood resist rot naturally, and composite or PVC boards cost more but need little maintenance. Hidden fastener systems are an alternative to face screws for a cleaner look.
Planning a fence
A fence is made of posts set in the ground, horizontal rails between them and vertical boards or pickets attached to the rails. Posts are typically spaced 6–8 ft (1.8–2.4 m) apart; closer spacing makes a stronger fence in windy areas. Fences up to about 4–5 ft need two rails per section and taller fences three. Privacy fences have no gaps or overlapping boards, while picket fences have gaps of 2–3 in. The calculator adds corner and gate posts to the line posts and gives the number of pickets with a waste allowance.
Setting fence posts
Bury posts about a third of the fence's height, or below the frost line in cold climates, to prevent heaving. Dig holes about three times the width of the post, put 6 in (15 cm) of gravel in the bottom for drainage, and set the post in concrete sloped away from the wood at the top so water runs off. A 4 × 4 post for a 6 ft fence typically takes two to three 50 lb bags of fast-setting concrete. Use ground-contact-rated treated lumber for posts, and check local rules on fence height and property boundaries, and call your utility locator (811 in the US) before digging.
Maintenance and lifespan
A well-built pressure-treated deck lasts 15–25 years, cedar about 15–20, and composite or PVC decking 25–30 years or more. Wood decks need cleaning and resealing or staining every one to three years to resist moisture and UV damage. Inspect decks yearly for loose fasteners, rot at the ledger and posts, and wobbly railings. Fences last longest when posts are set in well-drained concrete or gravel, boards are kept clear of the soil and wood is treated regularly.
Costs and extra materials
Beyond boards and posts, budget for joist hangers, structural screws or bolts, post anchors, flashing tape for joists, stair stringers and railings on decks, and hinges, latches and gate hardware on fences. Many US jurisdictions require a permit for decks more than 30 in above the ground or attached to the house. Our board foot calculator helps price lumber sold by the board foot, the stair calculator lays out deck stairs, and the concrete calculator sizes deck footings.