
A good stair railing is a style choice inside four numbers: the handrail 34 to 38 inches above the stair nosings, a guard on any open side more than 30 inches above the floor, gaps too small for a 4 3/8 inch ball on the stair (4 inches on a landing), and a top rail that holds 200 pounds; the MeltFlex AI stair railing calculator below turns those into a baluster count for your stair, and MeltFlex AI can show any of the 24 railing ideas on a photo of your own staircase, although in our test it drew code-tight spacing on only 8 of 12 flights.
Our articles are still written by humans!
Get human written articles in your Google feed.
Most stair railing idea pages are a gallery of beautiful staircases, and some of the most beautiful ones would fail an inspection: iron balusters one per tread, horizontal bars with a 6 inch gap, cables you can push apart with a hand. The look is the easy part. What decides whether the railing you love is legal is the baluster size, the tread depth and the height of the top rail, and those numbers sit in the 2024 International Residential Code, not on Pinterest. So this page puts the measurement next to every idea, works out the spacing for each style, and gives the cost per foot. At the end I show what happened when I asked MeltFlex AI to put four railing styles on four real staircases. MeltFlex AI is ours, so the misses are in there too.
The short version
Enter the number of risers, the riser height and the tread depth of your stair, pick the railing style (Bars means horizontal bars) and the baluster or bar size, and add the length of any level guard at the top, such as a landing or a balcony. Fractions work (7 1/2, 1 1/4). The calculator gives the rail length along the slope, whether you need a handrail and a guard at all, the number of balusters per tread and the clear gap between them, the number of cable or bar rows for a horizontal railing, the posts or glass panels, and an installed cost range. Switch from House to Commercial to check the stricter IBC rules. Copy the plan to send it to whoever builds the railing.
Interactive calculator
Loading… if it does not appear, refresh the page.
A worked example with the defaults: 14 risers of 7 1/2 inches on 10 inch treads make a 105 inch rise, more than 30 inches, so the open side needs a guard, and with 4 or more risers it needs a handrail. The rail runs 13 feet 7 inches along the slope at 36.9 degrees. Stock 1 1/4 inch wood balusters two per tread leave a 3 3/4 inch gap, under the 4 3/8 inch limit, so the flight takes 26 balusters and costs about $270 to $810 installed. Switch to 1/2 inch iron and two per tread leave 4 1/2 inches, which fails: it takes three per tread, 39 balusters with a 2 13/16 inch gap, and $880 to $1,830. Add a 4 foot landing at the top and the wood version needs 9 more balusters, because the level part is held to 4 inches, not 4 3/8.
The calculator measures the gap square to the bars, which is how a ball would actually pass through a raked railing, and it counts on a 1 1/2 inch top rail. It does not design posts, brackets or anchorage: the 200 pound load in the code is about how the railing is fixed, and that is a job for the installer and the product’s instructions. If you are still working out the stair itself, use our stair calculator for rise and run first. Basement stairs count too: an open side more than 30 inches above the floor needs a guard there as well, which our basement ideas cover with the rest of the finish.
A stair railing is two things the code treats separately. The handrail is what you hold. The guard is what stops you falling off the open side, and the balusters, glass or cables are its infill. On many stairs the top of the guard is also the handrail, which is why the two height ranges overlap. Here are the rules from the 2024 International Residential Code, which most US states adopt for houses, and the 2024 International Building Code for everything else. Your town may use an older edition or local amendments, so your inspector has the last word.
| Rule | House (IRC 2024) | Section |
|---|---|---|
| When a handrail is required | At least one side of every flight with 4 or more risers | R318.7.8 |
| Handrail height | 34 to 38 in above the line of the nosings | R320.2 |
| Handrail clearance from the wall | At least 1 1/2 in | R320.4 |
| Handrail projection into the stair | At most 4 1/2 in on each side | R320.3 |
| Handrail grip (Type I) | Round 1 1/4 to 2 in across; other shapes 4 to 6 1/4 in around, at most 2 1/4 in across | R320.6 |
| Handrail continuity | The full flight, from the top nosing to the lowest nosing, ends returned | R320.5 |
| When a guard is required | Open side more than 30 in above the floor below, within 36 in of the edge | R321.1.1 |
| Guard height | 36 in on landings and balconies; 34 in on the open side of a stair; 34 to 38 in where it is also the handrail | R321.1.2 |
| Openings in the guard | No 4 in sphere; 4 3/8 in on the open side of a stair; 6 in in the triangle at riser, tread and bottom rail | R321.1.3 |
| Strength | 200 lb at any point on the top; infill 50 lb over 1 sq ft | Table R301.5 |
| Glass | Always safety glazing, designed with a load factor of 4 | R324.4.4; Table R301.5 |
In a commercial building, an apartment lobby or an office, IBC 1015.3 raises the guard to 42 inches, with the same 34 inch exception on the open side of a stair, and 1015.4 allows the 4 3/8 inch sphere only between 36 and 42 inches. In practice that holds the lower part of a commercial stair guard to 4 inches, which is why the calculator’s Commercial setting needs more balusters. One error worth knowing about: a widely read cost guide says a 28 inch railing is acceptable on stairs used mainly by children. R320.2 has no such exception for a main stair. For the rest of the stair geometry, such as riser height, tread depth and headroom, see our stair dimensions and code guide.
The ideas go from the most popular modern railings to classic wood and iron, then screens, panels and handrails. Each has the measurement that decides whether it works, and a sentence on when to skip it. The pictures are designs from the MeltFlex AI creations gallery; a picture shows the look, not a checked drawing, so run your own stair through the calculator before you order.

