One of the most striking predictions of Einstein's special theory of relativity is also perhaps the best known formula in all of science: E=mc2. If this equation were found to be even slightly incorrect, the impact would be enormous — given the degree to which special relativity is woven into the theoretical fabric of modern physics and into everyday applications such as global positioning systems. Here we test this mass–energy relationship directly by combining very accurate measurements of atomic-mass difference, Δm, and of γ-ray wavelengths to determine E, the nuclear binding energy, for isotopes of silicon and sulphur. Einstein's relationship is separately confirmed in two tests, which yield a combined result of 1−Δmc2/E=(−1.4±4.4)×10−7, indicating that it holds to a level of at least 0.00004%. To our knowledge, this is the most precise direct test of the famous equation yet described.