SiOxNyHz films were deposited from O2, N2, and SiH4 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=Φ(O2)/Φ(SiH4) and the relative content of Si is determined by R=[Φ(O2)+Φ(N2)]/Φ(SiH4) where Φ(SiH4), Φ(O2), and Φ(N2) are the SiH4, O2, and N2 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 SiH4 partial pressure during deposition; while those samples deposited at high SiH4 partial pressure show evidence of sepa- ration 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 SiOxNyHz films was higher than in SiO2 and lower than in silicon nitride films. © 2003 American Institute of Physics.