The electronic structure of the divalent Eu compound EuAl4, which shows a charge density wave transition at TCDW = 140 K, was studied by hard X-ray angle-integrated photoelectron spectroscopy (HAXPES) and soft X-ray angle-resolved photoelectron spectroscopy (ARPES). The valence band and core-level spectra obtained by HAXPES are consistent with the divalent nature of Eu atoms in EuAl4. From the ARPES results, the Fermi surface as well as band structure in the vicinity of the Fermi energy (EF) of EuAl4 are very similar to those of its isostructural divalent Sr compound SrAl4, which has no 4f electrons. This suggests that the Eu atoms are divalent in EuAl4, and the 4f electrons are localized below 1.8 eV with the Eu 4f7 electronic configuration in the ground state. The ARPES spectra measured along the Γ-(Σ)-Z high-symmetry line did not show significant temperature dependences above and below TCDW within the energy resolution of 80-90 meV. Moreover, the Fermi surface mapping along the kz direction showed that both EuAl4 and SrAl4 have mostly three-dimensional electronic structures, suggesting that the nesting of the Fermi surface is not simple. The Fermi surface and the band structure of EuAl4 were well explained by the band-structure calculation of SrAl4 based on the local density approximation.