In recent years, with the rapid development of the coastal economy and the large-scale development of marine resources, power demand has risen sharply. So it is urgent to promote the construction of UHVDC projects. Coastal saline areas often contain more chloride and other salts than other inland areas due to the high humidity, salinity and light intensity of the marine climatic and environmental conditions, which lead to the different electrical performance of grounding electrodes under different layouts. Therefore, one of the key issues to realizing the rapid development of UHVDC in coastal countries is how to choose the best layout of the coastal DC grounding electrode. It is intended to simulate the coastal environment and establish a mixed stratified soil model using CDEGS to verify the validity of the model through experiments in this paper. Based on the mixed soil model, the changes in grounding resistance, surface potentials and step voltage of grounding electrode sites under zigzag shape, two-row and circular shapes layouts are studied. The results show that when the zigzag shape layout is selected, the ground potential amplitude of the grounding electrode is reduced by 45.77% and 42.7%, the step voltage amplitude is decreased by 39.85% and 32.22%, and the grounding resistance is decreased by 28.45% and 27.68%, compared with the two-row and circular layout. In addition, its utilization rate of electrodes is better than the other two layout shapes.