We have carried out a systematic study of the crystal electric field excitations in the family of cubic pyrochlores Er2B2O7, with B = Ge, Ti, Pt, and Sn, using neutron spectroscopy. All members of this family are magnetic insulators based on 4f11 Er 3+ and non-magnetic B 4+ . At sufficiently low temperatures, long-range antiferromagnetic order is observed in each of these Er2B2O7 pyrochlores. Our inelastic neutron scattering measurements probe the transitions from the ground state doublet to excited crystal electric field states belonging to the J = 15/2 Hund's rules manifold. This allows us to quantitatively determine the energy eigenvalues and eigenfunctions of these (2J + 1) = 16 states across the Er2B2O7 series. The different ionic sizes associated with different non-magnetic B 4+ cations correspond to positive or negative chemical pressure, depending on the relative contraction or expansion of the crystal lattice, which gives rise to different local environments at the Er 3+ site. Our results show that the g-tensor components are XY-like for all four members of the Er2B2O7 series. However, the XY anisotropy is much stronger for Er2Pt2O7 and Er2Sn2O7 ( g ⊥/g z > 25), than for Er2Ge2O7 and Er2Ti2O7 ( g ⊥/g z < 4). The variation in the nature of the XY-anisotropy in these systems correlates strongly with their ground states, as Er2Ge2O7 and Er2Ti2O7 order into Γ5 magnetic structures, while Er2Pt2O7 and Er2Sn2O7 order in the Γ7 Palmer-Chalker structure.