An analytical method of the elastic and the inelastic lateral buckling of restrained beams is presented using the transfer matrix method. The field transfer matrix is derived under the assumption that each element is in a uniform bending moment and it is presented that the various restraints against the out of plane deformations at the supports and in the spans can be considered in the analysis using the point transfer matrix. The treatments of the boundary conditions and the effects of the locations of loadings are given. Using this method, the numerical examples are presented for simply supported beams and two-span continuous beams.