Pitting corrosion poses a significant hidden risk to the reliable operation of stainless steel equipment. In this study, the evolution of pitting corrosion in stainless steel in marine environments was simulated by developing two-dimensional cellular automata (CA). The model demonstrated its capability to generate corrosion sectional views and top views that were consistent with experimental results. The simulation results obtained from the CA pitting corrosion model converged with the experimental data, yielding minimal errors of 4%. This convergence substantiated the effective ability of the model to simulate pitting corrosion evolution. When the CA model was used to predict pitting development in stainless steel, the obtained predicted values aligned within a 10% margin of error compared with experimental values. The developed CA model was used as a foundation to investigate the effect of chloride ion concentration on both pitting rate and pit morphology. The result showed that the impact of chloride ions concentration on pitting growth was more significant when concentrations were below 3.5wt.%. The establishment of the CA model makes it possible to simulate and predict pitting development patterns, thereby providing guidance for ensuring the safe operation of marine equipment.