Guardrail Versus Handrail
Typical Railing Components:
Generally, railings are systems designed to protect people in specific spaces such as balconies, terraces and stairways. Railings or guardrails consist of the following components:
 Post  vertical loadbearing / Flexural element
 Handrail or Grab rail
 Horizontal Rails (Top & Bottom Rails)
 Infill:
These are components that fill the space between posts. These may be made up of tension cables, horizontal or vertical pickets or complementary elements such as balusters or tempered glass panels.
Infill, such as pickets and tension cables are spaced such that there is no opening large enough for a 4inch diameter sphere to pass through. This approximates the size of a small child's head. Openings should be small enough to prevent a child's head from entering, where it could become trapped with disastrous results.
Typical Railing Layout:
Typical Railing Detail  shown with posts, horizontal rails, grab rail, and vertical pickets. The rail is directly mounted in concrete. Rails may also be bracketmounted or directly welded in cases of steel support.Loading on Railing:
The NAAMM (National Association of Architectural Metal Manufacturers) the 2006 IBC (International Building Code) require that handrails, guardrails, and their supports be designed for 50 lb per linear foot, applied in any direction at the top of the top rail, and a concentrated load of 200 lb applied in any direction at any location along the top of the top rail. The uniform load and concentrated loads are not to be applied simultaneously. Other components, including guardrail infill and bottom rails, are to be designed for 100 lbs acting on a projected area of 1 square ft, including the open space between components. The effects of this load are not to be combined with the load on the top rail.Where do these loadings come from?The uniform loading represents the force exerted by tightly grouped persons leaning on or pressing against the railing system. Such loading requirements range from 20 to 50 pounds per foot, applied horizontally to the top rail. In some codes, railing systems in certain locations shall be designed for loads as high as 100 pounds per foot applied vertically downward on the rails and the vertical and horizontal uniform loads shall be applied simultaneously.The concentrated loading represents the force exerted by a single individual leaning upon or over the rail or a person or object being hurled against the rail. This type of design loading is specified in the majority of codes although some codes only have uniform load requirements. A 200 pound concentrated load applied in any direction at any point along the top rail has become a requirement of a number of codes and government regulatory agencies.Current thinking by some organizations is to apply the concentrated load in a perpendicular direction at any point along the top rail, horizontally and downward in a vertical plane, but not simultaneously. Perpendicular horizontal loading applies the maximum moment to the post, and the downward loading simulates what a person leaning over the rail might apply.Design Consideration:
The most critical loads are those which are applied horizontally, as these produce the maximum bending moments on posts. The maximum bending moment on a rail occurs either under a concentrated load when the load is applied at mid span or under a uniform load due to a long span between supports.Posts act as columns in resisting vertical loading on rails and as vertical cantilever beams in resisting horizontal loading on either the rails or the posts. The bending moment due to the cantilever beam action under horizontal loading shall determine the size of the post.The critical bending moment in the posts shall be determined by either:
 the application of a uniform load to the rail, or
 the application of a concentrated load to the top of the post itself or to the rails it supports
The required Flexural Strength in for horizontal rail is governed by whichever loading returns the biggest bending moment on each rail component. It is a function of posts spacing.For posts, the bending moment returned by concentrated loading is a function of load proportion factor  which in turn is a function of relative stiffness of posts and horizontal rails; while the bending moment returned by uniform loading is a function of the post spacing.Generally, when a railing system is designed for a maximum of 4 feet target post spacing  the uniform loading controls the governing or critical bending moment.The same size (OD) pipe (though not necessarily the same "schedule") shall be used for both posts and rails. Additional loading shall be sustained by adding reinforcement to the post or by spacing the posts closer together.Bending Moments of Rail Components:

 On Horizontal Rail:

 Under Uniform Loading
M = w L^{2} (Bending Moment) where: w = Uniform Loading L = Post Spacing or Horizontal Rail Span K = 8 (for One or Two Spans) = 9.5 (for Three or More Spans)
 Under Uniform Loading
 Under Concentrated Loading
M = P L / K (Bending Moment) where: P = Concentrated Loading L = Post Spacing or Horizontal Rail Span K = 4 (for Single Span) = 5 (for Two or More Spans)

 On Horizontal Rail:

 On Intermediate Post:

 Under Uniform Loading
