In this paper, we report a capillary-based Mach–Zehnder (M–Z) interferometer that could be used for precise detection of variations in refractive indices of gaseous samples. The sensing mechanism is quite straightforward. Cladding and core modes of a capillary are simultaneously excited by coupling coherent laser beams to the capillary cladding and core, respectively. An interferogram would be generated as the light transmitted from the core interferes with the light transmitted from the cladding. Variations in the refractive index of the air filling the core lead to variations in the phase difference between the core and cladding modes, thus shifting the interference fringes. Using a photodiode together with a narrow slit, we could interrogate the fringe shifts. The resolution of the sensor was found to be ~5.7 × 10−8 RIU (refractive index unit), which is comparable to the highest resolution obtained by other interferometric sensors reported in previous studies. Finally, we also analyze the temperature cross sensitivity of the sensor. The main goal of this paper is to demonstrate that the ultra-sensitive sensing of gas refractive index could be realized by simply using a single capillary fiber rather than some complex fiber-optic devices such as photonic crystal fibers or other fiber-optic devices fabricated via tricky fiber processing techniques. This capillary sensor, while featuring an ultrahigh resolution, has many other advantages such as simple structure, ease of fabrication, straightforward sensing principle, and low cost.