The utility model provides a device for measuring the roundness of inner and outer steel rings of a bearing, which is characterized in that a sliding chute is arranged on a rotary table, and a driving frame is coaxially and rotatably arranged below the rotary table; the driving frame comprises driving grooves formed in the radial direction of the rotary table, the projections of the driving grooves and the projections of the sliding grooves on the rotary table are matched in a crossed mode, the driving grooves and the sliding grooves are arranged in a one-to-one alignment mode, the positioning blocks are arranged in the sliding grooves and the driving grooves in a surrounding mode at intervals in the circumferential direction of the rotary table, and the positioning blocks can be positioned at the crossed points of the sliding grooves and the driving grooves. The driving frame is in transmission connection with the second driver, and when the second driver drives the driving frame to rotate, the positioning blocks located at the intersection position of the driving groove and the sliding groove can be synchronously gathered or synchronously diverged, so that the to-be-detected steel ring arranged on the rotary table is coaxially fixed to the rotary table. The device for measuring the roundness of the inner and outer steel rings of the bearing is simple and effective in linkage driving structure for the positioning block, and can effectively reduce the hardware cost.