{
  "id": "baluster-spacing",
  "version": "3f37af2c6c64",
  "status": "published",
  "name": "Baluster Spacing Calculator",
  "question": "What baluster spacing do I need?",
  "summary": "Works out how many balusters fit between two posts so every gap is under the 4-inch sphere rule (IRC R312.1.3), and the exact even gap and on-center spacing.",
  "category": "construction",
  "subcategory": "materials",
  "url": "https://www.acalculator.org/construction/baluster-spacing-calculator",
  "markdown": "https://www.acalculator.org/construction/baluster-spacing-calculator.md",
  "kind": "function",
  "method": "n = ⌊(L − g) ÷ (w + g)⌋ + 1 balusters; gap = (L − n w) ÷ (n + 1); on center = gap + w.",
  "assumptions": [
    "Each gap must be smaller than the opening limit: a 4 in (102 mm) sphere must not pass (IRC R312.1.3).",
    "Balusters are spaced evenly with a full gap at each post.",
    "Lengths are exact fractions of the typed decimals, so a gap of exactly the limit is caught.",
    "Check your local code: some places adopt other limits, and stair guards have their own exceptions."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "u": {
        "title": "Measure in",
        "description": "Inches or centimeters, for every length on the page.",
        "type": "string",
        "enum": [
          "in",
          "cm"
        ]
      },
      "l": {
        "title": "Space between posts",
        "description": "The clear distance from the face of one post to the face of the next (72 in for a 6 ft section).",
        "type": "number",
        "minimum": 0.01,
        "maximum": 100000
      },
      "w": {
        "title": "Baluster width",
        "description": "The width of one baluster as seen along the rail (1.5 in for a 2 × 2).",
        "type": "number",
        "minimum": 0.01,
        "maximum": 1000
      },
      "g": {
        "title": "Opening limit",
        "description": "Every gap must be smaller than this: 4 in (10.16 cm) under IRC R312.1.3, or 4 3/8 in on the open side of a stair.",
        "type": "number",
        "minimum": 0.01,
        "maximum": 1000
      },
      "s": {
        "title": "Sections",
        "description": "How many equal sections between posts you are building.",
        "type": "integer",
        "minimum": 1,
        "maximum": 10000
      }
    }
  },
  "outputs": {
    "balusters": {
      "label": "Balusters per section",
      "description": "The fewest balusters that make every gap smaller than the opening limit.",
      "format": "integer"
    },
    "spacing": {
      "label": "Gap between balusters",
      "description": "The even gap: (space − balusters × width) ÷ (balusters + 1), in your unit.",
      "format": "number"
    },
    "fraction": {
      "label": "Gap to the nearest 1/16 in",
      "description": "The gap in inches to the nearest sixteenth, halves rounded up (inches only).",
      "format": "text"
    },
    "center": {
      "label": "On-center spacing",
      "description": "From the middle of one baluster to the middle of the next: gap + width.",
      "format": "number"
    },
    "total": {
      "label": "Balusters in all",
      "description": "Balusters per section × sections.",
      "format": "integer"
    },
    "unitName": {
      "label": "Unit",
      "description": "The unit of the lengths.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "u": "in",
      "l": 72,
      "w": 1.5,
      "g": 4,
      "s": 1
    },
    "outputs": {
      "balusters": 13,
      "spacing": 3.75,
      "fraction": "3 3/4 in",
      "center": 5.25,
      "total": 13,
      "unitName": "in"
    },
    "text": "Use 13 balusters per section, 3.75 in apart."
  },
  "examples": [
    {
      "given": {
        "u": "in",
        "l": 72,
        "w": 1.5,
        "g": 4,
        "s": 1
      },
      "expect": {
        "balusters": 13,
        "spacing": 3.75,
        "fraction": "3 3/4 in",
        "center": 5.25,
        "total": 13
      },
      "source": "hand calculation in content.mdx: (72 − 4) ÷ (1.5 + 4) = 12.36, so 13 balusters; (72 − 19.5) ÷ 14 = 3.75; International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "in",
        "l": 92,
        "w": 1.5,
        "g": 4,
        "s": 4
      },
      "expect": {
        "balusters": 17,
        "spacing": 3.6944444444444446,
        "fraction": "3 11/16 in",
        "total": 68
      },
      "source": "hand calculation in content.mdx: (92 − 4) ÷ 5.5 = 16 exactly, so 17; (92 − 25.5) ÷ 18 = 133/36; International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02); Humboldt County, CA, Guards and Window Fall Protection (the 4-inch sphere rule for guard openings and the 4 3/8-inch stair exception), https://humboldtgov.org/3432/Guards-and-Window-Fall-Protection-CRC-R3 (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "cm",
        "l": 180,
        "w": 4,
        "g": 10.16,
        "s": 2
      },
      "expect": {
        "balusters": 12,
        "spacing": 10.153846153846153,
        "center": 14.153846153846153,
        "total": 24
      },
      "source": "hand calculation in content.mdx: (180 − 10.16) ÷ 14.16 = 11.99…, so 11 + 1 = 12; (180 − 48) ÷ 13 = 132/13; International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)"
    },
    {
      "given": {
        "u": "in",
        "l": 36,
        "w": 1.5,
        "g": 4.375,
        "s": 1
      },
      "expect": {
        "balusters": 6,
        "spacing": 3.857142857142857,
        "fraction": "3 7/8 in"
      },
      "source": "hand calculation in content.mdx: (36 − 4.375) ÷ 5.875 = 5.38…, so 6; (36 − 9) ÷ 7 = 27/7; International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (required guards shall not have openings from the walking surface to the required guard height that allow passage of a sphere 4 inches (102 mm) in diameter; stair exceptions 6 in and 4 3/8 in), https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)"
    }
  ],
  "sources": [
    "International Code Council, 2021 International Residential Code, R312.1.3 Opening limitations (no passage of a 4 in (102 mm) sphere; exceptions of 6 in for the stair triangle and 4 3/8 in on the open side of stairs). https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning#IRC2021P2_Pt03_Ch03_SecR312.1.3 (retrieved 2026-10-02)",
    "Humboldt County, California, Guards and Window Fall Protection (CRC R312: guard height and the 4 in sphere rule with its stair exceptions). https://humboldtgov.org/3432/Guards-and-Window-Fall-Protection-CRC-R3 (retrieved 2026-10-02)"
  ],
  "related": [
    "deck",
    "fence",
    "stair"
  ],
  "changelog": []
}
