Various UV absorbers have been used to improve weatherability, especially, triazole and triazine types, which are highly resistant to UV-vis, are mainly used in the paint and coating application. 1-H-traizole and 2-(2'-Hydroxy-5'-methylphenyl)-benzotriazole as a triazole type and 2-[4-[(2-Hydroxy-3-dodecyloxypropyl)oxyl-2-hydroxyphenyl]-4,6-bis(2,4-dimethylphenyl)-1,3,5-triazine as a triazine type were chosen to study the structural, spectral, and electronic properties by density functional theory (DFT) and time-dependent DFT (TD-DFT) methods in the absence or presence of solvent with different polarity. In the vertical excitation, there was no structural change, but it showed a large difference from the ground state energy. The internal convergence showed pyramidalization, but the energy did not show much difference from the ground state. As the polarity of the solvent increases, the compatibility tends to increase. Especially, the free energy of 2-[4-[(2-Hydroxy-3-dodecyloxypropyl)oxyl-2-hydroxyphenyl]-4,6-bis(2,4-dimethylphenyl)-1,3,5-triazineis larger and thus the compatibility with the solvent is higher. The UV-vis spectrum band was formed and shifted according to photoexcitation and compared with the experimental results. Molecular orbital analysis at the time of shifting to a longer wavelength during UV absorption resulted from pi ->pi* and n -> pi*. In the presence of a long alkyl chain, a spectrum of long wavelengths with low energy variation is produced.