Horizontal bars that run with the stair are the most requested railing in modern interiors, and the one most often built with gaps that are too big. On a 36 inch rail with 3/4 inch bars it takes about 5 rows to keep the gap under 4 3/8 inches, measured square to the bars; on a level landing at 36 inches, where the limit is 4 inches, it takes 7. The IRC says nothing about the direction of the bars, but some inspectors and HOAs object to a railing a child can climb like a ladder, so ask first. See the FAQ on horizontal railings.

Thin square steel spindles read as a fine screen rather than a row of posts. The thinner the spindle, the more of them you need: at 1/2 inch, three per 10 inch tread. A floating stair has a second gap to check, between the treads if the risers are open, so ask the stair maker how they handle the 4 inch rule there.

The cheapest way to update an old stair is to keep the wood handrail and swap the spindles for black metal ones. Iron balusters often go into the existing holes, but stock wood balusters are 1 1/4 inches and stock iron ones 1/2 inch, so the same holes leave a bigger gap: two per tread go from 3 3/4 to 4 1/2 inches. Plan for a third baluster per tread, or new holes. Black railings pair well with black interior doors in the same hall.

Flat bars turned edge-on look half as thick as round ones from the side and full width from the front. Count them by the narrow side, which is what a ball meets at an angle, and check the handrail shape: a solid rectangular walnut cap is fine as a guard top, but a handrail you hold has to be graspable, 4 to 6 1/4 inches around and no more than 2 1/4 inches across (R320.6).

An all-metal picket railing is the default in apartment buildings because it is cheap, strong and easy to keep under 4 inches. If yours is a commercial stair, remember the guard on a landing is 42 inches, not 36. The calculator’s Commercial setting adds the extra pickets.

The guard around a stairwell opening is a landing guard: 36 inches high in a house and 4 inch gaps, not 4 3/8. On a curve, measure the gap on the inside of the bend, where the bars are closest to each other at the top and farthest apart at the floor if they lean.

Glass has no gap to measure, which is why designers love it on open stairs. The code makes up for it elsewhere: glass in a guard is always a hazardous location and must be safety glazing (R324.4.4), and it is designed for four times the normal load. A structural glass panel also needs a top rail or handrail tied to at least three panels unless it is laminated glass of two or more equal plies.

A metal handrail on glass is what makes the glass feel safe to hold. A round brass rail of 1 1/4 to 2 inches meets the Type I grip rule; a flat cap channel that only covers the top edge of the glass does not count as a handrail, so a stair of 4 or more risers still needs a graspable rail, often on the wall side.

