Electronic and optical properties of Sr(Ti,Zr)O3 crystals in the cubic (Pm-3m) and tetragonal (I4/mcm) phase were calculated by the first-principles calculations using the density functional theory and the local density approximation. The band structure of cubic and tetragonal phases show an indirect band gap at (R-Γ) point and at (M-Γ) point in the Brillouin zone, respectively. The linear photon-energy dependent dielectric functions and some optical properties such as the absorption coefficient, energy-loss function and reflectivity are calculated for both phases. The optical properties of tetragonal phase of Sr(Ti,Zr)O3 were investigated by theoretical methods for the first time. We have also made some comparisons with the available related experimental and theoretical data.