The electronic structures and optical properties of rocksalt indium nitride (INN) under pressure were studied using the first-principles calculation by considering the exchange and correlation potentials with the generalized gradient approximation. The calculated lattice constant shows good agreement with the experimental value. It is interestingly found that the band gap energy Eg at the F or X point remarkably increases with increasing pressure, but Eg at the L point does not increase obviously. The pressure coefficient of Eg is calculated to be 44 meV/GPa at the F point. Moreover, the optical properties of rocksalt InN were calculated and discussed based on the calculated band structures and electronic density of states.