A pool fence in the St. Louis area has to stand at least 48 inches tall and sit no more than 2 inches off the ground. The pickets have to be close enough to block a 4 inch sphere. That is the short answer, and those three numbers decide whether your fence passes inspection. Everything else, the material, the color, the style, is your choice.
Most homeowners do this backwards. They pick a fence they like, then find out it fails code. Start with the barrier rules, then choose the look.
A separate pool fence is not always necessary. Say your yard is already fenced to 48 inches all the way around. If those gates close and latch on their own, and swing away from the water, you do not need a second fence inside it. Measure what you already have before you price anything new.
Maintenance-Free Outdoor Solutions builds pool enclosures across the St. Louis area. See how a pool fence job runs from start to finish. Reach us at 636-464-1144, and we will confirm your municipality’s version of the code with you before anything gets ordered.
The Four Rules a Pool Fence Has to Meet
St. Louis County adopts these from the International Building Code, section SP305.2.1. Municipalities inside the county set their own versions, so confirm yours with your building department before you order.
- Height: 48 inches minimum. Measured from the outside of the barrier, not the pool side.
- Ground clearance: 2 inches maximum. Most municipalities in the metro hold this line. On uneven ground you either regrade or fill underneath with topsoil, mulch or decorative rock.
- Picket spacing: a 4 inch sphere must not pass through. Manufacturers build pool-compliant styles at 3.75 inch spacing or less to clear this.
- Gates: self-closing and self-latching, swinging away from the pool. Where the latch release sits below 54 inches, it goes on the pool side of the gate.
Want it handled start to finish, inspection included? See how our pool fence installation works or call 636-464-1144.
Choosing the Right Material
Only three materials are worth considering around a pool. All three are maintenance-free, which matters more here than anywhere else on your property, because a pool fence lives in constant splash, sun and pool chemicals.
Steel Fence

Ornamental steel is the strongest of the three. It resists climbing better than anything else because there is nothing to grip, and coated steel stands up to corrosion from pool chemistry.
Choose steel when security is the first concern, or when the pool sits where the fence doubles as the property barrier.
Aluminum Fence

Aluminum is the most common pool fence we install around St. Louis. The Barnhart job further down is a plain example: 171 linear feet of 54 inch aluminum, matte bronze, 3 gates, finished in 2.5 days. It will not rust, it needs no painting, and it comes in pool-compliant picket spacing straight from the factory.
It also does not block the view. If you want to watch the pool from the patio or the kitchen window, aluminum is the one that lets you.
Vinyl Fence

Vinyl is the choice when privacy matters as much as safety. Solid panels block sightlines from the street and neighboring yards.
Semi-private vinyl splits the difference, keeping most of the privacy while letting air move through, which makes a real difference on a still August afternoon. Vinyl comes in white, almond, clay, gray and blended colors, plus CertaGrain and CertaStucco textures.
The Three Materials Side by Side
Ornamental steel. 48 to 72 inches, does not block the view, the highest climb resistance of the three, and the upkeep is a rinse plus a recoat on any deep scratch.
Aluminum. 48 to 72 inches, does not block the view, high climb resistance, and needs nothing but a rinse.
Vinyl. 48 to 72 inches, blocks the view in solid panels, high climb resistance, and needs nothing but a rinse.
The deciding question is the view. If you want to see the pool from the house, steel or aluminum. If you want the pool hidden from the street or the neighbors, vinyl in solid panels. All three clear the 48 inch height and the 4 inch sphere test when ordered in a pool-compliant style.
One thing that catches people out: a 48 inch fence is the legal minimum, not the recommended height. A 60 inch barrier is materially harder for a determined child to climb, and it costs less to add height now than to replace the run later.
Safety Beyond the Code Minimum

Code is the floor, not the goal. A barrier that passes inspection can still be climbable.
Hand and Footholds
Children climb what they can grip. A horizontal rail at mid-height is a step. Pool-compliant panels put their rails at the top and bottom and leave nothing in between. That is why a fence that looks fine in a catalog can still fail in practice.
The code puts a number on it. If two horizontal members sit less than 45 inches apart, they have to be on the pool side of the pickets, and the gaps between pickets drop to 1.75 inches. Spread them 45 inches or more apart and the normal 4 inch sphere rule applies. Check the spacing on the panel you are ordering against your local pool code before it ships, not after.
Ground Clearance on a Slope
The 2 inch rule applies at every point along the run, not on average. Ground that falls away leaves a gap wide enough to matter, and it is a common reason a pool fence fails its first inspection.
Around a pool the grade decides the hardware. Step the panels down a slope and each one leaves a gap underneath, which fails the 2 inch rule. A sloped pool line is normally racked instead, not stepped. Both cost more than flat ground, and both are decided on site.
Gate Hardware
A fence does not fix a gate that gets propped open on a hot afternoon, and no barrier replaces an adult watching the water. Check the latch and the self-closing hinge twice a year, because hinges drift out of adjustment long before anything looks broken.
The gate is the weakest point of any pool barrier. A self-closing hinge pulls the gate shut on its own, and a self-latching mechanism catches it without anyone touching it. Together they mean the gate is closed even when someone forgets.
Where the latch sits is part of the rule. Put the release 54 inches or more above the ground and a standard latch is accepted. Put it lower and the rule tightens. The release then has to sit at least 3 inches below the top of the gate. No opening near it can be wider than 0.5 inch, within 18 inches either side, so a small arm cannot reach through and flip it.
Hardware wears. Test the closer and the latch at the start of every season.
Pool Fence Styles

