Based on a plane-wave pseudopotential method,the electronic structure calculations of NaNO2 from first principles are perforined.The linear refractive indices and the static second-harmonic generation (SHG) coefficients are also calculated by the SHG formula improved by us.The calculated values are in good agreement with the experimental values.A real-space atom-cutting method is adopted to analyze the respective contributions of the cation and anionic groups to optical response.The results show that the contribution of the (NO2)- anionic group to the birefringence and the SHG coefficients is dominated in NaNO2 crystal,which is in agreement with the result obtained by the anionic group model.