Interaction of CO and CH4 with palladium is a relevant process in numerous catalytic reactions, which may induce structural changes in the metal affecting its catalytic properties This work establishes a systematic study of the evolution of the atomic and electronic structure in alumina- and carbon-supported palladium nanoparticles in presence of CO and CH4 gases at temperatures from 50 to 350 °C by a combination of in situ X-ray absorption and infrared spectroscopies. Immediate adsorption of CO molecules with formation of surface carbon deposits due to the disproportionation reaction occurs at low temperatures, while above 250 °C, active formation of bulk palladium carbide is observed. In CH4 the later process starts only at ca. 350 °C. Reduction of palladium and contraction of the Pd-Pd interatomic distances were observed with increasing temperature irrespective of the gas atmosphere, including the inert one, particle size and the type of support. For carbon supported samples formation of palladium carbide occurred above 200 °C due to the decomposition of the support.