Pool Fence Calculator
Enter the pool size and the distance to the fence to get the fence length, panels and posts, and check height and gaps against the CPSC guidelines.
Pool Fence Calculator estimates how much fence you need to enclose a swimming pool, how many panels, posts and gates that takes, and what the fence will cost. You enter your pool’s shape and size, the walkway you leave inside the fence, and the fence details you choose. The tool also checks the layout against the CPSC barrier guidelines for residential pools, so you can see which checks are met before you order.
It runs in your browser, is free, and needs no sign-up. Nothing you type is uploaded. The result updates as you type, so you can compare layouts quickly. Treat the figures as estimates for planning and ordering. Your local building code and the manufacturer’s instructions decide post depth, spacing, railing height and openings.

How to use the Pool Fence Calculator
- Under ‘Measure from’, choose A rectangular pool, A round pool, or A fence length I already know.
- Type the ‘Pool length’ and ‘Pool width’, the ‘Pool diameter’, or the ‘Fence length’.
- Enter ‘Distance from the pool edge to the fence’, which is the walkway or deck you leave inside the fence on every side.
- Enter ‘Panel or section width’, the width of one panel between posts. For removable mesh, use the length of one section.
- Enter the number of ‘Gates’ and the ‘Gate width’.
- Enter ‘Fence height’, from the ground to the top of the fence.
- Choose a ‘Fence type’. For pickets, bars or balusters, enter the ‘Gap between pickets / mesh opening’ and the ‘Distance between the tops of the horizontal rails’.
- Under ‘More options’, choose the ‘Ground under the fence’ and enter the ‘Gap under the fence’.
- Also under ‘More options’, choose a ‘Currency’ and type your ‘Price per foot (or metre) of fence’ and ‘Price per gate’.
- Read the result lines, including the barrier checks and the cost.
The example buttons at the top fill in a realistic case, such as a 16 × 32 ft pool with a 4 ft deck or a 5 × 10 m metric pool. ‘Reset’ restores the starting example.
Below the result, ‘Copy result’ copies the figures, and ‘Copy link’ copies a page address that keeps all your inputs. ‘Print / save as PDF’ prints the inputs, the result, the calculation steps and the date.
How do you calculate the fence length around a pool?
Add a walkway strip on every side of the pool, then measure the outside of that strip. For a rectangular pool with a walkway (setback) s on every side, the length is 2 × (length + 2s) + 2 × (width + 2s). For a round pool, it is π × (diameter + 2s). The 2s term appears because the walkway adds s on both sides of each dimension.
For example, a 16 × 32 ft pool with a 4 ft deck needs 2 × 40 + 2 × 24 = 128 ft of fence. With one 4 ft gate, the fence line is 124 ft.
How many panels and posts does a pool fence need?
Divide the fence length without gates by the panel or section width, and round up to the next whole panel. In the example above, 124 ft ÷ 6 ft gives 21 panels of 6 ft, with 22 posts. The last panel is the remainder, so the tool shows it as ‘Last panel cut to’. If that last piece is very short, the tool warns you to spread the length evenly across the panels. If the gates take up the whole fence line, the tool shows an error.
What do the CPSC pool fence guidelines require?
A pool fence keeps young children from reaching the water without an adult. The CPSC Safety Barrier Guidelines for Residential Pools are guidelines, not a mandatory federal standard, but many state and local codes are based on them. They ask for the top of the barrier to be at least 48 in above the ground; the booklet notes that some states, counties and cities require 60 in. The gap under the barrier should be no more than 4 in on hard surfaces, 2 in on grass or gravel, and 1 in for removable mesh. No opening should let a 4 in sphere pass.
For horizontal rails less than 45 in apart, the rails go on the pool side and vertical members are at most 1¾ in apart. With 45 in or more between rails, vertical members may be up to 4 in apart. Chain link mesh should be at most 1¼ in, unless slats reduce the openings to 1¾ in. Pedestrian gates should open outward, away from the pool, and be self-closing and self-latching. If the latch release is lower than 54 in from the bottom of the gate, it belongs on the pool side at least 3 in below the top.
How is the cost of a pool fence worked out?
The tool multiplies the fence length by your price per foot or metre, then adds the number of gates multiplied by your price per gate. If you choose the known-length option, it uses the length you typed. Prices are never assumed: you type them in, so the total reflects your own quote.
Sources
- CPSC Publication 362, Safety Barrier Guidelines for Residential Pools (public domain; guidelines, not a mandatory standard) — 48 in minimum height (some places require 60 in), clearance under the barrier 4 / 2 / 1 in, 4 in sphere, 1¾ in and 4 in rules for vertical members, 1¼ in chain link mesh, self-closing and self-latching gates. Checked October 2026.
Worked examples
| Input | Result |
|---|---|
| 32 × 16 ft pool, 4 ft setback | 128 ft of fence line, 21 panels, 22 posts; All 3 checks met |
| 18 ft round pool, 3 ft setback | 75.398 ft of fence line, 6 panels, 7 posts; All 2 checks met |
| 10 × 5 m pool, 1.2 m setback | 39.6 m of fence line, 17 panels, 18 posts; All 3 checks met |
| 96 ft of fence | 96 ft of fence line, 16 panels, 17 posts; 1 of 3 checks not met; cost $3,946.00 |
Calculated by the tool above with these values.
Frequently asked questions
Does the pool fence calculator include gates in the cost?
Yes. It multiplies your price per gate by the number of gates, and adds that to the fencing cost. The fence length it uses for the fencing cost is the length with the gates taken out.
Is the result enough to pass a pool inspection?
No. The results are estimates for planning and ordering, and they never confirm that a fence complies with a code. Local building codes, which may be stricter than the CPSC guidelines, and the manufacturer’s instructions decide post depth, spacing, railing height and openings.
What height should a pool fence be?
The CPSC guidelines call for the top of the barrier to be at least 48 in above the ground. Some states, counties and cities require 60 in, so check your local code too.
Is what I type sent anywhere?
No. The tool runs entirely in your browser, and nothing you type is uploaded. It is free and needs no sign-up.
Can I use the results in a quote or job sheet?
Yes. Results may be used in commercial work, such as quotes, material lists and job sheets, with no attribution required. Use ‘Print / save as PDF’ to keep a dated copy of the inputs and calculation steps.
Related tools
- Fence panel calculator — panels, posts and the cut size of the last panel.
- Linear feet fence calculator — the fence line of your yard in feet, yards and metres.
- Baluster spacing calculator — balusters per section and the exact gap.
- Chain link fence calculator — the full chain link materials list.
- Fence cost calculator — the materials list and total cost with your local prices.
- Fence post concrete calculator — concrete bags per post hole.