Structural, elastic, electronic and optical properties of hexagonal β-Nb2N and β-Ta2N compounds are studied for different pressures. The computational technique is based on a plane wave pseudo potential (PWPP) method. The exchange correlation is treated using a generalized gradient approximation (GGA). We evaluate ground state quantities such as lattice parameter, bulk modulus and its pressure derivative, as well as elastic constants. The calculated equilibrium lattice is in rather good agreement with experimental data. Elastic constants and their pressure dependence are calculated using a static finite strain technique. We derive bulk and shear moduli, Young's modulus and Poisson's ratio for ideal polycrystalline β-Nb2N and β-Ta2N aggregates. Also, we present results of densities of states. Furthermore, starting from dynamical optical properties, the static dielectric constant ε(ω = 0) is calculated for both compounds, along with the corresponding static refractive index n(0). The present results are a pioneer quantitative theoretical prediction of elastic, electronic and optical properties in the case of β-Nb2N and β-Ta2N compounds.