Metal carbides are good candidates to contact carbon-based semiconductors ͑SiC, diamond, and carbon nanotubes͒. Here, we report on an in situ study of carbide formation during the solid-state reaction between thin Ti or Mo films and C substrates. Titanium carbide ͑TiC͒ was previously reported as a contact material to diamond and carbon nanotubes. However, the present study shows two disadvantages for the solid-state reaction of Ti and C. First, because Ti reacts readily with oxygen, a capping layer should be included to enable carbide formation. Second, the TiC phase can exist over a wide range of composition ͑about 10%, i.e., from Ti 0.5 C 0.5 to Ti 0.6 C 0.4 ͒, leading to significant variations in the properties of the material formed. The study of the Mo-C system suggests that molybdenum carbide ͑Mo 2 C͒ is a promising alternative, since the phase shows a lower resistivity ͑about 45% lower than for TiC͒, the carbide forms below 900°C, and its formation is less sensitive to oxidation as compared with the Ti-C system. The measured resistivity for Mo 2 C is =59 ⍀ cm, and from kinetic studies an activation energy for Mo 2 C formation of E a = 3.15± 0.15 eV was obtained.