With the improvement of the antiknock performance of warships, shaped charge warheads have been focused on and widely used to design underwater weapons. In order to cause efficient damage to warships, it is of great significance to study the formation of shaped charge projectiles in air and water. This paper uses Euler governing equations to establish numerical models of shaped charges subjected to air and underwater explosions. The formation and the movement of Explosively Formed Projectiles (EFPs) in different media for three cases: air explosion and underwater explosions with and without air cavities are discussed. First, the velocity distributions of EFPs in the formation process are discussed. Then, the empirical coefficient of the maximum head velocity of EFPs in air is obtained by simulations of air explosions of shaped charges with different types of explosives. The obtained results agree well with the practical solution, which validates the numerical model. Further, this empirical coefficient in water is deduced. After that, the evolutions of the head velocity of EFPs in different media for the above three cases are further compared and analyzed. The fitting formulas of velocity attenuation of EFPs, which form and move in different media, are gained. The obtained results can provide a theoretical basis and numerical support for the design of underwater weapons.