NbN films are deposited using direct current reactive magnetron sputtering in discharge of a mixture of N2 and Ar gas, and the effects of substrate bias (Vb) on the preferred orientation, phase transition, and mechanical properties for NbN films are explored by x-ray diffraction, selective area electron diffraction, and nanoindentation measurements. It is found that Vb has a significant influence on the stress in NbN films, leading to a pronounced change in the preferred orientation, phase structure, and hardness. As the substrate is at voltage floating, the stress is tensile. In contrast, as negative Vb is applied, the stress becomes compressive, and increases with increasing the absolute value of negative Vb. It is observed that a phase transition from δ (face-centered cubic) to δ′ (hexagonal) for NbN films occurs as Vb is in the range of -80to-120V, which can be attributed to a decrease in the strain energy for NbN films. In order to explore the relationship between the stress and phase transition as well as preferred orientation, density-functional theory based on first principles is used to calculate the elastic constants and shear modulus for NbN with a structure of δ or δ′. The calculated results show that the shear modulus for δ′-NbN is larger than that for δ-NbN, whereas the bulk modulus for δ′-NbN is almost equal to that for - δ-NbN, resulting in a difference in hardness for δ- or δ′-NbN single crystal.