A device for rapidly measuring the surface flatness of an object of the invention belongs to the technical field of optical inspection and testing of industrial production machinery. The device is composed of an illumination imaging module and a motion mechanism; the illumination imaging module is composed of an illumination system and an imaging system; in the illumination system, a laser, a beamsplitter, an objective lens and a measured object are sequentially arranged along the light propagation direction; in the imaging system, an object to be tested, an objective lens, a beam splitter, an attenuator, a pinhole and an image sensor are sequentially arranged along the light propagation direction; the moving mechanism consists of an upper fixed end, an upper rod, a moving block, a lowerrod, a lower fixed end, a motor, a coupling, a T type turntable and a limit protrusion; when the motion block is in motion, a beam emitted by the laser is defocused to the surface of the object to betested, and a beam reflected by the object to be tested is defocused onto the pinhole. The device not only can qualitatively detect the surface flatness of the object, but also is simple in operationprocess and easy in operation method, and can filter or monitor the noise, and the detection result is accurate.