The charge-coupled device (CCD) array spectrometers are increasingly being used in wide variety of scientific researches and industrial applications. However, all CCD detectors suffer some amount of non-linear behavior on response to light, and the accuracy of the CCD array spectrometer measurement will be influenced from the non-linear behavior, the detectable error is presented. Therefore, the non-linearity correction method is important to obtain the accurate results of spectrometers based on the CCD. Here, we proposed a convenient experiment and calculation method to solve the problem of non-linearity. With the combined values of all the pixels across the detector, a 7th order polynomial is fitted in the relation between the normalized counts per second and counts, and the correction coefficients were generated by this polynomial for the pixels. The method to apply the correction is dividing the original response by the calculated correction coefficients for all the pixels. Finally, the CCD detector response is linear to >99.5% after correcting for the non-linearity of spectrometers, experimental results show that the proposed method is reasonable and efficient.