A black frame around each pane is the industrial version. The glass is held on all four sides instead of clamped at the floor, and the frame hides the fingerprints at hand height, which is the honest downside of frameless glass in a house with children.

On a central-spine stair the glass usually bolts to the side of each tread or to the beam. That makes the fixing, not the glass, the thing to check: ask the maker for the tested load on the fixing, because the 200 pound requirement applies at any point along the top.

A round oak rail on brackets is the simplest handrail there is, and it lets the open side stay almost invisible. Keep 1 1/2 inches between the rail and the wall (R320.4) and run it the whole flight. Look closely at the picture: the open side does have a guard, a clear glass panel you barely see, and the opening down to the floor below has its own glass guard. That is the trade-off of invisible glass: people walk into it, so a frosted strip at eye height is worth considering.

Cables are the railing that looks legal and often is not, because a cable bends. Permit Sonoma’s bulletin sets the field test: 1/8 inch cable at most 3.00 inches apart, a turnbuckle on every cable, and with a 50 pound weight hung on a cable, a 4 3/8 inch ball must still not pass at the stair. Viewrail puts metal posts 4 feet apart for the same reason. On a 36 inch stair rail that is 8 cables and 5 posts.

A perforated panel solves the gap rule at once: the holes are far smaller than 4 inches. The panel still has to carry the 50 pound infill load over a square foot, so it needs a frame or a thick enough sheet. Add a graspable rail on top or on the wall; a flat panel edge is not a handrail.

Welded wire mesh in a black frame is the budget version of the panel railing and a good choice with toddlers and pets: little to climb, nothing to squeeze through. Pick a mesh with openings small enough that a foot cannot get a hold, and a frame with a round top rail.

A floor-to-ceiling screen of rods is a guard that also works as a room divider. The rods are long, so they need to be stiff enough not to spread under a push, and the stair still needs a handrail at 34 to 38 inches on at least one side.

Painting the railing the wall color makes it disappear, which is the point in a small house. White powder coat chips at the handrail, so consider a timber or stainless rail on top where hands go.

The classic American railing: square white balusters, two per tread, under a stained handrail. It is also the cheapest at $20 to $60 a foot. Two per tread works on a 10 inch tread with 1 1/4 inch balusters (3 3/4 inch gap) and still on an 11 inch tread (4 1/4 inches, 1/8 inch to spare). On a deeper tread, go to three.

A turned baluster is thinner at its narrowest point than its square ends, and the gap is measured where it is widest. Measure the thinnest part of the turning before you count balusters, or check the maker’s spacing sheet. Our farmhouse interior design guide shows the rest of the look.

Full-height slats are a guard and a wall at once, they hide the underside of the stair, and they double as an accent wall in the living room. Keep the gaps between slats under 4 inches and add a separate round handrail; the slats themselves are not graspable.

Horizontal wood slats bring the warmth of oak to the modern horizontal look, with the same climbing question as horizontal metal. Narrow gaps of 1 to 2 inches make it hard to get a foothold and are well inside the 4 inch rule.

Mixing plain, twisted and basket balusters is the standard builder upgrade, $65 to $135 a foot installed in wrought iron (HomeGuide). The basket bulges only narrow the gap; the widest opening is between the straight parts, so count the balusters as if they were all plain. With 1/2 inch iron, three per tread on a 10 inch tread.

Scrollwork is beautiful and hard to check, because every curl makes a different opening. Ask the smith to test the panels with a 4 3/8 inch ball, and expect custom work: scroll panels on a curved stair are made to measure.

A thick rope is a handrail, not a guard, and it sags. To count as one, it has to be taut, round 1 1/4 to 2 inches, 34 to 38 inches above the nosings and continuous for the flight. The open side still needs its own guard, here the black rods.

