We present detailed investigations of the electronic and optical properties of K3V5O14, including the band structure, density of states (DOS), population analysis, dielectric function, refractive index and second-order nonlinear susceptibilities. The calculations are performed using the abinitio pseudopotential density functional method combined with an anharmonic oscillator model, in which we employ the Perdew-Burke- Eruzerhof form of the generalized gradient approximation together with plane-wave basis sets for expanding the periodic electron density. From the band calculation, K3V5O14 is predicted to be an indirect band gap semiconductor. From the DOS and population analysis, we find that the bonding between K+ and V5O14 layers is mainly ionic while that between V and O is covalent. It is indicated that the hybridization of V-3d with the O-2p states is very important for the optical properties of K3V5O14. The calculated birefringence is large enough to achieve phase-matchable conditions, and our calculated second-harmonic-generation (SHG) coefficients agree with experimental results.