Spacing calculator
5 slats of 1-1/2 in spaced evenly along a 36 in run sit 6-1/4 in on center with 4-3/4 in of open space between them, and their centers land at 5-1/2, 11-3/4, 18, 24-1/4, and 30-1/2 in from the start. Enter your own run and the width of what you are spacing, and the calculator gives the count, the on-center distance, the open space, and every mark as a tape read from the start of the run. It can cap the opening, spread a fixed count, or fit the run to a target on-center such as 16 in. It uses the same layout math as the CutOnce app.
Spacing deck or stair balusters under the 4 in sphere rule? Baluster spacing calculator
By Scott Brady
Software engineer in Seattle and DIY builder who builds the CutOnce construction calculator.
Updated
Enter the run and the member width the way your tape reads: 92-1/2, 7 ft 8-1/2 in, or 0 for a point like a hook or a bolt. Marks are measured from the start of the run, each rounded once to the nearest 1/16 in.
- On center
- 5-15/16 in (exact 5-59/64")
- Open space
- 3-11/16 in
Cumulative tape reads · Center
- 1. 4-13/16 in
- 2. 10-3/4 in
- 3. 16-5/8 in
- 4. 22-9/16 in
- 5. 28-1/2 in
- 6. 34-7/16 in
- 7. 40-5/16 in
- 8. 46-1/4 in
- 9. 52-3/16 in
- 10. 58-1/8 in
- 11. 64 in
- 12. 69-15/16 in
- 13. 75-7/8 in
- 14. 81-13/16 in
- 15. 87-11/16 in
How the layout works
Every layout here has the same geometry: a run, a number of members of one width, and equal openings between them. The on-center distance is measured from the center of one member to the center of the next. The open space is the clear gap between their faces, which is the on-center distance less one member width.
The two ends of the run decide the arithmetic. With no member at either end there is one more opening than there are members, and the on-center distance is the run plus one member width, divided by the openings. With a member at one end the openings equal the members, and the on-center distance is the run divided by the openings. With a member at both ends there is one opening fewer than members, and the on-center distance is the run less one member width, divided by the openings.
The table puts 5 slats of 1-1/2 in on a 36 in run under each end condition.
| Members at the ends | Openings | On center | Open space | First center | Last center |
|---|---|---|---|---|---|
| Neither end | 6 | 6-1/4 in | 4-3/4 in | 5-1/2 in | 30-1/2 in |
| Start only | 5 | 7-3/16 in | 5-11/16 in | 3/4 in | 29-9/16 in |
| Both ends | 4 | 8-5/8 in | 7-1/8 in | 3/4 in | 35-1/4 in |
With no member at an end, the space between that end of the run and the nearest member is the same open space as between any two members. With a member at an end, its outside face is flush with the end of the run.
Marks are measured from the start of the run. The calculator keeps each position as an exact fraction and rounds it once to the nearest 1/16 in, so the last mark is as accurate as the first.
Three ways to set the count
The count comes from a limit, from you, or from a target spacing. The table runs all three on the same 96 in run of 1-1/2 in members with nothing at the ends.
| Mode | You enter | Members | On center | Open space |
|---|---|---|---|---|
| Limit the opening | 4 in maximum opening | 17 | 5-7/16 in | 3-15/16 in |
| Evenly space a count | 12 members | 12 | 7-1/2 in | 6 in |
| Best fit to an on-center | 16 in target | 5 | 16-1/4 in | 14-3/4 in |
Limit the opening finds the fewest members whose open space stays at or under the maximum. It suits pickets, slats, and guard infill, where the gap is the rule and the count follows from it. Here 16 members would leave 4-1/4 in open, so the answer is 17 members with 3-15/16 in between them.
Evenly space a count takes the number you give it and spreads it. Use it when the count is fixed by what you have: hooks, shelves, a bundle of slats, or the holes in a piece of hardware.
Best fit takes a target on-center and picks the count whose actual on-center lands closest to it, over or under. Here 5 members give 16-1/4 in, which is closer to 16 in than the 13-15/16 in that 6 members would give. The calculator shows how far the result is over or under the target.
| Job | Mode | Why |
|---|---|---|
| Fence pickets, slats, guard infill | Limit the opening | The gap has a maximum and the count follows from it. |
| Hooks, shelves, a fixed number of boards | Evenly space a count | You already know how many and want them even. |
| Deck joists, pergola rafters, purlins, battens | Best fit | A nominal on-center like 16 or 24 in, adjusted so the bays come out equal. |
| Anchor bolts and fasteners with a maximum spacing | Limit the opening | Zero width, a member at both ends, and the maximum spacing as the opening. |
| Holes in a hardware pattern | Evenly space a count | The hardware fixes the count. Enter zero width for a point. |
A worked example: pickets on a rail
A 92-1/2 in rail gets 2-1/4 in pickets with the opening capped at 4 in and no picket at either end. These are the values the calculator opens with.
| Pickets | 15 | (92-1/2 + 2-1/4) / (2-1/4 + 4) = 15.16, rounded up to 16 openings and 15 pickets |
|---|---|---|
| On center | 5-15/16 in | 94-3/4 / 16, rounded once to 1/16 |
| Exact on center | 5-59/64" | the fraction the marks are built from |
| Open space | 3-11/16 in | 5-59/64 - 2-1/4 |
| First mark (center) | 4-13/16 in | one on-center in, less half a picket |
| Last mark (center) | 87-11/16 in | 15 on-centers in, less half a picket |
The exact on-center distance is 5-59/64 in, which a tape in sixteenths cannot show. The calculator works out each mark from that fraction and rounds each mark once. The steps between neighboring marks are 5-15/16 in most of the time and 5-7/8 in the rest, because each mark is rounded on its own.
Why the marks are cumulative
Stepping the same distance from each mark to the next carries the rounding forward. On the rail above, the exact on-center of 5-59/64 in reads 5-15/16 in on the tape, 1/64 in long. The table compares the calculator's reads with what you get by stepping 5-15/16 in from the first mark.
| Picket | Read from the start | Stepped off | Difference |
|---|---|---|---|
| 1 | 4-13/16 in | 4-13/16 in | 0 in |
| 5 | 28-1/2 in | 28-9/16 in | 1/16 in |
| 10 | 58-1/8 in | 58-1/4 in | 1/8 in |
| 15 | 87-11/16 in | 87-15/16 in | 1/4 in |
By picket 15 the stepped mark is 1/4 in past where it belongs, and the last opening is that much narrower than the rest. Hooking the tape on the start of the run and marking every read from there keeps each mark within 1/32 in of its exact position.
When the tape cannot stay hooked, mark the reads once on a straight strip of wood and transfer them from that story pole.
A second example: joists at 16 in on center
A 12 ft run of 1-1/2 in joists with a joist at each end, best fit to 16 in on center. From the center of the first joist to the center of the last is 142-1/2 in, which is not a multiple of 16 in, so the calculator picks the count whose on-center lands closest and makes every bay equal.
| Joists | 10 | 9 openings fit closer than 8 |
|---|---|---|
| On center | 15-13/16 in | (144 - 1-1/2) / 9 |
| Open space | 14-5/16 in | on center less 1-1/2 |
| Against the 16 in target | 3/16 in under | the achieved on-center is this much under 16 in |
| Centers | 3/4 in, 16-9/16 in, 32-7/16 in, 48-1/4 in, 64-1/16 in, 79-15/16 in, 95-3/4 in, 111-9/16 in, 127-7/16 in, 143-1/4 in | cumulative from the start |
The usual framing layout works differently. It hooks the tape on the end of the run and puts a joist center at every 16 in, so the centers fall at 16, 32, 48 and on to 128 in, and the last bay takes what is left, 15-1/4 in. Both layouts use 10 joists on this run.
Use the 16 in layout under sheet goods. Subfloor sheets run their 8 ft length across the joists, and the end joints are staggered from course to course, usually by half a sheet. The joints then fall at 48 and 96 in from the end of the run, and the 16 in layout has a joist centered under both. The equal layout puts its nearest centers at 48-1/4 and 95-3/4 in, 1/4 in off. One sheet then bears on 1/2 in of joist and its neighbor on 1 in, instead of 3/4 in each. Other runs miss by more: at 150 in the best fit is 16-1/2 in on center, the joist nearest 48 in is centered at 50-1/4 in, and its near edge at 49-1/2 in is past the end of the sheet.
Use the equal layout where no sheet has to land on the framing and the spacing is visible: deck joists under deck boards, pergola rafters, exposed purlins, slats, and battens. The floor joist span tables in IRC R502.3.1 are written for 12, 16, 19.2, and 24 in spacing, so an equal layout at or under the spacing you sized for keeps the joist size. Best fit can also land over the target. The maximum gap limits the open space, so when the on-center spacing has a ceiling, enter the ceiling less one member width. For 16 in on center with 1-1/2 in joists that is 14-1/2 in, and on the 150 in run it raises the count to 11 joists at 14-7/8 in on center.
Wall studs at 16 or 24 in, with plates and corners: Stud calculator
On center, open space, and clear
Framing is specified on center. Railings, fences, and screens are limited by the open space. The two differ by one member width. The standard framing spacings each divide an 8 ft sheet into whole bays:
| On center | Bays in 8 ft | Clear between 1-1/2 in members | Clear between 3-1/2 in members |
|---|---|---|---|
| 12 in | 8 | 10-1/2 in | 8-1/2 in |
| 16 in | 6 | 14-1/2 in | 12-1/2 in |
| 19.2 in (19-3/16 in) | 5 | 17-11/16 in | 15-11/16 in |
| 24 in | 4 | 22-1/2 in | 20-1/2 in |
Many tape measures print the 16 in multiples in red and mark the 19.2 in multiples with small black diamonds. The first diamond is at 19-3/16 in, and the fifth lands on 8 ft.
A 4 in maximum opening is a limit on the open space, so the on-center distance depends on the member. With 1-1/2 in slats it is 5-1/2 in on center at most. Guard balusters have their own rule and their own calculator, linked at the top of this page.
Which edge to mark
The calculator reports each mark at the leading edge, the center, or the trailing edge of the member. The leading edge is the one nearer the start of the run. The spacing does not change, and the reads move by half a member width. These are the first three marks on the rail example:
| Marks at | First | Second | Third |
|---|---|---|---|
| Leading edge | 3-11/16 in | 9-5/8 in | 15-1/2 in |
| Center | 4-13/16 in | 10-3/4 in | 16-5/8 in |
| Trailing edge | 5-15/16 in | 11-7/8 in | 17-3/4 in |
A center line disappears under the piece you set on it. For joists, studs, pickets, and slats, mark the leading edge, square a line across, and put an X on the side the member covers. Mark the center for anything drilled or driven at a point: holes, hooks, bolts, and spindles set in bored holes.
Rounding and tape resolution
The web calculator rounds to the nearest 1/16 in. The app offers 6 tape resolutions from 1/2 to 1/64 in. The rail example at 1/8, 1/16, 1/32, and 1/64 in:
| Resolution | On center | Open space | Last mark |
|---|---|---|---|
| 1/8 in | 5-7/8 in | 3-5/8 in | 87-3/4 in |
| 1/16 in | 5-15/16 in | 3-11/16 in | 87-11/16 in |
| 1/32 in | 5-15/16 in | 3-11/16 in | 87-23/32 in |
| 1/64 in | 5-59/64 in | 3-43/64 in | 87-45/64 in |
Each figure is rounded once from the exact fraction and never from a number that was already rounded. A coarser tape moves a mark by at most half a division, and the error does not build along the run.
The maximum gap
The maximum gap is an optional second limit. In evenly space mode it only warns. 5 slats on a 36 in run leave 4-3/4 in open, so a 4 in maximum flags the layout as over the limit and leaves the count alone.
In best fit it changes the answer. The 12 ft joist run fits 16 in with 10 joists and 14-5/16 in clear. Add a 14 in maximum gap and the count rises to 11 joists at 14-1/4 in on center with 12-3/4 in clear, and the calculator says that the maximum gap raised the count.
In limit the opening mode the maximum opening is already the limit, and the maximum gap has no effect.
Common layouts
All but one of these is a single pass through the calculator.
Board and batten wall
A 12 ft wall with 2-1/2 in battens, one at each end, best fit to 16 in: 10 battens at 15-3/4 in on center with 13-1/4 in between them. The end battens sit flush in the corners. Mark the leading edges from one corner and set each batten on the far side of its line.
Equal shelves
4 shelves of 3/4 in in a 72 in opening, evenly spaced with nothing at the ends: 13-13/16 in clear between shelves and at the top and bottom, with the shelf centers at 14-3/16, 28-3/4, 43-1/4, and 57-13/16 in. Measure up from the bottom and mark the leading edge to get the underside of each shelf.
Hooks, pulls, and holes
Enter 0 for the width when the thing being spaced is a point. 5 hooks on a 48 in board land at 8, 16, 24, 32, and 40 in, with 8 in left at each end.
Half spaces at the ends
Recessed lights and some trim layouts want half a space at each end instead of a full one. The calculator's modes leave a full space at an open end, so do this one by hand: divide the run by the count for the spacing, and start half a spacing in. 4 lights along a 12 ft ceiling are 36 in apart, with the first 18 in from the wall.
Anchor bolts with a maximum spacing
IRC R403.1.6 calls for sill plate anchor bolts at least 1/2 in in diameter, no more than 6 ft on center, with at least two bolts in each plate section and a bolt between seven bolt diameters and 12 in from each end. For a 24 ft plate with the end bolts set 12 in from each end, the run between the end bolts is 264 in. Enter that run, a width of 0, a member at both ends, and limit the opening to 72 in: 5 bolts at 66 in on center. Add 12 in to each read to measure from the end of the plate: 12, 78, 144, 210, and 276 in. Seismic design categories and local amendments can call for closer spacing, so check the plans.
Fence posts at a maximum spacing
Post spacing is measured center to center, so enter a width of 0 and a member at both ends. A 50 ft run with the opening limited to 8 ft takes 8 posts and 7 equal bays of about 7 ft 1-11/16 in. Set each post from the cumulative reads, because stepping that rounded figure 7 times ends 3/16 in short of the far end. The fence calculator does the same division and adds corners, gates, rails, pickets, and concrete.
Some layouts have their own calculator, which adds what a general spacing tool leaves out:
- Fence calculator divides each run into bays and counts posts, rails, pickets or panels, and concrete.
- Baluster spacing calculator checks the 4 in sphere rule and totals balusters across the sections of a deck railing.
- Stud calculator counts studs from the wall length and spacing, with corners and plates.
- Deck board calculator counts decking boards for a straight or diagonal deck.
Metric runs
The web calculator takes feet and inches. The arithmetic is the same in millimeters, and the app accepts metric runs directly. Take a 2,400 mm run of 45 mm slats with the opening capped at 100 mm: (2,400 + 45) / (45 + 100) = 16.9, rounded up to 17 openings and 16 slats. The on-center distance is 2,445 / 17 = 143.8 mm and the open space is 98.8 mm. The first slat is centered 143.8 - 22.5 = 121.3 mm from the start. Work out each later center from the exact fraction and round it once. Slat 16 is centered 16 × 2,445 / 17 - 22.5 = 2,278.7 mm from the start, which reads 2,279 mm.
Cabinet shelf-pin holes on the 32 mm system are a fixed pitch, 32 mm from center to center. That is a repeated step and not an equal division of the run, so it needs no spacing calculation.
What the calculator leaves out
It spaces one kind of member evenly along one straight run. It does not cover:
- Mixed widths. Alternating wide and narrow slats need the pattern treated as one repeating unit or laid out by hand.
- A fixed spacing with the remainder in the last bay. That is the framing layout described above, and it is pulled with a tape.
- Raked runs. A stair rail laid out along its slope is in the app.
- More than 256 members in one layout.
- A code or span check. It spaces what you enter, and the limit is yours to supply.
- Stock lengths or a cut list. The output is a count and positions.
What the app adds
This page handles level runs in feet and inches. The app also takes a rake angle for a stair rail, so the marks are laid out along the rake while the opening is checked both along the rail and horizontally. It accepts metric runs, keeps the exact fraction behind every number, lets you pick the tape resolution, and prints the mark schedule as a PDF you can tape to the work.
Common questions
- How do I space things evenly along a run?
- Add one member width to the run and divide by one more than the count. That is the on-center distance when nothing sits at either end. Mark each position from the start of the run as a running total so the rounding does not build up. 5 slats of 1-1/2 in on a 36 in run are centered at 5-1/2, 11-3/4, 18, 24-1/4, and 30-1/2 in from the start. The calculator does the arithmetic and gives the marks to the nearest 1/16 in.
- What is the formula for equal spacing?
- With nothing at the ends, on center = (run + member width) / (count + 1). With a member at both ends, on center = (run - member width) / (count - 1). With a member at one end only, on center = run / count. In every case the open space is the on-center distance less one member width.
- What is the difference between on center and open space?
- On center is the distance from the center of one member to the center of the next. Open space is the clear gap between their faces, which is the on-center less one member width. 16 in on center with 1-1/2 in lumber leaves 14-1/2 in clear. Framing is specified on center, and railings and fences are limited by the open space. The calculator shows both.
- How many pickets or slats do I need for a maximum gap?
- Add one member width to the run, divide by the member width plus the maximum gap, and round up. That is the number of openings, and with nothing at the ends the members are one fewer. A 92-1/2 in rail with 2-1/4 in pickets and a 4 in limit gives 16 openings and 15 pickets with 3-11/16 in between them.
- How do I calculate joist spacing?
- Decide the nominal on-center, usually 16 in. Under subfloor or other sheet goods, pull that spacing from one end so the sheet edges land on joists. Where the bays should be equal, as on a deck or a pergola, best fit the spacing to the run with a joist at each end. For a 12 ft run of 1-1/2 in joists that is 10 joists at 15-13/16 in on center, a little under 16 in.
- What does 16 in on center mean?
- The center of each member is 16 in from the center of the next. With 1-1/2 in lumber the clear space between members is 14-1/2 in. On a framing layout the 16 in marks are measured from the end of the run, so the edge of a 4 by 8 ft sheet lands on the center of a member every 48 in.
- What are the black diamonds on a tape measure?
- They mark multiples of 19.2 in, which reads 19-3/16 in on the tape. That spacing puts five framing bays under an 8 ft sheet, where 16 in gives six and 24 in gives four. It is one of the four spacings in the IRC floor joist span tables.
- Why not just step off the same measurement with the tape?
- Because every step carries the rounding forward. A spacing of 5-59/64 in reads 5-15/16 in on the tape, and stepping that off along 15 pickets puts the last mark 1/4 in past where it belongs. Marking from the start with each position rounded once keeps every mark within 1/32 in. The calculator's cumulative reads are that list.
- Should I mark the center or the edge?
- Mark an edge for anything that covers its own line, such as a joist, stud, picket, or slat, and put an X on the side the piece goes. Mark the center for a hole, a hook, a bolt, or anything else set at a point. The calculator gives leading-edge, center, or trailing-edge reads for the same layout.
- How do I space shelves evenly?
- Enter the height of the opening as the run, the shelf thickness as the width, and the number of shelves as the count, with nothing at the ends. 4 shelves of 3/4 in in a 72 in opening leave 13-13/16 in clear in each space. To include the top and bottom of the case, enter its outside height as the run, add two to the count, and turn on a member at both ends. That works when the top and bottom are the same thickness as the shelves.
- How do I lay out board and batten spacing?
- Measure the wall, decide the batten width and a target spacing, and best fit it with a batten at each end. A 12 ft wall with 2-1/2 in battens at a 16 in target takes 10 battens at 15-3/4 in on center, 13-1/4 in apart. Lay out each wall on its own run so the battens are even between its corners.
- Can I put a member at only one end?
- Yes. Turn on the member at the start or at the end, and leave the other off. The openings then equal the members and the on-center distance is the run divided by the count. 5 slats of 1-1/2 in on a 36 in run with one at the start are 7-3/16 in on center, and the last opening runs out to the end of the run.
- What is the maximum gap for?
- It is a ceiling on the open space. In evenly space mode it flags a layout that opens too wide. In best fit it raises the count until the gap is met, so a 16 in target with a 14 in maximum gap on a 12 ft run gives 11 joists instead of 10.
- Does the spacing calculator work in metric?
- The web calculator takes feet, inches, and fractions. The app takes metric runs. By hand the method is the same: a 2,400 mm run of 45 mm slats with a 100 mm maximum opening takes 16 slats at 143.8 mm on center.
- What is the standard stud spacing?
- Most walls are framed with studs 16 in on center. IRC Table R602.3(5) allows 24 in for some walls, depending on the stud size and what the wall carries. Studs are laid out at the fixed spacing from one end of the plate, like joists under sheet goods, so the stud calculator is the tool for the count.
- Can I use this for deck or stair balusters?
- Use the baluster spacing calculator instead. It is built around the IRC 4 in sphere rule for guards and shows the pass or fail. This page is the general tool for anything else that needs equal spacing, including a rail where you set your own opening limit.
Mark it from the start, once
CutOnce lays out the spacing like this page, then handles raked stair rails, metric runs, and your tape resolution, and prints the mark schedule as a PDF, with no signal needed.
Free to download, with a 7-day trial of everything. This page gives the marks, and the app prints them and keeps the layout with the job.
See also