Style changes the look, not the compliance, as long as the spacing rules are met.
Flat-Top
Vertical pickets run between a top and bottom rail with nothing above the top rail. It is the most common pool fence design and the least expensive of the three.
Double-Top
A second horizontal rail sits below the top rail, with the pickets terminating at it. Ornamental detail often fills the space between the two rails.
Loop-Top
The picket loops over at the top and returns down as the next picket. The visible loop along the top edge is the identifying feature.
A Pool Fence We Built in Barnhart


The O’Malley job, 15 May 2026, ran 171 linear feet around a pool with 3 gates, set on a slope. It took 2.5 days, and the slope and the gate count drove the schedule far more than the footage did. We found the ground fell away fastest right where two of the gates had to sit, so a square gate would have left a gap under one side. Rackable gates, which follow the grade instead of hanging level, held the clearance the whole way across.
That is the pattern on pool jobs. A pool enclosure is shorter than most perimeter fences but takes longer per foot. Every gate needs self-closing hardware, and every foot of slope has to hold the 2 inch clearance.
What the Inspector Checks

Where your municipality requires an inspection, it happens before final approval. Five things get measured, and they are the same five every time:
- Barrier height. 48 inches minimum, measured on the outside face, not the pool side.
- Ground clearance. Measured at the lowest point along the whole run, not an average. 2 inches maximum.
- Picket spacing. Tested with a 4 inch sphere. Pool-compliant panels run 3.75 inches or less.
- Gate swing. Away from the pool, every gate, no exceptions.
- Gate hardware. Self-closing and self-latching, with the release at 54 inches or higher, or mounted on the pool side.
One case catches people out. If the back of the house forms one side of the barrier, the doors opening onto the pool need an alarm. The alarm has to sound within 7 seconds of the door opening and keep sounding for at least 30 seconds. The switch that turns it off goes 54 inches or more above the floor, out of a child’s reach.
Two failures account for most of what gets rejected: ground clearance where the yard slopes, and gate hardware that was ordered but never fitted. Neither has anything to do with the fence panels, which is why a compliant panel can still fail on site.
How Much Fence Your Pool Needs
A pool enclosure is not measured like a yard fence. You are not following the property line. You are drawing the shortest line that keeps the water inside it and keeps climbable things, an air conditioner or a retaining wall, on the outside of it.
Count the gates before you count the feet. Every pool gate needs self-closing, self-latching hardware, so gates move both the price and the inspection more than footage does.
A residential pool enclosure usually lands between 100 and 175 feet. The Barnhart job above ran 171 feet with 3 gates.
For the panel and post math, which works the same on any fence, see figuring out how much fence you need.
Frequently Asked Questions
Is it law to have a fence around your pool?
Yes. In the St. Louis area a residential pool requires a barrier, and it is enforced through the building permit and inspection. St. Louis County works from the International Building Code, section SP305.2.1. The exact figures vary by municipality, so confirm with your local building department before ordering.
What kind of fence needs to be around a pool?
A pool fence has to stand at least 48 inches tall and sit within 2 inches of the ground. The pickets have to be close enough to block a 4 inch sphere. The gate has to close and latch on its own and swing away from the pool. Aluminum, ornamental steel and vinyl all meet this when built in a pool-compliant style.
What is a fence around a pool called?
A pool barrier. Building codes use the word barrier rather than fence because the requirement can also be met by a wall or by the side of a building. A pool safety fence is the same thing in everyday language.
What is the average cost of a fence around a pool?
The cost of a pool fence depends on material, height, gate count and whether the ground slopes. Those St. Louis figures live on their own page, kept current as prices move. See our pool fence cost guide for St. Louis.
How far does a fence have to be from a pool?
There is no single setback for the pool itself. The barrier just has to sit far enough back that nothing outside it can be used to climb in. Setbacks from property lines are a separate rule, set by your municipality, and those apply to the fence as well.
Does an above ground pool need a fence?
Usually yes. Some municipalities count the pool wall toward the barrier when it is at least 48 inches tall, but the ladder or steps still have to be secured or removable. See our guide to above ground pool safety fences.
Getting Your Pool Fence Right the First Time
Pick the barrier rules first, then the material, then the style, in that order. Doing it any other way is how a panel gets returned or a job fails inspection.
Would rather hand off the code side? That is what we do. We measure your line, confirm the requirements with your municipality, and schedule the inspection where one applies. Our pool-code panels come from the Catalyst range by Barrette Outdoor Living, and our listing is public on their installer directory. Homeowners around St. Louis have left their own account of working with us on our reviews page.
The install carries a one-year guarantee from us, separate from the panel maker’s own warranty. Expect a measuring visit within 1 to 4 days of your call. You can handle the panels and gates yourself at our Arnold showroom.
Call 636-464-1144 or see how our pool fence installation works.
Still weighing your options? This free guide covers all of them:
“`
—
## Before/after image pair

