The coastal pipelines are the key link between the offshore and the onshore pipelines, which are located in the soil dry-wet alternating environment. Even though higher corrosion risk of metals in coastal soil dry-wet alternating environment, few papers focused on this condition, while much research about ocean and atmospheric dry-wet alternating environment was paid attention to. In this paper, a self-designed soil dry-wet alternating experimental device was used to investigate the corrosion characteristics of Q235 steel in seawater, soil and dry-wet alternating environment based on mass loss experiments, corrosion morphology analysis and electrochemical experiments. The results showed that the general corrosion rate of Q235 steel in soil and seawater environments basically remained unchanged, and in dry-wet alternating environment increased with time, while the pitting rates were 0.280 mm/a (soil), 0.420 mm/a (seawater) and 0.567 mm/a (dry-wet alternation), respectively, which was caused by the oxygen concentration cell and salt concentration cell. Meanwhile, the growth rate of pitting size in dry-wet alternating environment was much higher than that in the other two environments with different corrosion characteristics of pitting corrosion (seawater and dry-wet alternation) and a changed from general corrosion to pitting corrosion (soil). In three environments, the corrosion current density (I
corr) increased, in which on the 30th day of experiment, I
corr = 79.72 μA/cm2 in dry-wet alternating environment, which was much higher than I
corr = 47.89 μA/cm2 in seawater environment. In dry-wet alternating environment, the mass diffusion impedance at 10-2 Hz and the maximum phase angle changed significantly, while the logf-log|Z| curve in low-middle frequency decreased significantly, and charge transfer resistance at 105 Hz reduced from 10.4 Ω to 4.3 Ω, illustrating an increasing corrosion rate.