Abstract D.c. magnetron sputtered NbN x films have been prepared in a pure nitrogen atmosphere in order to study the transport properties near the metal-insulator transition of granular films. The influence of the sputtering parameters on the structural properties and composition of the films has been studied. The ratio RR between resistances at 77 and 300 K was shown to be a very useful and simple parameter for classifying our films. All films exhibited a columnar structure and are formed of δ-NbN crystallites surrounded by an amorphous insulating phase. The porosity of the films favours their post-oxidation at ambient atmosphere. The oxygen concentration in the films has an important effect on the resistivity values and it is demonstrated that there exists a linear relation between In RR and the ratio between the concentrations of oxygen and nitrogen atoms in the films. A series of samples were obtained with room temperature resistivities between 14 μ cm and 1 mμ cm. The resistivity variations with T evolve from a disordered-semiconductor-like behaviour to a disordered metal behaviour of the classical superconducting NbN phase.