Regarding porosity formation and gas content, choosing the appropriate shielding gas for laser welding is essential for achieving high-quality joints. Keyhole-induced porosity formation tendency and nitrogen content in SS 304 stainless steel welds were investigated based on the nitrogen content in shielding gases during fiber laser welding. Beads-on-plate autogenous welds were made at 5 kW continuous wave (CW) fiber laser in N2 and Ar mixtures. Optical metallography, micro-focused X-ray, X-ray radiography, and high-speed images of the molten pool were used to investigate the porosity formation. In addition, a gas analyzer was used to study the weld metal nitrogen content. The results show that nitrogen significantly impacts the reduction of porosity in the melting zone and increases the dissolved nitrogen in the solidified weld metal, as using pure nitrogen leads to an increase in dissolved nitrogen by 36% higher than the nitrogen content in the base metal. In contrast, it has almost no significant effect on the keyhole mode.