Abstract The electronic and optical properties of rock-salt gallium nitride (GaN) have been investigated using the first principles method based on the plane–wave basis set. Analysis of band structure suggests that the rock-salt GaN is a middle gap indirect semiconductor with the conduction band minimum and the valence band maximum locating at X point and Σ direction respectively. Within the screen-exchange local density approximation, the bandgap is predicted to be 1.83 eV. The optical properties including dielectric function, reflectivity, absorption and energy-loss function with some special features are obtained and analyzed. The calculated pressure coefficients of the indirect bandgaps at Γ, X and L points are very small, with the value of the smallest indirect bandgap determined to be 26 meV/GPa.