The pore sizes affected by different drilling parameters during high power density laser and electron beam welding processes are theoretically determined in this study. The drilling parameters include incident energy absorbed by the mixture in the keyhole, radius, and Mach number at the base, drilling speed, and location of the shock wave or surrounding pressure. The factors affecting the pore sizes are still lacking, even though porosity often occurs and limits the widespread industrial application of keyhole mode welding. In order to determine the pore shape, this study introduces the equations of state at the times when the keyhole is about to be enclosed and when the temperature drops to melting temperature. The gas pressure, temperature, and volume required at the time when the keyhole is about to be closed are determined by calculating the compressible flow of the vapor–liquid dispersion in a vertical keyhole with varying cross sections, paying particular attention to the transition between annular and slug flows. It is found that the final pore size decreases as absorbed energy, radius, and Mach number at the base increase, and decreases axial location of the shock wave or higher surrounding pressure for the keyhole containing a supersonic mixture. For a subsonic mixture in the keyhole, the final pore size decreases as released energy, radius, and Mach number at the base increase. This work provides an exploratory and systematical investigation of the pore size during keyhole mode welding.