A stair between two walls has no open side and needs no guard, only a handrail. A recessed groove looks clean, but the code wants 1 1/2 inches between the rail and the wall and a grip you can close your hand around, so a groove needs a real rail set into it. The LED strip doubles as stair lighting; our recessed lighting calculator covers the room around it.
The same stair, 14 risers of 7 1/2 inches on 10 inch treads with a 36 inch top rail, run through the calculator in every style. The gap is the clear opening a ball would have to pass.
| Style | Stock size | Layout | Clear gap | House stair (4 3/8 in) |
|---|---|---|---|---|
| Wood balusters | 1 1/4 in square | 2 per tread, 26 on the flight | 3 3/4 in | Passes |
| Wood, 11 in tread | 1 1/4 in square | 2 per tread | 4 1/4 in | Passes by 1/8 in |
| Iron balusters, 2 per tread | 1/2 in square | 2 per tread | 4 1/2 in | Fails |
| Iron balusters | 1/2 in square | 3 per tread, 39 on the flight | 2 13/16 in | Passes |
| Horizontal bars | 3/4 in tall | 5 rows | 4 1/8 in, square to the bars | Passes |
| Cable | 1/8 in | 8 cables, 5 posts 4 ft apart | 3 in | Passes the 3 in cable limit |
| Glass | Panels | 4 panels along the flight | None | Passes; safety glazing required |
The pattern: the thinner the infill, the more of it you need, and the cheap-looking switch from wood to iron balusters is where most homeowners get caught, because the old holes are set for a wider baluster.
| Material | Installed, per linear foot | 14 riser flight (13 ft 7 in) |
|---|---|---|
| Wood | $20 to $60 | $270 to $810 |
| Wrought iron | $65 to $135 | $880 to $1,830 |
| Metal (steel, horizontal bars) | $50 to $250 | $680 to $3,390 |
| Aluminum | $50 to $200 | $680 to $2,710 |
| Cable | $60 to $500 | $810 to $6,770 |
| Glass | $100 to $600 | $1,350 to $8,130 |
Per-foot prices are from HomeGuide (July 2023, so add some inflation), which puts a typical 25 foot job at $500 to $6,300, installers at $60 to $100 an hour and replacing the balusters alone at $1,200 to $1,500. The flight column is the calculator’s rail length times those prices. Landings and balconies add their own feet; a 4 foot landing adds about 30%. If you are redoing the whole staircase, our staircase makeover guide has the costs for treads, paint and runners.
MeltFlex AI restyles the railing in a photo of your staircase in MeltFlex AI Stairs Design: upload the photo, open the Balustrade row and pick glass panel, metal spindles, turned balusters or cable rail, and optionally a railing finish such as matte black or brass. The rest of the room is meant to stay as it is. A render costs 10 credits; new accounts get 15 free credits, so the first one is free, and Standard is $20.99 a month, or $12.99 a month billed yearly, for 490 credits. You can also run it from Claude or ChatGPT through the MeltFlex AI MCP server, or from your own app with the MeltFlex AI API.
In our MeltFlex AI test on November 29, 2026 I took four staircase photos from Wikimedia Commons: two views of a Virginia stair with iron balusters, a black and white photo of a Washington, DC hall stair from the Historic American Buildings Survey, and a historic stairwell with heavy turned balusters seen from the floor above. Each got the exact text of the four Balustrade options in the tool, twice, on the same model the site uses. That is 32 renders, all checked at full size.
| Check | Result |
|---|---|
| Drew the railing type asked for | 32 of 32 |
| Kept the stair, the camera and the room | 30 of 32 |
| Balusters close enough for a 4 3/8 in ball (spindles and turned, 12 flights) | 8 of 12: front view 4 of 4, DC hall 4 of 4, side view 0 of 4 |
| Kept a black and white photo black and white | 3 of 8 (5 came back in color) |
| Misses | Rebuilt a landing rail as one curve and dropped both newel posts (1); moved the camera closer and added carved newels (1) |
| Time per render | 16 to 56 s, four at a time |




