The valence shell electronic states of pyrimidine and pyrazine have been studied experimentally and theoretically. The absolute photoabsorption cross sections have been measured between 4 and 40 eV, using synchrotron radiation, and are dominated by prominent bands associated with intravalence transitions. In contrast, the structure due to Rydberg excitations is weak, but series have been observed converging onto the X 2 B 2 or D 2 B 1 limits in pyrimidine and the X 2 A g or D 2 B 3g limits in pyrazine. A comparison between the photoabsorption spectrum of pyrazine-h 4 and that for pyrazine-d 4 , together with calculated transition energies, has helped clarify the assignments of the 6a g →npb 1u and npb 2u Rydberg series. The vibrational progressions associated with these states have been assigned through analogy with those in the corresponding photoelectron band. The time-dependent version of density functional theory has been used to calculate oscillator strengths and excitation energies for the optically allowed singlet-singlet valence transitions, and also to obtain the excitation energies for electric-dipole-forbidden and/or spin-forbidden transitions. These theoretical results have allowed many of the experimentally observed bands to be assigned and provide a generally satisfactory description of the valence shell photoabsorption spectrum. Several of the prominent bands appearing above the ionization threshold can be correlated with predicted intense intravalence transitions.