SiO x N y H z films were deposited from O 2 , N 2 , and SiH 4 gas mixtures at room temperature using the electron cyclotron resonance plasma method. The absolute concentrations of all the species present in the films ͑Si, O, N, and H͒ were measured with high precision by heavy-ion elastic recoil detection analysis. The composition of the films was controlled over the whole composition range by adjusting the precursor gases flow ratio during deposition. The relative incorporation of O and N is determined by the ratio Qϭ(O 2 )/(SiH 4 ) and the relative content of Si is determined by R ϭ͓(O 2 )ϩ(N 2 )͔/(SiH 4 ) where (SiH 4 ), (O 2 ), and (N 2 ) are the SiH 4 , O 2 , and N 2 gas flows, respectively. The optical properties ͑infrared absorption and refractive index͒ and the density of paramagnetic defects were analyzed in dependence on the film composition. Single-phase homogeneous films were obtained at low SiH 4 partial pressure during deposition; while those samples deposited at high SiH 4 partial pressure show evidence of separation of two phases. The refractive index was controlled over the whole range between silicon nitride and silicon oxide, with values slightly lower than in stoichiometric films due to the incorporation of H, which results in a lower density of the films. The most important paramagnetic defects detected in the films were the K center and the EЈ center. Defects related to N were also detected in some samples. The total density of defects in SiO x N y H z films was higher than in SiO 2 and lower than in silicon nitride films.