The pattern is the same one I saw in our other tests: MeltFlex AI is good at the look and weak at the count. It never missed the style, and on a straight-on view of a stair it drew about two balusters per tread, which is what a real railing needs. From a steep side angle it thinned them out to about one per tread, which looks elegant and would fail an inspection. It also treats an old black and white photo as something to fix, coloring it in more often than not.
What that means for you: use MeltFlex AI to choose between glass, black spindles, cable and turned balusters on your own stairs, and to see the finish against your floor and walls before you spend $1,000 or more. Do not use the picture to count balusters or to check a gap; use the calculator and the tables on this page, and the maker’s installation sheet. If a render changes something you want to keep, run it again: the same prompt kept the newel posts on the second try. For the other things the tool changes on a staircase, such as treads, risers and runners, see our AI staircase makeover guide, and for the whole room around it, MeltFlex AI interior design. How it compares with other tools is in our best AI renovation tools test.
Close enough that a 4 3/8 inch ball cannot pass between them on the open side of a home stair (IRC 2024 R321.1.3), and a 4 inch ball on a landing, balcony or any commercial stair guard (IBC 2024 1015.4). With stock 1 1/4 inch wood balusters on a 10 inch tread, two per tread leave 3 3/4 inches and pass; with 1/2 inch iron balusters two per tread leave 4 1/2 inches and fail, so iron usually needs three per tread. The free MeltFlex AI stair railing calculator on this page works it out for your tread and baluster.
Yes. MeltFlex AI Stairs Design (meltflexai.com/ai-stairs-design) restyles the balustrade in a photo of your staircase: you pick glass panel, metal spindles, turned balusters or cable rail, plus a railing finish. A render takes 16 to 56 seconds and costs 10 credits; new accounts get 15 free credits. In our MeltFlex AI test on November 29, 2026 it drew the railing type asked for in 32 of 32 renders and kept the stair and room in 30 of 32, but drew code-tight spacing on only 8 of 12 flights, so count the balusters with the calculator, not the picture.
In a house (IRC 2024) the handrail sits 34 to 38 inches above the line of the stair nosings, and a guard on the open side of a stair must be at least 34 inches; where the top of that guard is also the handrail it must stay within 34 to 38. A guard along a level landing or balcony needs 36 inches. Commercial guards under the IBC need 42 inches. The MeltFlex AI calculator checks your top rail against both.
A handrail is required on at least one side of every flight with four or more risers (IRC 2024 R318.7.8). A guard is required on any open side that is more than 30 inches above the floor below, measured within 36 inches horizontally of the edge (R321.1.1). A short flight of three steps needs neither, though a handrail is still a good idea.
HomeGuide puts installed stair railings at $20 to $60 per linear foot for wood, $65 to $135 for wrought iron, $50 to $250 for metal, $60 to $500 for cable and $100 to $600 for glass, and $500 to $6,300 for a typical 25 foot job. A 14 riser flight is about 13 1/2 feet of rail along the slope, so roughly $270 to $810 in wood and $1,350 to $8,130 in glass.
Yes, if a 4 3/8 inch sphere still cannot pass between the cables when they are pushed. Permit Sonoma, a county building department, writes that into a field test: cables at most 3.00 inches apart, a turnbuckle on each cable, and with a 50 pound weight hung on a cable a 4 inch sphere (4 3/8 inches at stairs) must not pass. Railing makers space cables about 3 1/8 inches on center with posts 4 feet apart for the same reason.
Glass in a guard is always treated as a hazardous location and must be safety glazing, designed for four times the normal guard load (IRC 2024 R324.4.4 and Table R301.5). Structural glass baluster panels need an attached top rail or handrail supported by at least three panels, unless the panels are laminated glass of two or more equal plies. A stair of four or more risers still needs a graspable handrail 34 to 38 inches high.
The IRC and IBC sections quoted on this page set the height and the sphere size and say nothing about which way the infill runs, so horizontal bars that keep every gap under 4 3/8 inches (4 inches on landings) meet those sections. Some local codes, HOAs and inspectors object to climbable horizontal rails where children live, so ask your building department before you order.
Audio version by MeltFlex AI
Prefer to listen? Matthew and Bryan, the founders of MeltFlex AI, talk through Stair Railing Ideas: 24 Designs With Code Measurements in about 15 minutes. The voices are AI-generated. Every section is a chapter, so you can jump straight to the part you need while you browse rooms or sketch a layout.
More narrated articles on AI Interior Design MeltFlex