The stability of groundwater salinity has important practical significance for the healthy development of groundwater in China, especially in areas where groundwater is over-exploited. In order to improve the fitting precision and prediction effect of groundwater salinity, this paper constructed a series of fitting and prediction models of groundwater salinity based on grey theory and MATLAB.Taking Yongnian County of Handan City as an example, this paper adopted the data of groundwater salinity of three monitoring wells in this region from 2010 to 2015 for an empirical study.The fitting results of GM(1,N) model were compared with the fitting results of GM(1,1) and MATLAB linear regression models. The results showed that the absolute relative error of the GM(1,N) model in the three monitoring wells was 0.4391%, 0.2540%, 0.4675%, and the accuracy was A. Compared with other models, the prediction effect is better, which can meet the needs of groundwater mineralization prediction in Yongnian County. The prediction results can provide a scientific basis for the work of groundwater management and groundwater mineralization in Yongnian County in the next few years.