Abstract Capillaries, 1 mm in diameter and 17 mm in depth, were infiltrated at a temperature of 1100°C and pressures of 20 kPa (pure methane) and 30 kPa (methane–hydrogen mixture (7:1)). The residence time of the gas in the deposition reactor was 0.5 s, at the lower pressure of 20 kPa, residence times of 1 and 2 s were studied additonally. The thickness of the deposited carbon layers was determined using a X-ray microscope, i.e., without cutting the samples. In the experiments with 0.5 and 1 s residence times an increase of the deposition rate from the mouth to the depth of the pores was obtained. The gradient of the deposition rate decreases with increasing residence time of the gas and becomes negative at 2 s. Hydrogen, either formed by decomposition of methane or added to the feed gas, leads to an increase in the gradient. The homogeneous–heterogeneous model of carbon deposition from methane is used to interpret the results with special consideration of deposition chemistry and diffusivity of the relevant hydrocarbon species.