Gaseous nitrocarburizing improves wear and corrosion resistance of machine components. This is primarily based on the compound layer that consists of carbonitrides. The composition and the porosity of the compound layer are the principal influencing factors of the properties of the surface layer. They are influenced by the nitriding, carburizing, and oxidation potentials (KN, KCB, and KO) of the process atmosphere. Until now, there is insufficient information about the influence of CO and CO2 and the ratio between them on the relevant potentials and, therefore, on the white layer development. This issue is addressed in the present work. The gaseous nitrocarburizing was carried out on alloyed steels (AISI 4142, AISI H13, and AISI 420) with the addition of CO or CO2 as carbon donator. The resulted potentials (KN, KCB, and KO) were detected using oxygen and hydrogen sensors and the generated surface layers were characterized by means of optical microscope and glow discharge optical emission spectroscopy (GDOS). The investigation proved that CO2 leads to lower carburizing but higher oxidation potential than CO. The typical potential KCB was 0.1 and KO was 0.11 in the nitrocarburizing atmosphere by supplying 4.8 % CO2 in the input gas mixture, whereas the potential KCB was 0.4 and KO was 0.015 by supplying 2.4 % CO. It was recognized that the carburizing reaction of the nitrocarburizing proceeds via CO as in the case of the pure carburizing process, and CO as an essential carbon donator increases carbon concentration in the compound layer effectively. Consequently, the growth and the porosity of the layer are influenced differently by CO and CO2. The degree of this influence depends on the chemical composition of the steels additionally. With the findings of the present investigation possible mechanisms of the pore formation are discussed.