This paper took a railway wagon underframe flipping machine of a railway company as the research object and introduced its flipping process and working principle. To solve the current problems of underframe slipping and the over-deformation of the clamping mechanism and underframe, the structure of the flipping machine was improved in design. By adding centering clamping blocks to clamp both sides of the underframe, the problem of the underframe slipping was solved. A mechanical analysis of the improved clamping mechanism was conducted, and the results showed that the thrust required by the hydraulic cylinder of the improved clamping mechanism was reduced from 200 kN to 128 kN. Finite element analysis of the clamping mechanism and underframe was conducted based on Workbench software. The results showed that the maximum deformation of the improved clamping mechanism was reduced from 4.4497 mm to 2.5395 mm, and the maximum deformation of the improved underframe was reduced from 5.8123 mm to 3.1583 mm. The above results verify that the stability of the improved flipping machine has been greatly improved, and it can better realize the clamping and flipping of the railway wagon underframe.