We obtained the electronic spectra of various methylated xanthine compounds including caffeine in a supersonic jet by resonant two-photon ionization spectroscopy. The methyl group in the tested methylated xanthine compounds has a distinct, site-dependent effect on the electronic spectrum. Methylation at the N3 position causes a significant red shift of the ππ* state, whereas methylation at the N1 position has only minimal effects on the electronic spectrum. The notably broad spectra of theobromine and caffeine result from methyl substitution at the N7 position, which causes a large displacement between the potential energy surfaces of the S0 and S1 states, and a strong vibronic coupling. We also investigated the internal rotation of the methyl group and its effect on the electronic spectrum of the methylated xanthine compounds. We found that the barrier height for the torsional motion in the ground state is significantly affected by a carbonyl or methyl group that lies close to the methyl group of interest. In contrast, the torsional barrier in the excited state is governed by the hyperconjugation interaction in the lowest unoccupied molecular orbital. The agreement between the experimental and simulated spectra of torsional vibronic bands suggested that the low frequency torsional vibrations arising from the tunneling splitting and the coupling between the torsional and molecular motions give theobromine and theophylline the multiplet nature of their origin bands. This study provides a new level of understanding for the methyl substitution effects on the electronically excited states of xanthine compounds, which may very well be applicable to many other methyl substituted biomolecules including DNAs and proteins.