Various engineering structures include lightweight or thin-walled beam structures that are used in a complex loading situation which includes restrained torsion of closed or open section. The importance of restrained torsion of thin-walled cross-sections is significant as the deformations and stresses caused by torsion affect the behaviour of the structures with open as well as closed section. The aim of this study is to demonstrate and compare different methods used to develop stiffness matrix for the finite element beam calculation of open and closed thin-walled sections with restrained torsion. The beam stiffness matrices are presented and graphically compared in order to choose the most convenient method for advanced structural analysis of thin-walled 3D beams with restrained torsion. The interpolation functions containing hyperbolic and approximate functions are considered, which satisfy the governing differential equation for torsion, with different value of characteristic number of torsion (θ). Comparing both methods, we can conclude that both are similar for small value of θ and this is commonly considered for open thin-walled section as their value of θ is small. The percentage of error between the results obtained by two methods of element stiffness matrix development for torsion with restrained warping is given graphically. Based on this study, numerical examples are considered and compared with results obtained by different finite element software. The examples include restrained and free torsion which are nonuniform and uniform torsion, respectively.