We reported the usage of grating-based X-ray phase-contrast imaging in nondestructive testing of grating imperfections. It was found that electroplating flaws could be easily detected by conventional absorption signal, and in particular, we observed that the grating defects resulting from uneven ultraviolet exposure could be clearly discriminated with phase-contrast signal. The experimental results demonstrate that grating-based X-ray phase-contrast imaging, with a conventional low-brilliance X-ray source, a large field of view and a reasonable compact setup, which simultaneously yields phase- and attenuation-contrast signal of the sample, can be ready-to-use in fast nondestructive testing of various imperfections in gratings and other similar photoetching products.