In this paper, a compact x-ray densitometry system consisting of a 50 kV, 1 mA x-ray tube and several linear detector arrays is developed for two-phase flow measurement. The system is capable of measuring void fraction and velocity distributions with a spatial resolution of 0.4 mm per pixel and a frequency of 1000 Hz. A novel measurement model has been established for the system which takes account of the energy spectrum of x-ray photons and the beam hardening effect. An improved measurement accuracy has been achieved with this model compared with the conventional log model that has been widely used in the literature. Using this system, void fraction and velocity distributions are measured for a bubbly and a slug flow in a 25.4 mm I.D. air–water two-phase flow test loop. The measured superficial gas velocities show an error within ±4% when compared with the gas flowmeter for both conditions.