The pitting corrosion behaviour of 17-4PH (H900) stainless steel during static corrosion (SC), flow-induced corrosion (FIC) and erosion–corrosion (EC) conditions was studied. In comparison with SC, reduction in both corrosion potential (Ecorr) and pitting potential (Epit) was observed in the EC measurement with sand particles. This behaviour was attributed to the presence of depassivated areas with lower potential on the surface that moves Ecorr towards lower values and provided favourable locations for pit formation. Acceleration in the access of oxygen to the surface increased meaningfully the Ecorr in FIC condition and pitting corrosion occurred during open-circuit potential (OCP) measurement in the absence of external polarisation. However, long-term OCP measurements in SC and EC circumstances did not show stable pitting. Consequently, it was proposed that in some conditions, the FIC without eroding particles could be more detrimental compared to slurry EC. © 2020, Springer Nature Switzerland AG.