M = w L h (Bending Moment) where: w = Uniform Loading L = Post Spacing or Horizontal Rail Span h = Height of Post
 Under Uniform Loading
 Under Concentrated Loading
M = D P h (Bending Moment) where: P = Concentrated Loading h = Height of Post D = Load Proportion Factor = 65% (for Two Spans) = 62% (for Three or More Spans)

 On Intermediate Post:

 On End Post:

 Under Uniform Loading
M = w (L/2) h (Bending Moment) where: w = Uniform Loading L = Post Spacing or Horizontal Rail Span h = Height of Post
 Under Uniform Loading
 Under Concentrated Loading
M = D P h (Bending Moment) where: P = Concentrated Loading h = Height of Post D = Load Proportion Factor = 85% (for Two Spans) = 82% (for Three or More Spans)

 On End Post:
Load Proportion Factor, P_{f} or D:
In pipe railings, where posts and rails are of identical material and section and where post spacing usually varies between 3 feet and 6 feet, Load Proportion Factor is fairly uniform and the greatest proportion of a concentrated load carried by one post can be estimated as follows:End Posts: of a 2Span railing  85% of a railing of 3 or more spans  82% Intermediate Posts: of a 2Span railing  65% of a railing of 3 or more spans  60% For a more accurate proportion factor, the graph (nomograph) below has been used to determine railing load distribution. The graph has been determined by computer analysis and confirmed by laboratory test. The formula used in determining the graph assumes that all posts are of identical material and section.The Stiffness (k) of a rail or post is:k_{r} = E I / L (for the Rail) k_{p} = E I / hL (for the Post) The Stiffness Ratio (R) is determined as: R = k_{r} / k_{p}The Stiffness Ratio is then plotted on the graph to obtain a Load Proportion Factor (Pf). When the load proportion factor has been determined, it is multiplied by the total load to determine the load one post must sustain. If one or both ends of the railing are free standing, the end loaded condition must be assumed. If both ends of the run are laterally braced by a change in direction or attachment to a firm structure, the center loaded load proportion factor may be used.
(NOTE: If end posts differ from intermediate posts in strength, the load distribution pattern becomes indeterminate and end posts should then be designed to carry 100% of the concentrated load. Intermediate posts may then be designed to the center loaded condition. In single span railings, each post must be designed to carry the full concentrated load.)In single span railings, each post must be designed to carry the full concentrated load.Designing the Rails:
The design of railing system is comparable to finding the weakest link of the system. The weakest, and probably the most stressed railing component, determines the strength of the system.Since the strength of the railing system (for a given or selected railing sections and height) is a function of post spacing, the design of railing can be generalized and expressed in terms of the maximum permissible post spacing. The maximum permissible post spacing represents the spacing that the weakest railing component can achieve.With wrong choice of railing sections, a railing design may end up in a very strong post with a very weak horizontal rail; or a very strong horizontal rail with a very weak post. A good choice or a right combination of post and horizontal rail sections will yield a design that is both strong and economically practical.By equating the component's applied Bending Moment to its Flexural Strength, the span of rail, L, (or post spacing) can be solved. The stronger the component, the bigger the value of span it can attain. The least span attained by any component will be the design post spacing or the permissible spacing for the railing system.The following are the permissible 'L' attained by each component:
Horizontal Rail Under Uniform Loading
L_{max}  =  (K M_{r} / w)^{1/2}  
where:  
L_{max}  =  Maximum permissible Span  
M_{r}  =  Resisting Moment (or Allowable Flexural Strength)  
w  =  Uniform Load  
K  =  Bending Moment Constant 
Horizontal Rail Under Concentrated Loading:
L_{max}  =  K M_{r} / P  
where:  
P  =  Concentrated Load 
Intermediate Post Under Uniform Loading:
L_{max}  =  M_{r} / w h  
where:  
h  =  Height of Post 
Intermediate Post Under Concentrated Loading:
h_{max}  =  M_{r} / D P  
where:  
h_{max}  =  Maximum Permissible Height of Post  
D  =  Load Proportion Factor 
End Post Under Uniform Loading:
L_{max}  =  2 M_{r} / w h 
End Post Under Concentrated Loading:
h_{max}  =  M_{r} / D P 