Improvements in both theory and frequency metrology of few-electron systems such as hydrogen and helium have enabled increasingly sensitive tests of quantum electrodynamics, as well as ever more accurate determinations of fundamental constants and the size of the nucleus. At the same time, advances in cooling and trapping of neutral atoms have revolutionized the development of increasingly accurate atomic clocks. Here, we combine these fields to reach very high precision on an optical transition in the helium atom by employing a 4He Bose–Einstein condensate confined in a magic wavelength optical dipole trap. The measured transition accurately connects the ortho- and parastates of helium and constitutes a stringent test of quantum electrodynamics theory. In addition, we test polarizability calculations and ultracold scattering properties of the helium atom. Finally, our measurement lays the foundation for a determination of the 3He–4He nuclear charge radius difference with an accuracy exceeding that of muonic helium measurements currently being performed in the context of the proton radius puzzle.