The formation of hydrocarbons (HCs) upon interaction of metal and metal–carbon phases (solid Fe, Fe3C, Fe7C3, Ni, and liquid Fe–Ni alloys) with or without additional sources of carbon (graphite, diamond, carbonate, and H2O–CO2 fluids) was investigated in quenching experiments at 6.3 GPa and 1000–1400 °C, wherein hydrogen fugacity (fH2) was controlled by the Fe–FeO + H2O or Mo–MoO2 + H2O equilibria. The aim of the study was to investigate abiotic generation of hydrocarbons and to characterize the diversity of HC species that form in the presence of Fe/Ni metal phases at P–T–fH2 conditions typical of the upper mantle. The carbon donors were not fully depleted at experimental conditions. The ratio of H2 ingress and consumption rates depended on hydrogen permeability of the capsule material: runs with low-permeable Au capsules and/or high hydrogenation rates (H2O–CO2 fluid) yielded fluids equilibrated with the final assemblage of solid phases at fH2sample ≤ fH2buffer. The synthesized quenched fluids contained diverse HC species, predominantly light alkanes. The relative percentages of light alkane species were greater in higher temperature runs. At 1200 °C, light alkanes (C1 ≈ C2 > C3 > C4) formed either by direct hydrogenation of Fe3C or Fe7C3, or by hydrogenation of graphite/diamond in the presence of Fe3C, Fe7C3, and a liquid Fe–Ni alloy. The CH4/C2H6 ratio in the fluids decreased from 5 to 0.5 with decreasing iron activity and the C fraction increased in the series: Fe–Fe3C → Fe3C–Fe7C3 → Fe7C3–graphite → graphite. Fe3C–magnesite and Fe3C–H2O–CO2 systems at 1200 °C yielded magnesiowüstite and wüstite, respectively, and both produced C-enriched carbide Fe7C3 and mainly light alkanes (C1 ≈ C2 > C3 > C4). Thus, reactions of metal phases that simulate the composition of native iron with various carbon donors (graphite, diamond, carbonate, or H2O–CO2 fluid) at the upper mantle P–T conditions and enhanced fH2 can provide abiotic generation of complex hydrocarbon systems that predominantly contain light alkanes. The conditions favorable for HC formation exist in mantle zones, where slab-derived H2O-, CO2-and carbonate-bearing fluids interact with metal-saturated mantle.