{
  "id": "deck",
  "version": "a19e49950988",
  "status": "published",
  "name": "Deck Calculator",
  "question": "How many deck boards do I need?",
  "summary": "Computes the rows of deck boards across a deck, the linear feet and number of boards to buy with extra for waste, the joists under them, and the cost.",
  "category": "construction",
  "url": "https://www.acalculator.org/construction/deck-calculator",
  "markdown": "https://www.acalculator.org/construction/deck-calculator.md",
  "kind": "function",
  "method": "rows = ⌈(width + gap) ÷ (board width + gap)⌉; linear = rows × length; boards = ⌈linear × (1 + waste ÷ 100) ÷ board length⌉; joists = ⌈length ÷ spacing⌉ + 1",
  "assumptions": [
    "Boards run along the deck length and the joists run across it, square to the boards. The last row is ripped to fit.",
    "Boards are counted by total length, not by a cutting plan. Offcuts and end joints come out of the waste allowance.",
    "The joist count spaces joists from one end, with one at each end. It does not size the joists, beams or footings.",
    "A count within 0.000000001 of a whole number counts as that whole number, so exact fits are not rounded up."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "len": {
        "title": "Deck length",
        "description": "The length of the deck along the boards.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.0254,
        "maximum": 1000
      },
      "wid": {
        "title": "Deck width",
        "description": "The width of the deck across the boards.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.0254,
        "maximum": 1000
      },
      "bw": {
        "title": "Board width",
        "description": "The actual width of one board. A nominal 6 in board is 5 1/2 in wide.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.0254,
        "maximum": 0.6095999999999999
      },
      "gap": {
        "title": "Gap between boards",
        "description": "The gap between the long edges of two boards.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0,
        "maximum": 0.0508
      },
      "bl": {
        "title": "Board length",
        "description": "The length of the boards you buy.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.3048,
        "maximum": 30.48
      },
      "joist": {
        "title": "Joist spacing",
        "description": "The distance from the center of one joist to the next.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.1016,
        "maximum": 3.048
      },
      "waste": {
        "title": "Extra for waste",
        "description": "Extra board length for cuts and offcuts, as a percent.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 100
      },
      "price": {
        "title": "Price per board",
        "description": "The price of one board. Leave empty to skip the cost.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 100000
      }
    }
  },
  "outputs": {
    "boards": {
      "label": "Deck boards",
      "description": "The boards to buy: linear feet × (1 + waste) ÷ board length, rounded up.",
      "format": "integer"
    },
    "rows": {
      "label": "Rows of boards",
      "description": "How many boards side by side cover the width, gaps included.",
      "format": "integer"
    },
    "linear": {
      "label": "Linear feet of board",
      "description": "The rows × the deck length, before waste.",
      "format": "quantity",
      "unit": "ft"
    },
    "joists": {
      "label": "Joists",
      "description": "The joists across the length at the spacing, one at each end.",
      "format": "integer"
    },
    "area": {
      "label": "Deck area",
      "description": "The length × the width.",
      "format": "quantity",
      "unit": "ft2"
    },
    "cost": {
      "label": "Cost of boards",
      "description": "The boards × the price per board.",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "len": 4.8768,
      "wid": 3.6576000000000004,
      "bw": 0.1397,
      "gap": 0.004762499999999999,
      "bl": 4.8768,
      "joist": 0.4064,
      "waste": 10
    },
    "outputs": {
      "boards": 29,
      "rows": 26,
      "linear": 126.7968,
      "joists": 13,
      "area": 17.837383680000002
    },
    "text": "A 192 ft² deck needs 29 boards in 26 rows, over 13 joists."
  },
  "examples": [
    {
      "given": {
        "len": 4.8768,
        "wid": 3.6576000000000004,
        "bw": 0.1397,
        "gap": 0.004762499999999999,
        "bl": 4.8768,
        "joist": 0.4064,
        "waste": 10,
        "price": 42
      },
      "expect": {
        "rows": 26,
        "linear": 126.7968,
        "boards": 29,
        "joists": 13,
        "cost": 1218
      },
      "source": "hand calculation in content.mdx: (144 + 0.1875) ÷ (5.5 + 0.1875) = 25.35, so 26 rows; 26 × 16 = 416 ft; × 1.10 ÷ 16 = 28.6, so 29 boards; 192 ÷ 16 + 1 = 13 joists; 29 × $42 = $1,218",
      "tolerance": 1e-12
    },
    {
      "given": {
        "len": 6.096,
        "wid": 3.048,
        "bw": 0.1397,
        "gap": 0.00635,
        "bl": 3.6576000000000004,
        "joist": 0.30479999999999996,
        "waste": 5
      },
      "expect": {
        "rows": 21,
        "linear": 128.01600000000002,
        "boards": 37,
        "joists": 21
      },
      "source": "hand calculation in content.mdx: (120 + 0.25) ÷ 5.75 = 20.91, so 21 rows; 21 × 20 = 420 ft; × 1.05 ÷ 12 = 36.75, so 37 boards; 240 ÷ 12 + 1 = 21 joists",
      "tolerance": 1e-12
    },
    {
      "given": {
        "len": 3.048,
        "wid": 0.29209999999999997,
        "bw": 0.1397,
        "gap": 0.0127,
        "bl": 3.048,
        "joist": 0.6095999999999999,
        "waste": 0
      },
      "expect": {
        "rows": 2,
        "boards": 2,
        "joists": 6
      },
      "source": "hand calculation in content.mdx: (11.5 + 0.5) ÷ (5.5 + 0.5) = 2 rows exactly; 20 ft ÷ 10 = 2 boards; 120 ÷ 24 + 1 = 6 joists"
    }
  ],
  "sources": [
    "Trex, How to Space Deck Boards: 3/16 in width-to-width; 1/8 in end to end above 40°F, 3/16 in below. https://www.trex.com/deck-ideas/how-to-space-deck-boards/",
    "International Code Council, International Residential Code 2021, R507.7 Decking and Table R507.7: maximum joist spacing 16 in o.c. (12 in diagonal) for 1 1/4 in wood decking and 24 in (16 in diagonal) for 2 in wood decking.",
    "NIST Voluntary Product Standard PS 20, American Softwood Lumber Standard: a nominal 6 in board is 5 1/2 in wide dressed."
  ],
  "related": [
    "square-footage",
    "board-foot",
    "stair"
  ],
  "changelog": []
}
