The electronic structure and optical properties of BaSnxTi1−xO3 (BSnT, 0 ≤ x ≤ 0.375) perovskite crystals have been investigated using the newly developed PBEsol and nKTBmBJ approaches within the full potential linear augmented plane wave (FPLAPW) method for potential applications in optoelectronics. The lattice parameter showed a0 a quasi-linear increase with Sn content (with a bowing parameter of ∼ 0.048 Å). The calculated formation energy indicates that BSnT crystals are thermodynamically stable. BSnT exhibits a direct bandgap within the Sn composition range of ∼ 0.03–0.375, which can cover the emission wavelengths within the UV–visible spectrum region of ∼ 375–442 nm. The addition of Sn dopants into BaTiO3 results in a significant increase in the bandgap (by ∼ 496 meV, up to x = 0.375) due to the resonant interaction between O_2p orbitals and Sn_4d states in the upper valence band. Furthermore, the dielectric functions (ε1, ε2), refractive index n, extinction coefficient k, reflectivity R, and absorption coefficient α were determined for the radiation range of 0–12 eV and were found to be in close agreement with experimental spectra. BSnT exhibits good absorption within the ultraviolet spectrum while remaining transparent within the visible spectrum. Sn-doped BaTiO3 holds great promise as a transparent and/or active layer in the development of modern/low-cost solar cells and light-emitting diodes (LEDs) for visible light communication (VLC).